From bbdcd5bb1f29a0dccd5de5da1a602ffc648917ca Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 4 Feb 2017 22:18:19 +0100 Subject: [PATCH] Add package download support --- archdi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) mode change 100644 => 100755 archdi diff --git a/archdi b/archdi old mode 100644 new mode 100755 index 41e0d99..382579f --- a/archdi +++ b/archdi @@ -25,6 +25,9 @@ binurl2=matmoul.github.io/archdi liburl1=http://archdi.sourceforge.net/archdi-lib liburl2=https://raw.githubusercontent.com/MatMoul/archdi-pkg/master/lib +pkgurl1=http://archdi.sourceforge.net/archdi-pkg +pkgurl2=https://raw.githubusercontent.com/MatMoul/archdi-pkg/master/pkg.tar + help(){ echo "-h | --help : this screen" @@ -49,7 +52,16 @@ run(){ rm -R $cachedir 2>/dev/null mkdir -p $cachedir 2>/dev/null cd $cachedir 2>/dev/null - wget -O lib $liburl 2>/dev/null + + if [ "$pkgurl" == "" ]; then + wget -O lib $liburl 2>/dev/null + else + echo "" + echo "Downloading packages..." + wget -O pkg.tar $pkgurl 2>/dev/null + tar -xf pkg.tar + fi + chmod 755 lib 2>/dev/null if [ "$chrootoption" = "true" ]; then ./lib --chroot @@ -84,12 +96,14 @@ dependencies(){ if [ "$?" = "0" ] && [ "${#lastver}" = "19" ]; then binurl=$binurl1 liburl=$liburl1 + pkgurl=$pkgurl1 else lastverurl=$lastverurl2 lastver=$(curl $lastverurl) if [ "$?" = "0" ] && [ "${#lastver}" = "19" ]; then binurl=$binurl2 liburl=$liburl2 + pkgurl=$pkgurl2 else exit 1 fi @@ -148,6 +162,8 @@ while (( "$#" )); do shift liburl1=https://raw.githubusercontent.com/MatMoul/archdi-pkg/$1/lib liburl2=https://raw.githubusercontent.com/MatMoul/archdi-pkg/$1/lib + pkgurl1="" + pkgurl2="" branchoption="$1" githubuser="MatMoul" ;; @@ -155,6 +171,8 @@ while (( "$#" )); do shift liburl1=https://raw.githubusercontent.com/$1/archdi-pkg/$2/lib liburl2=https://raw.githubusercontent.com/$1/archdi-pkg/$2/lib + pkgurl1="" + pkgurl2="" branchoption="$2" githubuser="$1" ;;