From b8558556ece5b14c3a379b303970d0082cccccbb Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Sun, 29 Oct 2023 12:22:32 +0100
Subject: [PATCH] BUILD: Trying again to do things in the docker build

---
 .dockerignore                               |  1 +
 lektord/src/main.rs                         |  5 +----
 utils/scripts/docker/package_appimages.bash |  2 +-
 utils/scripts/docker/prepare_workspace.bash |  1 -
 utils/scripts/docker/setup_base.bash        |  2 +-
 utils/scripts/docker/touch_files.bash       | 11 ++++++-----
 6 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 44111dfd..e231e590 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,6 +1,7 @@
 .build/
 .build.*/
 .dockerignore
+*.AppImage
 
 target/
 appimage/
diff --git a/lektord/src/main.rs b/lektord/src/main.rs
index 91bcc2d6..9615519f 100644
--- a/lektord/src/main.rs
+++ b/lektord/src/main.rs
@@ -7,10 +7,7 @@ mod listen;
 mod mpris;
 mod routes;
 
-pub use app::*;
-pub use config::*;
-pub use error::*;
-pub use listen::*;
+pub use self::{app::*, config::*, error::*, listen::*};
 
 use anyhow::{Context, Result};
 use cmd::SubCommand;
diff --git a/utils/scripts/docker/package_appimages.bash b/utils/scripts/docker/package_appimages.bash
index fa70e202..d950d791 100755
--- a/utils/scripts/docker/package_appimages.bash
+++ b/utils/scripts/docker/package_appimages.bash
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-set -xe
+set -e
 [ ! -f /build/.gitignore ] && {
     echo "The appimage folder is not mounted in the docker"
     exit 1
diff --git a/utils/scripts/docker/prepare_workspace.bash b/utils/scripts/docker/prepare_workspace.bash
index 3bcc61b6..b7eab44b 100755
--- a/utils/scripts/docker/prepare_workspace.bash
+++ b/utils/scripts/docker/prepare_workspace.bash
@@ -22,5 +22,4 @@ else
     for PKG in kurisu_api lektor_* lkt amadeus lektord; do
         cargo clean -p ${PKG}
     done
-    rm -rf kurisu_api lektor_* lkt amadeus lektord
 fi
diff --git a/utils/scripts/docker/setup_base.bash b/utils/scripts/docker/setup_base.bash
index bbdf53c6..ca84c295 100755
--- a/utils/scripts/docker/setup_base.bash
+++ b/utils/scripts/docker/setup_base.bash
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-set -xe
+set -e
 
 ARCH=$(arch)
 PKG_BASE="make libmpv-dev cmake clang clang-format manpages man-db"
diff --git a/utils/scripts/docker/touch_files.bash b/utils/scripts/docker/touch_files.bash
index ecf319a7..a93c3262 100755
--- a/utils/scripts/docker/touch_files.bash
+++ b/utils/scripts/docker/touch_files.bash
@@ -7,10 +7,11 @@ shopt -s globstar
     exit 1
 }
 
-# Remove the thing we used to setup the build cache...
-rm -rf kurisu_api lektor_* lkt amadeus lektord
-
 # Get the sources...
-for THING in /src/*; do
-    cp -rf ${THING} .
+for SOURCE in /src/**; do
+    [ -f ${SOURCE} ] \
+        && [[ ! ${SOURCE} == "/src/build"* ]] \
+        && [[ ! ${SOURCE} == "/src/utils"* ]] \
+        && [[ ! ${SOURCE} == "/src/compile_commands.json" ]] \
+        && install -CD ${SOURCE} $(realpath --relative-base=/src/ ${SOURCE})
 done
-- 
GitLab