]> pd.if.org Git - zpackage/commitdiff
create rootdir on install
authorNathan Wagner <nw@hydaspes.if.org>
Wed, 17 Oct 2018 10:02:11 +0000 (10:02 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 3 Nov 2018 12:39:52 +0000 (12:39 +0000)
zpm-install

index 815d610f62e7aa246f3f5c099182718a312e29d4..29d8c5d2fc270f0299bc5ecfcbbd46b280c405e1 100755 (executable)
@@ -88,7 +88,7 @@ package=$(zpm quote "$name")
 pkgver=$(zpm quote "$version")
 pkgrel=$(zpm quote "$release")
 
-if [ -z "$rootdir" ]; then
+if [ -n "$rootdir" ]; then
        : rootdir=${rootdir%%/}
 fi
 
@@ -97,6 +97,9 @@ if [ -z "$localdb" ]; then
 fi
 
 if [ ! -f "$localdb" ]; then
+       if [ -n "$rootdir" ] && [ ! -d $rootdir ]; then
+               mkdir $rootdir || die "can't create $rootdir: $!"
+       fi
        for d in /var /var/lib /var/lib/zpm; do
                test -d $rootdir/$d || mkdir $rootdir/$d || die "can't create $rootdir/$d/: $!"
        done