aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/simplaret
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-08-30 04:42:52 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-08-30 04:42:52 +0000
commit012a640d48623040951d549775d32303a38ccae8 (patch)
tree956c3562e531b5e5102a60ea361d33fe323e8b48 /trunk/src/simplaret
parentd2fe80683e79b3310fdc287502307c114686841f (diff)
downloadsimplepkg-012a640d48623040951d549775d32303a38ccae8.tar.gz
simplepkg-012a640d48623040951d549775d32303a38ccae8.tar.bz2
simplaret: small fixes, thanks diogo :)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@433 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/simplaret')
-rwxr-xr-xtrunk/src/simplaret31
1 files changed, 25 insertions, 6 deletions
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 29e3b75..b08ba59 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -1060,6 +1060,15 @@ function simplaret_check_url {
return 1
fi
+ if echo $1 | grep -q -e "^file:///"; then
+ url="`echo $1 | sed -e 's/file:\/\///'`"
+ if [ -e "$url" ]; then
+ return 0
+ else
+ return 1
+ fi
+ fi
+
if [ ! -z "$CONNECT_TIMEOUT" ] || [ "$CONNECT_TIMEOUT" != "0" ]; then
curl_timeout="--connect-timeout $CONNECT_TIMEOUT"
fi
@@ -1101,6 +1110,16 @@ function simplaret_solve_dep {
}
+function simplaret_req_arg {
+
+ # requires arg
+
+ if [ -z "$1" ]; then
+ simplaret_usage;
+ fi
+
+}
+
if [ -z "$1" ]; then
simplaret_usage
exit 1
@@ -1119,13 +1138,13 @@ BASENAME="`basename $0`[$SIMPLARET_CHILD]"
case $1 in
"--update" | "update") simplaret_update ;;
- "--search" | "search") shift ; simplaret_search $* ;;
- "--get" | "get") shift ; simplaret_get $* ;;
- "--get-patches" | "get-patches") simplaret_get_patches ;;
- "--purge" | "purge") shift ; simplaret_purge $* ;;
- "--install" | "install") shift ; simplaret_install $* ;;
"--upgrade" | "upgrade") simplaret_get_patches --upgrade ;;
- "--remove" | "remove") ROOT=/$ROOT removepkg $2 ;;
+ "--get-patches" | "get-patches") simplaret_get_patches ;;
+ "--search" | "search") shift ; simplaret_req_arg $1 ; simplaret_search $* ;;
+ "--get" | "get") shift ; simplaret_req_arg $1 ; simplaret_get $* ;;
+ "--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 ;;
esac