diff options
author | Ross Burton <ross.burton@arm.com> | 2023-01-13 16:57:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-15 08:46:07 +0000 |
commit | 9a287b456347a2be44bff6f9e547795018fb729d (patch) | |
tree | dbe51e4a982182dd5d2440eb2d91afe413945dd5 /meta/recipes-devtools | |
parent | 91f46d431dc8f40e8c6475c800bb61cb08b82b0a (diff) | |
download | openembedded-core-contrib-9a287b456347a2be44bff6f9e547795018fb729d.tar.gz |
quilt: rewrite ptest glue
The ptest glue was overly complex. Not as many files are needed to be
installed if we tell it to use the system's quilt tools, there's no
need for a custom Makefile just to set some environment variables, and
/usr/bin/ed doesn't appear to be used at all.
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/quilt/quilt.inc | 28 | ||||
-rw-r--r-- | meta/recipes-devtools/quilt/quilt/Makefile | 14 | ||||
-rwxr-xr-x | meta/recipes-devtools/quilt/quilt/run-ptest | 7 | ||||
-rwxr-xr-x | meta/recipes-devtools/quilt/quilt/test.sh | 25 |
4 files changed, 38 insertions, 36 deletions
diff --git a/meta/recipes-devtools/quilt/quilt.inc b/meta/recipes-devtools/quilt/quilt.inc index ec69705093..b4284dcafb 100644 --- a/meta/recipes-devtools/quilt/quilt.inc +++ b/meta/recipes-devtools/quilt/quilt.inc @@ -9,7 +9,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \ file://run-ptest \ - file://Makefile \ file://test.sh \ file://0001-tests-Allow-different-output-from-mv.patch \ file://fix-grep-3.8.patch \ @@ -61,17 +60,12 @@ do_install:append:class-native () { touch ${D}${sysconfdir}/quiltrc } -do_compile_ptest() { - oe_runmake bin/patch-wrapper test/.depend -} - do_install_ptest() { - tar -c --exclude=\*.in bin/ | ( cd ${D}${PTEST_PATH} && tar -xf - ) - tar -c --exclude=\*.in compat/ | ( cd ${D}${PTEST_PATH} && tar -xf - ) - tar -c --exclude=\*.in quilt/ | ( cd ${D}${PTEST_PATH} && tar -xf - ) - tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test) - cp ${WORKDIR}/Makefile ${D}${PTEST_PATH} - cp ${WORKDIR}/test.sh ${D}${PTEST_PATH} + install ${WORKDIR}/test.sh ${D}${PTEST_PATH} + mkdir ${D}${PTEST_PATH}/test + install ${S}/test/* ${D}${PTEST_PATH}/test + # mail needs a MTA, and the patch-wrapper is disabled + rm -f ${D}${PTEST_PATH}/test/mail.test ${D}${PTEST_PATH}/test/patch-wrapper.test } PACKAGES += "guards guards-doc" @@ -85,9 +79,9 @@ FILES:guards-doc = "${mandir}/man1/guards.1" RDEPENDS:${PN} = "bash patch diffstat bzip2 util-linux less" RDEPENDS:${PN}:class-native = "diffstat-native patch-native bzip2-native" -RDEPENDS:${PN}-ptest = "make file sed gawk diffutils findutils ed perl \ - perl-module-filehandle perl-module-getopt-std \ - perl-module-posix perl-module-file-temp \ - perl-module-text-parsewords perl-module-overloading \ - bash util-linux-getopt patch \ - " +RDEPENDS:${PN}-ptest += "file sed gawk diffutils findutils ed perl \ + perl-module-filehandle perl-module-getopt-std \ + perl-module-posix perl-module-file-temp \ + perl-module-text-parsewords perl-module-overloading \ + bash util-linux-getopt \ + " diff --git a/meta/recipes-devtools/quilt/quilt/Makefile b/meta/recipes-devtools/quilt/quilt/Makefile deleted file mode 100644 index 1f6cd2479c..0000000000 --- a/meta/recipes-devtools/quilt/quilt/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -PATH := $(CURDIR)/bin:$(CURDIR)/compat:$(PATH) -QUILT_DIR := $(CURDIR)/quilt -QUILTRC := $(CURDIR)/test/test.quiltrc -export QUILT_DIR QUILTRC -CHECK_ENV := P=patches/; _P=../patches/; export P _P; -CHECK_ENV += QUILT_PC=.pc; export QUILT_PC --include test/.depend - -check-% : test/%.test - @LANG=C; LC_ALL=C; \ - export LANG LC_ALL; \ - $(CHECK_ENV); \ - cd $(<D); \ - ./run -q $(<F) diff --git a/meta/recipes-devtools/quilt/quilt/run-ptest b/meta/recipes-devtools/quilt/quilt/run-ptest index d2de5c855a..322508cbe2 100755 --- a/meta/recipes-devtools/quilt/quilt/run-ptest +++ b/meta/recipes-devtools/quilt/quilt/run-ptest @@ -1,8 +1,7 @@ #!/bin/sh -THIS_SH=/bin/sh -ln -sf /bin/ed /usr/bin/ed /usr/sbin/adduser --disabled-password --gecos "" quilttest -su -c "${THIS_SH} ./test.sh" quilttest + +su -c ./test.sh quilttest + /usr/sbin/deluser quilttest -rm -f /usr/bin/ed diff --git a/meta/recipes-devtools/quilt/quilt/test.sh b/meta/recipes-devtools/quilt/quilt/test.sh index 6563e4a2fb..7dac8f4423 100755 --- a/meta/recipes-devtools/quilt/quilt/test.sh +++ b/meta/recipes-devtools/quilt/quilt/test.sh @@ -1 +1,24 @@ -for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done +#! /bin/sh + +set -e -u + +export LANG=C +export LC_ALL=C +export P=patches/ +export _P=../patches/ +export QUILTRC=$(pwd)/test/test.quiltrc +export QUILT_PC=.pc +export QUILT_DIR=/usr/share/quilt/ + +# Specify on the commandline, else runs all of the tests +TESTS=${@:-test/*.test} + +for FILENAME in $TESTS; do + TESTNAME=$(basename $FILENAME .test) + ./test/run $FILENAME + if [ $? -eq 0 ]; + then echo PASS: $TESTNAME + else + echo FAIL: $TESTNAME + fi +done |