Przeglądaj źródła

Separate dependency lock files

bryan 5 miesięcy temu
rodzic
commit
63cd99cd4d
1 zmienionych plików z 153 dodań i 150 usunięć
  1. 153 150
      openwrtbuilder

+ 153 - 150
openwrtbuilder

@@ -153,161 +153,164 @@ parse_input() {
 
 install_dependencies() {
   debug "${FUNCNAME[0]}"
-  local lock_file="$BUILDROOT/.dependencies"
   local -a pkg_list
-
-  # TODO please contribute your platform here
+  local lock_file
   if ((FROM_SOURCE)); then
-    # For building from source with make
-    # https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
-    case "$ID" in
-      fedora|centos)
-        pkg_list+=(
-          "bash-completion"
-          "bzip2"
-          "gcc"
-          "gcc-c++"
-          "git"
-          "make"
-          "ncurses-devel"
-          "patch"
-          "rsync"
-          "tar"
-          "unzip"
-          "wget"
-          "which"
-          "diffutils"
-          "python2"
-          "python3"
-          "python3-setuptools"
-          "python3-pyelftools"
-          "perl-base"
-          "perl-Data-Dumper"
-          "perl-File-Compare"
-          "perl-File-Copy"
-          "perl-FindBin"
-          "perl-IPC-Cmd"
-          "perl-Thread-Queue"
-          "perl-Time-Piece"
-          "perl-JSON-PP"
-          "swig"
-          "clang" # for qosify
-          "llvm15-libs"
-          "patch")
-        ;;
-      debian|ubuntu)
-        pkg_list+=(
-          "build-essential"
-          "clang"
-          "flex"
-          "g++"
-          "gawk"
-          "gcc-multilib"
-          "gettext"
-          "git"
-          "libncurses5-dev"
-          "libssl-dev"
-          "python3-distutils"
-          "rsync"
-          "unzip"
-          "zlib1g-dev"
-          "file"
-          "wget"
-          "patch")
-        ;;
-      arch)
-        pkg_list+=(
-          "base-devel"
-          "autoconf"
-          "automake"
-          "bash"
-          "binutils"
-          "bison"
-          "bzip2"
-          "clang"
-          "fakeroot"
-          "file"
-          "findutils"
-          "flex"
-          "gawk"
-          "gcc"
-          "gettext"
-          "git"
-          "grep"
-          "groff"
-          "gzip"
-          "libelf"
-          "libtool"
-          "libxslt"
-          "m4"
-          "make"
-          "ncurses"
-          "openssl"
-          "patch"
-          "pkgconf"
-          "python"
-          "rsync"
-          "sed"
-          "texinfo"
-          "time"
-          "unzip"
-          "util-linux"
-          "wget"
-          "which"
-          "zlib"
-          "patch")
-        ;;
-      *)
-        debug "Skipping dependency install, your OS is unsupported"
-        return 1
-        ;;
-    esac
+    lock_file="$BUILDROOT/.dependencies_sc"
   else
-    # For Imagebuilder
-    case "$ID" in
-      fedora|centos)
-        pkg_list+=(
-          "@c-development" 
-          "@development-tools"
-          "@development-libs"
-          "perl-FindBin"
-          "zlib-static"
-          "elfutils-libelf-devel"
-          "gawk"
-          "unzip"
-          "file"
-          "wget"
-          "python3"
-          "python2"
-          "axel"
-          "perl-IPC-Cmd")
-        ;;
-      debian|ubuntu)
-        pkg_list+=(
-          "build-essential"
-          "libncurses5-dev"
-          "libncursesw5-dev"
-          "zlib1g-dev"
-          "gawk"
-          "git"
-          "gettext"
-          "libssl-dev"
-          "xsltproc"
-          "wget"
-          "unzip"
-          "python"
-          "axel")
-        ;;
-      *)
-        debug "Skipping dependency install, your OS is unsupported"
-        return 1
-        ;;
-    esac
+    lock_file="$BUILDROOT/.dependencies_ib"
+  fi
+
+  if [[ ! -f $lock_file ]]; then
+    if ((FROM_SOURCE)); then
+      # For building from source code
+      # https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
+      case "$ID" in
+        fedora|centos)
+          pkg_list+=(
+            "bash-completion"
+            "bzip2"
+            "gcc"
+            "gcc-c++"
+            "git"
+            "make"
+            "ncurses-devel"
+            "patch"
+            "rsync"
+            "tar"
+            "unzip"
+            "wget"
+            "which"
+            "diffutils"
+            "python2"
+            "python3"
+            "python3-setuptools"
+            "python3-pyelftools"
+            "perl-base"
+            "perl-Data-Dumper"
+            "perl-File-Compare"
+            "perl-File-Copy"
+            "perl-FindBin"
+            "perl-IPC-Cmd"
+            "perl-Thread-Queue"
+            "perl-Time-Piece"
+            "perl-JSON-PP"
+            "swig"
+            "clang" # for qosify
+            "llvm15-libs"
+            "patch")
+          ;;
+        debian|ubuntu)
+          pkg_list+=(
+            "build-essential"
+            "clang"
+            "flex"
+            "g++"
+            "gawk"
+            "gcc-multilib"
+            "gettext"
+            "git"
+            "libncurses5-dev"
+            "libssl-dev"
+            "python3-distutils"
+            "rsync"
+            "unzip"
+            "zlib1g-dev"
+            "file"
+            "wget"
+            "patch")
+          ;;
+        arch)
+          pkg_list+=(
+            "base-devel"
+            "autoconf"
+            "automake"
+            "bash"
+            "binutils"
+            "bison"
+            "bzip2"
+            "clang"
+            "fakeroot"
+            "file"
+            "findutils"
+            "flex"
+            "gawk"
+            "gcc"
+            "gettext"
+            "git"
+            "grep"
+            "groff"
+            "gzip"
+            "libelf"
+            "libtool"
+            "libxslt"
+            "m4"
+            "make"
+            "ncurses"
+            "openssl"
+            "patch"
+            "pkgconf"
+            "python"
+            "rsync"
+            "sed"
+            "texinfo"
+            "time"
+            "unzip"
+            "util-linux"
+            "wget"
+            "which"
+            "zlib"
+            "patch")
+          ;;
+        *)
+          debug "Skipping dependency install, your OS is unsupported"
+          return 1
+          ;;
+      esac
+    else
+      # For Imagebuilder
+      case "$ID" in
+        fedora|centos)
+          pkg_list+=(
+            "@c-development" 
+            "@development-tools"
+            "@development-libs"
+            "perl-FindBin"
+            "zlib-static"
+            "elfutils-libelf-devel"
+            "gawk"
+            "unzip"
+            "file"
+            "wget"
+            "python3"
+            "python2"
+            "axel"
+            "perl-IPC-Cmd")
+          ;;
+        debian|ubuntu)
+          pkg_list+=(
+            "build-essential"
+            "libncurses5-dev"
+            "libncursesw5-dev"
+            "zlib1g-dev"
+            "gawk"
+            "git"
+            "gettext"
+            "libssl-dev"
+            "xsltproc"
+            "wget"
+            "unzip"
+            "python"
+            "axel")
+          ;;
+        *)
+          debug "Skipping dependency install, your OS is unsupported"
+          return 1
+          ;;
+      esac
+    fi
   fi
 
-  # Skip dependency installation if lock file is present
-  [[ -f $lock_file ]] && return
-    
   pkg_install "${pkg_list[@]}" && echo "${pkg_list[@]}" > "$lock_file"
 }