OSDN Git Service

[fix] : FIxed clean command
authorhayao <hayao@fascode.net>
Fri, 16 Apr 2021 09:40:25 +0000 (18:40 +0900)
committerhayao <hayao@fascode.net>
Fri, 16 Apr 2021 09:40:25 +0000 (18:40 +0900)
build.sh

index 9831860..cc81a33 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -352,14 +352,6 @@ _run_cleansh(){
 
 # Check the build environment and create a directory.
 prepare_env() {
-    # Set dirs
-    work_dir="$(realpath "${work_dir}")"
-    build_dir="${work_dir}/build"
-    cache_dir="${work_dir}/cache/${arch}"
-    airootfs_dir="${build_dir}/${arch}/airootfs"
-    isofs_dir="${build_dir}/iso"
-    lockfile_dir="${build_dir}/lockfile"
-
     # Check packages
     if [[ "${nodepend}" = false ]]; then
         local _check_failed=false _pkg _result=0
@@ -383,11 +375,6 @@ prepare_env() {
         if [[ -z "$(lsmod | getclm 1 | grep -x "loop")" ]]; then modprobe loop; fi
     fi
 
-    # Create dir
-    for _dir in "${build_dir}" "${cache_dir}" "${airootfs_dir}" "${isofs_dir}" "${lockfile_dir}"; do
-        mkdir -p "${_dir}"
-    done
-
     # Check work dir
     if [[ "${normwork}" = false ]]; then
         msg_info "Deleting the contents of ${build_dir}..."
@@ -1302,6 +1289,19 @@ else
     channel_dir="${script_path}/channels/${channel_name}"
 fi
 
+# Set dirs
+work_dir="$(realpath "${work_dir}")"
+build_dir="${work_dir}/build"
+cache_dir="${work_dir}/cache/${arch}"
+airootfs_dir="${build_dir}/${arch}/airootfs"
+isofs_dir="${build_dir}/iso"
+lockfile_dir="${build_dir}/lockfile"
+
+# Create dir
+for _dir in "${build_dir}" "${cache_dir}" "${airootfs_dir}" "${isofs_dir}" "${lockfile_dir}"; do
+    mkdir -p "${_dir}"
+done
+
 # Set for special channels
 if [[ -d "${channel_dir}.add" ]]; then
     channel_name="${1}"