]> pd.if.org Git - zpackage/blobdiff - zpm-install
let newpackage set additional fields
[zpackage] / zpm-install
index 8d92ff7e5e51baddde1603c6e3c3dd856ebab275..0a7cf3ed2a8335fe2d2ebede5c095ad264255fca 100755 (executable)
@@ -10,6 +10,12 @@ die() {
        exit 1
 }
 
+changeall() {
+       for pkgid in $(zpm list -s $1); do
+               zpm pkg $pkgid status=$2
+       done
+}
+
 dryrun=0
 verbose=0
 runscripts=1
@@ -167,6 +173,8 @@ for pkgid in $pkglist; do
        else
                zpm pkg $pkgid status=installing
        fi
+
+       zpm shell "$ZPMDB" "update packages set status='updating' where status='installed' and package in (select package from packages where status = 'installing')"
 done
 
 # do the sync
@@ -184,6 +192,8 @@ if [ "$pkgfile" != "$ZPMDB" ]; then
        syncopts="$syncopts -f $pkgfile"
 fi
 
+#zpm shell $ZPMDB 'select * from syncinfo'
+#zpm list -v
 zpm syncfs $syncopts
 
 syncrv=$?
@@ -213,7 +223,7 @@ fi
 
 for pkgid in $pkglist; do
        package=$(zpm parse -n $pkgid)
-       current=$(zpm list -s installed "$package")
+       current=$(zpm list -s updating "$package")
        
        if [ $runscripts -gt 0 ]; then
                zpm script -p post-install $pkgid $current
@@ -240,3 +250,5 @@ for pkgid in $pkglist; do
        fi
 
 done
+
+changeall updating updated