From dfc2e98ae678073977cd66a41592aee25454d757 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 25 Sep 2023 09:39:13 -0400 Subject: tests: Add package with duplicate clean name --- diff --git a/tests/aux/common.sh b/tests/aux/common.sh index 3ea3740..effc208 100644 --- a/tests/aux/common.sh +++ b/tests/aux/common.sh @@ -86,8 +86,8 @@ export OPK_SOURCE='foo' export OPK_SOURCE_VERSION='1.0-1' export OPK_SOURCE_VERSION_UPSTREAM='1.0' export OPK_BINARY_VERSION='1.0-1' -export OPK_PACKAGES='foo baz-qux bar' -export OPK_PACKAGES_REDUCED='foo baz-qux bar' +export OPK_PACKAGES='foo baz+qux baz-qux bar' +export OPK_PACKAGES_REDUCED='foo baz+qux baz-qux bar' # Section 7.3.2 Build and Host System Variables # OPK_BUILD_ARCH_GNU and OPK_HOST_ARCH_GNU aren't set or used by opkbuild # utilities. These should be removed from the SPF. diff --git a/tests/data/pkg/baz+qux.pkg/control b/tests/data/pkg/baz+qux.pkg/control new file mode 100644 index 0000000..1ecae47 --- /dev/null +++ b/tests/data/pkg/baz+qux.pkg/control @@ -0,0 +1,8 @@ +Architecture: all +Platform: all +Depends: ${Generated-Depends} +Description: Add all the things + ${Common-Description} + . + This package's name contains a plus sign, not to be confused with the one that + instead contains a hyphen. diff --git a/tests/data/pkg/build b/tests/data/pkg/build index dbc550a..abbfe8f 100755 --- a/tests/data/pkg/build +++ b/tests/data/pkg/build @@ -5,4 +5,5 @@ build: install: build install -p -m 755 -D src/src/foo.sh foo.data/usr/bin/foo.sh printf 'Generated-Depends: bar\n' >foo.substvars + printf 'Generated-Depends: bar\n' >baz+qux.substvars printf 'Generated-Depends: bar\n' >baz-qux.substvars diff --git a/tests/exe/ob-buildopk.sh b/tests/exe/ob-buildopk.sh index 1f59124..3bd0b50 100755 --- a/tests/exe/ob-buildopk.sh +++ b/tests/exe/ob-buildopk.sh @@ -43,7 +43,7 @@ plan_ 9 rm -Rf *'.data/' *'.control/' mkdir -p 'foo.data/usr/bin/' 'bar.data/' 'foo.control/' 'bar.control/' \ - 'baz-qux.data/' 'baz-qux.control/' + 'baz+qux.data/' 'baz+qux.control/' 'baz-qux.data/' 'baz-qux.control/' cp -p '../../src/src/foo.sh' 'foo.data/usr/bin/' touch 'foo.control/control' 'foo.control/md5sums' \ 'bar.control/control' 'bar.control/md5sums' diff --git a/tests/exe/ob-genchanges.sh b/tests/exe/ob-genchanges.sh index d0bc6a0..76f62cb 100755 --- a/tests/exe/ob-genchanges.sh +++ b/tests/exe/ob-genchanges.sh @@ -26,13 +26,14 @@ plan_ 2 >'../../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' >'../../bar_1.0-1_all_all.opk' +>'../../baz+qux_1.0-1_all_all.opk' >'../../baz-qux_1.0-1_all_all.opk' command_ok_ 'ob-genchanges exit status' -- ob-genchanges cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF Format: 1.0 Source: foo - Binary: bar baz-qux foo + Binary: bar baz+qux baz-qux foo Version: 1.0-1 Architecture: i686-linux-glibc Platform: x60 @@ -42,6 +43,7 @@ cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF Date: Thu, 01 Jan 1970 01:00:00 +0000 Description: bar - Bit-bang All Registers + baz+qux - Add all the things baz-qux - Hyphenate all the things foo - Frobnicator of Objects Changes: @@ -49,6 +51,7 @@ cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF * Initial release. Files: 0 lib foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk + 0 base baz+qux_1.0-1_all_all.opk 0 base baz-qux_1.0-1_all_all.opk 0 util bar_1.0-1_all_all.opk EOF diff --git a/tests/exe/ob-gencontrol.sh b/tests/exe/ob-gencontrol.sh index fd58dc9..ecae536 100755 --- a/tests/exe/ob-gencontrol.sh +++ b/tests/exe/ob-gencontrol.sh @@ -22,14 +22,14 @@ set -eu . "${TOP_SRCDIR}/tests/aux/tap-functions.sh" . "${TOP_SRCDIR}/tests/aux/common.sh" -plan_ 12 +plan_ 14 OB_DO_SOURCE='true' command_ok_ 'ob-gencontrol source package exit status' -- \ ob-gencontrol cmd_is 'source package control file' cat 'src:foo.control/control' <<-EOF Package: src:foo Source: foo - Binary: bar baz-qux foo + Binary: bar baz+qux baz-qux foo Version: 1.0-1 Architecture: src Platform: all @@ -83,6 +83,24 @@ for run in 'first' 'second'; do . This package assists in bit-banging all yer registers. EOF + cmd_is 'control file' cat 'baz+qux.control/control' <<-EOF + Package: baz+qux + Source: foo + Version: 1.0-1 + Architecture: all + Platform: all + Maintainer: "J. Random Hacker" + Depends: bar + Installed-Size: 0 + Description: Add all the things + This is a frobnicator of objects. Conveniently, it also $(: \ + )bit-bangs all + registers. + . + This package's name contains a plus sign, not to be $(: \ + )confused with the one that + instead contains a hyphen. + EOF cmd_is 'control file' cat 'baz-qux.control/control' <<-EOF Package: baz-qux Source: foo diff --git a/tests/local.mk b/tests/local.mk index d2770f4..b986d2d 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -42,6 +42,7 @@ EXTRA_DIST += \ tests/aux/common.sh \ tests/data/pkg/README \ tests/data/pkg/bar.pkg/control \ + tests/data/pkg/baz+qux.pkg/control \ tests/data/pkg/baz-qux.pkg/control \ tests/data/pkg/build \ tests/data/pkg/changelog \ -- cgit v0.9.1