]> pd.if.org Git - zpackage/commitdiff
don't run ldconfig if etc doesn't exist
authorNathan Wagner <nw@hydaspes.if.org>
Wed, 17 Oct 2018 07:19:34 +0000 (07:19 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 3 Nov 2018 12:39:52 +0000 (12:39 +0000)
zpm-install

index d0f2f32cf48bf64d8451753503641051e0f75ca2..815d610f62e7aa246f3f5c099182718a312e29d4 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+warn() {
+       echo $* 1>&2
+}
+
 die() {
        echo $* 1>&2
        exit 1
@@ -213,7 +217,9 @@ for pkgstr in "$@"; do
        fi
 
        if [ $(id -u) -eq 0 ]; then
-               if [ -f $rootdir/sbin/ldconfig ]; then
+               if [ ! -d $rootdir/etc ]; then
+                       warn "no etc directory in $rootdir, skipping ldconfig"
+               elif [ -f $rootdir/sbin/ldconfig ]; then
                        $rootdir/sbin/ldconfig -r ${rootdir:-/}
                elif [ -f /sbin/ldconfig ]; then
                        /sbin/ldconfig -r ${rootdir:-/}