CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Bug #336: Only accept http/https/ftp/file protocols in sources.
authorJuergen Daubert <jue@jue.li>
Sat, 1 Nov 2008 17:17:44 +0000 (18:17 +0100)
committerTilman Sauerbeck <tilman@crux.nu>
Sat, 1 Nov 2008 17:17:44 +0000 (18:17 +0100)
pkgmk.in

index 00d8e954720888c3e42806ea0841bdde1615e7bd..9fdf768e3a10de5101ba4fec7dcf43ecf4123c43 100755 (executable)
--- a/pkgmk.in
+++ b/pkgmk.in
@@ -34,13 +34,11 @@ error() {
 }
 
 get_filename() {
-       local FILE="`echo $1 | sed 's|^.*://.*/||g'`"
-
-       if [ "$FILE" != "$1" ]; then
-               FILE="$PKGMK_SOURCE_DIR/$FILE"
+       if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
+               echo "$PKGMK_SOURCE_DIR/${BASH_REMATCH[2]}"
+       else
+               echo $1
        fi
-
-       echo $FILE
 }
 
 get_basename() {