Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 1 | SUMMARY = "Check that create_cmdline_shebang works" |
| 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
| 4 | INHIBIT_DEFAULT_DEPS = "1" |
| 5 | |
| 6 | SRC_URI += "file://test.awk" |
| 7 | |
| 8 | EXCLUDE_FROM_WORLD = "1" |
| 9 | do_install() { |
| 10 | install -d ${D}${bindir} |
| 11 | # was not able to make ownership preservation check |
| 12 | install -m 0400 ${WORKDIR}/test.awk ${D}${bindir}/test |
| 13 | |
| 14 | perm_old="$(stat --format='%a' ${D}${bindir}/test)" |
| 15 | sed -i -e 's|@AWK_BIN@|${bindir}/awk|g' ${D}${bindir}/test |
| 16 | create_cmdline_shebang_wrapper ${D}${bindir}/test |
| 17 | if [ $(${D}${bindir}/test) != "Don't Panic!" ]; then |
| 18 | bbfatal "Wrapper is broken" |
| 19 | else |
| 20 | bbnote "Wrapper is good" |
| 21 | fi |
| 22 | |
| 23 | perm_new="$(stat --format='%a' ${D}${bindir}/test.real)" |
| 24 | |
| 25 | if [ "$perm_new" != "$perm_old" ]; then |
| 26 | bbfatal "Wrapper permissions for ${D}${bindir}/test.real not preserved. Found $perm_new but expected $perm_old" |
| 27 | fi |
| 28 | } |
| 29 | |
| 30 | BBCLASSEXTEND = "native" |