]> pd.if.org Git - zpackage/blobdiff - zpm-add
fix number of tests in update test
[zpackage] / zpm-add
diff --git a/zpm-add b/zpm-add
index 28c12f96fef2cd82f6af30b67e79a227f689b788..f627c6dc6990578a0a9a290d87b45761dddfbc78 100755 (executable)
--- a/zpm-add
+++ b/zpm-add
@@ -125,12 +125,15 @@ pkgrel=$(zpm quote "$release")
 #strip=$(cleanpath "$strip")
 for path in $*; do
        #echo adding $path
+if [ $verbose -gt 1 ]; then
+       printf "adding %s\n" $path
+fi
 
        # only stat the file for items not set on the command line
-       mode=${clmode:-$(zpm stat -f '%a' $path)}
-       username=${cluser:-$(zpm stat -f '%U' $path)}
-       groupname=${clgroup:-$(zpm stat -f '%G' $path)}
-       mtime=${clmtime:-$(zpm stat -f '%y' $path)}
+       mode=${clmode:-$(zpm stat -l -f '%a' $path)}
+       username=${cluser:-$(zpm stat -l -f '%U' $path)}
+       groupname=${clgroup:-$(zpm stat -l -f '%G' $path)}
+       mtime=${clmtime:-$(zpm stat -l -f '%y' $path)}
        filetype=${cltype:-$(zpm stat -l -f '%t' "$path")}
 
        rpath="$path"
@@ -199,8 +202,12 @@ for path in $*; do
 
        # TODO check that we have such a package,version,release
        #cat <<EOS
+       if [ $verbose -gt 2 ]; then
+               shellecho=".echo on"
+       fi
        zpm shell $pkgfile <<EOS
 begin;
+$shellecho
 insert or replace into packagefiles (package,version,release,path,mode,mtime,username,groupname,filetype,hash,configuration,target)
 values ('$package', '$pkgver', $pkgrel, '$rpath', '$mode',$mtime, '$username','$groupname','$filetype',$hash,$isconfig,$target);
 commit;