diff options
author | 2018-06-18 13:58:55 +0000 | |
---|---|---|
committer | 2018-06-18 13:58:55 +0000 | |
commit | a9dde6b460b555f36586995c38ed34f0d058f2d5 (patch) | |
tree | 61cd298fe8eaaf017b78bd8b5b7bb99acca9f708 | |
parent | Improve indentation and variable naming. (diff) | |
download | wireguard-openbsd-a9dde6b460b555f36586995c38ed34f0d058f2d5.tar.xz wireguard-openbsd-a9dde6b460b555f36586995c38ed34f0d058f2d5.zip |
reproducing some bugs is fun, I have to inject a specific dependencies order!
10 files changed, 127 insertions, 2 deletions
diff --git a/regress/usr.sbin/pkg_add/Makefile b/regress/usr.sbin/pkg_add/Makefile index 3ef603d6beb..a913e4a9952 100644 --- a/regress/usr.sbin/pkg_add/Makefile +++ b/regress/usr.sbin/pkg_add/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.54 2018/06/06 10:33:07 espie Exp $ +# $OpenBSD: Makefile,v 1.55 2018/06/18 13:58:55 espie Exp $ REGRESS_TARGETS=pkgnames pkgpaths signatures depends-check longnames pkgcfl \ collision-check1-disabled collision-check2-disabled collision-check3 \ @@ -51,7 +51,7 @@ LONG3=iamanotherreallylonglinkthatcantberepresentedcorrectlyinatararchivebutwewa LONG4=iamanotherreallylonghardlinkthatcantberepresentedcorrectlyinatararchivebutwewantittohappenanywaysohmygodaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42 .for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 \ - 26 27 28 29 30 31 32 33 34 35 + 26 27 28 29 30 31 32 33 34 35 36 S$i ?= ${.OBJDIR}/src$i SRC$i ?= ${S$i}/usr/local D$i ?= ${.OBJDIR}/dest$i @@ -644,6 +644,26 @@ rep1/ol-1.tgz: plist21 @touch ${SRC23}/lib/subdir/libol.so.1.0 @${CREATE_PKG} -B src23 -DLIBol_VERSION=1.0 -f plist21 $@ +.for o in cups-2.2.7p1 cups-filters-1.20.3 cups-libs-2.2.7 ghostscript-9.07p7 +CUPS_FILES += rep2/$o.tgz +rep2/$o.tgz: ${.CURDIR}/oldcups/$o/+CONTENTS + mkdir -p rep2 + cd rep2 && pkg_create -Dstub -f ${.CURDIR}/oldcups/$o/+CONTENTS +.endfor + +.for n in cups-2.2.8 cups-filters-1.20.3 cups-libs-2.2.8 ghostscript-9.07p7 +CUPS_FILES += rep3/$n.tgz +rep3/$n.tgz: ${.CURDIR}/newcups/$n/+CONTENTS + mkdir -p rep3 + cd rep3 && pkg_create -Dstub -f ${.CURDIR}/newcups/$n/+CONTENTS +.endfor + +cups-bug: ${CUPS_FILES} + rm -rf ${D36} + mkdir -p ${D36}/vardbpkg ${D36}/usr/local + PKG_DBDIR=${D36}/vardbpkg PKG_PATH=${.OBJDIR}/rep2 perl ${.CURDIR}/injectadd -Dstub -Dunsigned -Dnonroot -B ${D36} cups + PKG_DBDIR=${D36}/vardbpkg PKG_PATH=${.OBJDIR}/rep3 perl ${.CURDIR}/injectadd -Dstub -Dunsigned -Dnonroot -B ${D36} -u + usertest-1: @if ${CREATE_PKG} -u ${.CURDIR}/baduser1 \ -f ${.CURDIR}/empty truc-0.tgz; then \ diff --git a/regress/usr.sbin/pkg_add/injectadd b/regress/usr.sbin/pkg_add/injectadd new file mode 100755 index 00000000000..8b85f86ab89 --- /dev/null +++ b/regress/usr.sbin/pkg_add/injectadd @@ -0,0 +1,23 @@ +#! /usr/bin/perl + +# $OpenBSD: injectadd,v 1.1 2018/06/18 13:58:55 espie Exp $ + +# This script injects a specific order in the dependencies key to reproduce +# the cups bug +use OpenBSD::PkgAdd; +use OpenBSD::Dependencies; + +package OpenBSD::Dependencies::SolverBase; + +sub dependencies +{ + my $self = shift; + my @l = keys %{$self->{all_dependencies}}; + my $v = 'ghostscript-9.07p7'; + @l = ((grep {$_ ne $v} @l) , (grep {$_ eq $v} @l)); + return @l; +} + + +package main; +exit (OpenBSD::PkgAdd->parse_and_run('pkg_add')); diff --git a/regress/usr.sbin/pkg_add/newcups/cups-2.2.8/+CONTENTS b/regress/usr.sbin/pkg_add/newcups/cups-2.2.8/+CONTENTS new file mode 100644 index 00000000000..dbc5fefcd06 --- /dev/null +++ b/regress/usr.sbin/pkg_add/newcups/cups-2.2.8/+CONTENTS @@ -0,0 +1,10 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name cups-2.2.8 +@comment pkgpath=print/cups,-main cdrom=yes ftp=yes +@arch * ++DESC +@sha E1oYPv8g+CY3SpbccC5PZJrndE1B84BWoI+zyvqvWRE= +@size 649 +@depend print/cups,-libs:cups-libs-=2.2.8:cups-libs-2.2.8 +@depend print/cups-filters:cups-filters-*:cups-filters-1.20.3 +@wantlib cups.6.4 diff --git a/regress/usr.sbin/pkg_add/newcups/cups-filters-1.20.3/+CONTENTS b/regress/usr.sbin/pkg_add/newcups/cups-filters-1.20.3/+CONTENTS new file mode 100644 index 00000000000..347ce9101e5 --- /dev/null +++ b/regress/usr.sbin/pkg_add/newcups/cups-filters-1.20.3/+CONTENTS @@ -0,0 +1,10 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name cups-filters-1.20.3 +@comment pkgpath=print/cups-filters cdrom=yes ftp=yes +@arch * ++DESC +@sha KceUaybg6jfOy2zJMEkgvV82wLA3SDbdpTio00F574w= +@size 384 +@depend print/cups,-libs:cups-libs-*:cups-libs-2.2.8 +@depend print/ghostscript/gnu:ghostscript-*:ghostscript-9.07p7 +@wantlib cups.6.4 diff --git a/regress/usr.sbin/pkg_add/newcups/cups-libs-2.2.8/+CONTENTS b/regress/usr.sbin/pkg_add/newcups/cups-libs-2.2.8/+CONTENTS new file mode 100644 index 00000000000..7f879e189c2 --- /dev/null +++ b/regress/usr.sbin/pkg_add/newcups/cups-libs-2.2.8/+CONTENTS @@ -0,0 +1,12 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name cups-libs-2.2.8 +@comment pkgpath=print/cups,-libs cdrom=yes ftp=yes +@arch * ++DESC +@sha PR0u8PFMga/b6TrujLc3mwZyc4f2PuCKAFWEro5+E1w= +@size 299 +@cwd /usr/local +@lib lib/libcups.so.6.4 +@sha 8G6TFClL0MBr/Se4Pjvin4ljJv2/j9zFqMKNSK1jVWw= +@size 616344 +@ts 1528501337 diff --git a/regress/usr.sbin/pkg_add/newcups/ghostscript-9.07p7/+CONTENTS b/regress/usr.sbin/pkg_add/newcups/ghostscript-9.07p7/+CONTENTS new file mode 100644 index 00000000000..3c8d89d12fd --- /dev/null +++ b/regress/usr.sbin/pkg_add/newcups/ghostscript-9.07p7/+CONTENTS @@ -0,0 +1,9 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name ghostscript-9.07p7 +@comment pkgpath=print/ghostscript/gnu cdrom=yes ftp=yes +@arch * ++DESC +@sha QlcqzsJK9yj2Eq35ujZkkucSC7PKXuZXpbHKF3jTOwI= +@size 442 +@depend print/cups,-libs:cups-libs-*:cups-libs-2.2.8 +@wantlib cups.6.4 diff --git a/regress/usr.sbin/pkg_add/oldcups/cups-2.2.7p1/+CONTENTS b/regress/usr.sbin/pkg_add/oldcups/cups-2.2.7p1/+CONTENTS new file mode 100644 index 00000000000..9f535e61fd1 --- /dev/null +++ b/regress/usr.sbin/pkg_add/oldcups/cups-2.2.7p1/+CONTENTS @@ -0,0 +1,10 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name cups-2.2.7p1 +@comment pkgpath=print/cups,-main cdrom=yes ftp=yes +@arch * ++DESC +@sha E1oYPv8g+CY3SpbccC5PZJrndE1B84BWoI+zyvqvWRE= +@size 649 +@depend print/cups,-libs:cups-libs-=2.2.7:cups-libs-2.2.7 +@depend print/cups-filters:cups-filters-*:cups-filters-1.20.3 +@wantlib cups.6.4 diff --git a/regress/usr.sbin/pkg_add/oldcups/cups-filters-1.20.3/+CONTENTS b/regress/usr.sbin/pkg_add/oldcups/cups-filters-1.20.3/+CONTENTS new file mode 100644 index 00000000000..7a3fd9117c5 --- /dev/null +++ b/regress/usr.sbin/pkg_add/oldcups/cups-filters-1.20.3/+CONTENTS @@ -0,0 +1,10 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:55 espie Exp $ +@name cups-filters-1.20.3 +@comment pkgpath=print/cups-filters cdrom=yes ftp=yes +@arch * ++DESC +@sha KceUaybg6jfOy2zJMEkgvV82wLA3SDbdpTio00F574w= +@size 384 +@depend print/cups,-libs:cups-libs-*:cups-libs-2.2.7 +@depend print/ghostscript/gnu:ghostscript-*:ghostscript-9.07p7 +@wantlib cups.6.4 diff --git a/regress/usr.sbin/pkg_add/oldcups/cups-libs-2.2.7/+CONTENTS b/regress/usr.sbin/pkg_add/oldcups/cups-libs-2.2.7/+CONTENTS new file mode 100644 index 00000000000..4c4a2476e1b --- /dev/null +++ b/regress/usr.sbin/pkg_add/oldcups/cups-libs-2.2.7/+CONTENTS @@ -0,0 +1,12 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:56 espie Exp $ +@name cups-libs-2.2.7 +@comment pkgpath=print/cups,-libs cdrom=yes ftp=yes +@arch * ++DESC +@sha PR0u8PFMga/b6TrujLc3mwZyc4f2PuCKAFWEro5+E1w= +@size 299 +@cwd /usr/local +@lib lib/libcups.so.6.4 +@sha nndQnatFkW4GsPimjdyYNdraX4Lr3rSmztL/ZYosf1U= +@size 595864 +@ts 1527897065 diff --git a/regress/usr.sbin/pkg_add/oldcups/ghostscript-9.07p7/+CONTENTS b/regress/usr.sbin/pkg_add/oldcups/ghostscript-9.07p7/+CONTENTS new file mode 100644 index 00000000000..0e8dfbbb7d1 --- /dev/null +++ b/regress/usr.sbin/pkg_add/oldcups/ghostscript-9.07p7/+CONTENTS @@ -0,0 +1,9 @@ +@comment $OpenBSD: +CONTENTS,v 1.1 2018/06/18 13:58:56 espie Exp $ +@name ghostscript-9.07p7 +@comment pkgpath=print/ghostscript/gnu cdrom=yes ftp=yes +@arch * ++DESC +@sha QlcqzsJK9yj2Eq35ujZkkucSC7PKXuZXpbHKF3jTOwI= +@size 442 +@depend print/cups,-libs:cups-libs-*:cups-libs-2.2.7 +@wantlib cups.6.4 |