X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-ipkgfile;h=15107d2bebaee5e1c928bc5e3cee69868a17cfba;hp=de9771115dc93029fd78cf978de2281a3fad7673;hb=09c80a1f8918d888063f4d1a75921a99fe5f0b5c;hpb=d4aaf504afd121d24e67bf56a14ba0039ef266ad diff --git a/zpm-ipkgfile b/zpm-ipkgfile index de97711..15107d2 100755 --- a/zpm-ipkgfile +++ b/zpm-ipkgfile @@ -48,16 +48,17 @@ ZPMPKGFILE=$pkgfile export ZPMPKGFILE set -e -for path in $*; do - - name=$(basename -- $path) - dir=$(dirname -- $path) +for path in "$@"; do + name=$(basename -- "$path") + dir=$(dirname -- "$path") dir=${dir#/} if [ "$pkgroot" != '/' ]; then dir=$pkgroot/$dir dir=${dir%/.} # if [ "$dir" = "//" ]; then dir=/ ; fi + else + dir="/$dir" fi # TODO generate some unique hash @@ -71,6 +72,9 @@ for path in $*; do : ${owner:=$(pkgfileinfo username $path)} : ${group:=$(pkgfileinfo groupname $path)} + # TODO if the file already exists, and is the correct + # hash or directory, do nothing + # can't use install because it's not posix. # probably worth writing a zpm-install, but with # a different name since that wants to be a package install