]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
keep compat arguments for "inst"
authorHarald Hoyer <harald@redhat.com>
Thu, 5 Mar 2009 16:13:34 +0000 (17:13 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 5 Mar 2009 16:13:34 +0000 (17:13 +0100)
dracut-functions

index 2a53e11ab9fbe654f5e41e83e53a37d8be148935..7e13ee58148d289171e0721ae2c87374881217ff 100755 (executable)
@@ -153,12 +153,17 @@ inst_rules() {
 # general purpose installation function
 # Same args as above.
 inst() {
-    if (($# != 1 && $# != 2)); then
+    if (($# != 1 && $# != 2 && $# != 3)); then
         echo "usage: inst <file> <root> [<destination file>]"
         return 1
     fi
+    local dst
+    [ $# = 3 ] && dst=$3
+    if [ $# = 2 ]; then 
+        [ -d "$2" ] || dst=$2
+    fi
     for x in inst_symlink inst_script inst_binary inst_simple; do
-       $x "$@" && return 0
+       $x $1 $dst && return 0
     done
     return 1
 }