]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
gen_cpio fixes
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 20 Jan 2014 13:35:24 +0000 (14:35 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 20 Jan 2014 13:35:24 +0000 (14:35 +0100)
contrib/gen_cpio

index ea7b5270f771fb1151bc22860377f51f2dcb4c71..40424f1497a357bf3f6b77b522afccad57a6577f 100755 (executable)
@@ -177,7 +177,7 @@ gen_filelist() {
        echo "dir $dir 0755 0 0"
        dir=$(dirname $dir)
     done
-    echo "$(filetype $src) $dst $src $(find $src -printf '%m') 0 0"
+    echo "file $dst $src $(find $src -printf '%m') 0 0"
 }
 
 while [ $# -gt 0 ]; do
@@ -195,13 +195,13 @@ while [ $# -gt 0 ]; do
        *"->"*)
            src=${arg%%->*}
            dst=${arg#*->}
-           cpio_list="$cpio_list$(gen_filelist $src $dst)"
+           cpio_list=$(echo "$cpio_list"; gen_filelist $src $dst)
            ;;
        *)
            if [ -d "$arg" ]; then
                cpio_list="$cpio_list$(gen_dirlist $arg)"
            elif [ -f "$arg" ]; then
-               case "$(file $arg)" in
+               case "$(file -L $arg)" in
                    *"cpio archive"*)
                        gen_cpio_from_list
                        cat $arg