Add package download support
This commit is contained in:
parent
faa78f3700
commit
bbdcd5bb1f
1 changed files with 19 additions and 1 deletions
20
archdi
Normal file → Executable file
20
archdi
Normal file → Executable file
|
@ -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"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue