diff options
Diffstat (limited to 'trunk/src')
-rwxr-xr-x | trunk/src/simplaret | 54 |
1 files changed, 13 insertions, 41 deletions
diff --git a/trunk/src/simplaret b/trunk/src/simplaret index b08ba59..7f96fba 100755 --- a/trunk/src/simplaret +++ b/trunk/src/simplaret @@ -1,6 +1,6 @@ #!/bin/bash # -# simplaret v0.2: simplepkg's retrieval tool +# simplaret v0.3: simplepkg's retrieval tool # feedback: rhatto at riseup.net | gpl # # Simplaret is free software; you can redistribute it and/or modify it under the @@ -29,8 +29,8 @@ fi function simplaret_usage { - echo "usage: [ARCH=otherarch] [VERSION=otherversion] $BASENAME <OPTION> package-name" - echo -e "\t OPTIONS: --install, --update, --upgrade, --search, --get, --get-patches, --purge, --remove" + echo "usage: [ARCH=otherarch] [VERSION=otherversion] $BASENAME [OPTION] package-name" + echo -e "\t OPTIONS: --help, --install, --update, --upgrade, --search, --get, --get-patches, --purge, --remove" exit 1 } @@ -215,8 +215,8 @@ function simplaret_repository_url { fi if [ "$repos_type" == "root" ]; then - simplaret_distro_folder - repository_url="$repository_url/$DISTRO_FOLDER/$EXTRA_FOLDER" + simplaret_set_arch + repository_url="$repository_url/`basename $repository_url`/" fi } @@ -974,41 +974,6 @@ function simplaret_install { } -function simplaret_distro_folder { - - # first we point to the correct arch - simplaret_set_arch - - # then we set the distro folder - if [ "$ARCH" == "i386" ]; then - DISTRO="slackware" - DISTRO_FOLDER="$DISTRO-$VERSION" - elif [ "$ARCH" == "x86_64" ]; then - # EXTRA_FOLDER="tree" - DISTRO="slamd64" - DISTRO_FOLDER="$DISTRO-$VERSION" - elif [ "$ARCH" == "s390" ]; then - DISTRO="slack390" - DISTRO_FOLDER="$DISTRO-$VERSION" - elif [ "$ARCH" == "x86_uclibc" ]; then - DISTRO="ucslack" - DISTRO_FOLDER="$DISTRO-$VERSION" - elif [ "$ARCH" == "arm" ]; then - DISTRO="armedslack" - DISTRO_FOLDER="$DISTRO-$VERSION" - elif [ "$ARCH" == "powerpc" ]; then - DISTRO="slackintosh" - DISTRO_FOLDER="$VERSION" - elif [ "$ARCH" == "sparc" ]; then - DISTRO="splack" - DISTRO_FOLDER="tree-$VERSION" - else - DISTRO="$ARCH" - DISTRO_FOLDER="$DISTRO-$VERSION" - fi - -} - function simplaret_set_arch { # set correct value for ARCH @@ -1145,6 +1110,13 @@ case $1 in "--purge" | "purge") shift ; simplaret_req_arg $1 simplaret_purge $* ;; "--install" | "install") shift ; simplaret_req_arg $1 ; simplaret_install $* ;; "--remove" | "remove") simplaret_req_arg $2 ; ROOT=/$ROOT removepkg $2 ;; - *) simplaret_usage ;; + "--help" | "help") simplaret_usage ;; + *) + if echo $1 | grep -v '^--'; then + simplaret_install $* + else + simplaret_usage + fi + ;; esac |