From fa1af3b085ccbf9aacf423e12f69e04a41dcd1a7 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 19 Aug 2020 14:45:31 -0700 Subject: cpio: fixes for Android kernel build. Allow -pd to work by changing -p from an option that takes an argument to an option that implies there will be an argument (that is, `-pd x` is `-p -d x` with x being the directory for -p, rather than `-p d x` with d being the directory, as we previously interpreted it). Fix -d (aka --make-directories) to not be a no-op. Previously we acted as if this was always on. Accept --quiet and effectively just ignore it, since toybox cpio doesn't seem to produce any output that --quiet would suppress. --- tests/cpio.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/cpio.test') diff --git a/tests/cpio.test b/tests/cpio.test index 7231ba0f..11b3a5bf 100755 --- a/tests/cpio.test +++ b/tests/cpio.test @@ -29,6 +29,12 @@ testing "archive length" "cpio -o -H newc|dd ibs=2 skip=291 count=5 2>/dev/null" testing "archive magic" "cpio -o -H newc|dd ibs=2 count=3 2>/dev/null" "070701" "" "a\n" # check name length (8 bytes before the empty "crc") testing "name length" "cpio -o -H newc|dd ibs=2 skip=47 count=4 2>/dev/null" "00000002" "" "a\n" +testing "-t" "cpio -o -H newc|cpio -it" "a\nbb\n" "" "a\nbb" +testing "-t --quiet" "cpio -o -H newc|cpio -it --quiet" "a\nbb\n" "" "a\nbb" +mkdir out +testing "-p" "cpio -p out && find out | sort" "out\nout/a\nout/bb\n" "" "a\nbb" +rm -rf out +testing "-pd" "cpio -pd out && find out | sort" "out\nout/a\nout/bb\n" "" "a\nbb" rm a bb ccc dddd # archive dangling symlinks and empty files even if we cannot open them -- cgit v1.2.3