summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-22 12:44:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-22 12:44:07 +0000
commit11a1c7efa2b12cdf007828372b743c866209f699 (patch)
treeef395e4c933be3c4fcd6e488be18a586e63169f8
parent5011997e5a43856056cd6068fb04022d87292a87 (diff)
new test, modeled after some old kde update.
When a file moves between packages, one new package will conflict with two old packages, in which case pkg_add should update both (and it does not, not yet). We distinguish from the case where a new package is an update for two packages by the absence of a @pkgpath annotation.
-rw-r--r--regress/usr.sbin/pkg_add/Makefile26
-rw-r--r--regress/usr.sbin/pkg_add/list3.out2
2 files changed, 20 insertions, 8 deletions
diff --git a/regress/usr.sbin/pkg_add/Makefile b/regress/usr.sbin/pkg_add/Makefile
index 6cea091bad0..d41050bb0a5 100644
--- a/regress/usr.sbin/pkg_add/Makefile
+++ b/regress/usr.sbin/pkg_add/Makefile
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.14 2009/11/22 11:32:17 espie Exp $
+# $OpenBSD: Makefile,v 1.15 2009/11/22 12:44:06 espie Exp $
REGRESS_TARGETS=pkgnames depends-check longnames always-update \
- collision-check3 partial-update-test
+ collision-check3 partial-update-test conflict-update
PKG_ADD=perl ${.CURDIR}/myadd
PKG_CREATE=perl ${.CURDIR}/mycreate
@@ -10,7 +10,7 @@ LONG2=iamanotherreallygfilenamethatcantberepresentedcorrectlyinatararchivebutwew
LONG3=iamanotherreallylonglinkthatcantberepresentedcorrectlyinatararchivebutwewantittohappenanywaysohmygodaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42
LONG4=iamanotherreallylonghardlinkthatcantberepresentedcorrectlyinatararchivebutwewantittohappenanywaysohmygodaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42
-.for i in 1 2 3 4 5 6 7 8 9 10
+.for i in 1 2 3 4 5 6 7 8 9 10 11
S$i ?= ${.OBJDIR}/src$i
SRC$i ?= ${S$i}/usr/local
D$i ?= ${.OBJDIR}/dest$i
@@ -70,7 +70,6 @@ always-update: old/g-0.0.tgz new/g-0.0.tgz
ROOT=${D8} PKG_PATH=${.OBJDIR}/new ${PKG_ADD} -u
PKG_DBDIR=${D8}/pkgdb pkg_info -qf g|fgrep -q comment2
-
list-check: new/a-1.0.tgz new/b-1.0.tgz new/c-0.0.tgz new/d-0.0.tgz \
new/e-0.0.tgz new/f-0.0.tgz new/g-0.0.tgz
-rm -rf ${D9}
@@ -84,6 +83,11 @@ partial-update-test: old/h-0.0.tgz old/i-0.0.tgz old/j-0.0.tgz \
ROOT=${D10} PKG_PATH=${.OBJDIR}/new ${PKG_ADD} -u h
PKG_DBDIR=${D10}/pkgdb pkg_info -q|diff - ${.CURDIR}/list2.out
+conflict-update: old/k-0.0.tgz old/l-0.0.tgz new/k-1.0.tgz new/l-1.0.tgz
+ -rm -rf ${D11}
+ ROOT=${D11} PKG_PATH=${.OBJDIR}/old ${PKG_ADD} k l
+ ROOT=${D11} PKG_PATH=${.OBJDIR}/new ${PKG_ADD} -u k
+ PKG_DBDIR=${D11}/pkgdb pkg_info -q|diff - ${.CURDIR}/list3.out
plist1:
@echo "@owner "`whoami` >$@
@@ -116,10 +120,13 @@ plist5:
@echo "@option always-update" >$@
@echo "@comment comment2" >>$@
+plist6:
+ @echo "@conflict l-<1.0" >$@
+
old/a-0.0.tgz:
${PKG_CREATE} -P'test/b:b-*:b-0.0' -f ${.CURDIR}/empty $@
-new/a-1.0.tgz old/b-0.0.tgz old/i-0.0.tgz old/j-0.0.tgz new/j-1.0.tgz new/i-1.0.tgz:
+new/a-1.0.tgz old/b-0.0.tgz old/i-0.0.tgz old/j-0.0.tgz new/j-1.0.tgz new/i-1.0.tgz old/k-0.0.tgz old/l-0.0.tgz new/l-1.0.tgz:
${PKG_CREATE} -f ${.CURDIR}/empty $@
new/b-1.0.tgz:
@@ -133,6 +140,9 @@ new/c-0.0.tgz: plist1
@cd ${SRC1} && ln -f ${LONG1} ${LONG4}
${PKG_CREATE} -B src1 -f plist1 $@
+new/k-1.0.tgz: plist6
+ ${PKG_CREATE} -f plist6 $@
+
new/d-0.0.tgz: plist2
mkdir -p ${SRC2}
touch ${SRC2}/a ${SRC2}/b ${SRC2}/c
@@ -163,9 +173,9 @@ new/h-1.0.tgz:
${PKG_CREATE} -P'test/j:j->=1:j-1.0' -f ${.CURDIR}/empty $@
-.PHONY: pkgnames depends-check longnames \
- collision-check1 collision-check2 collision-check3 \
- collision-check4 collision-check5 partial-update-test
+# some extra tests do not yet pass correctly
+.PHONY: ${REGRESS_TARGETS} \
+ collision-check1 collision-check2 collision-check4 collision-check5
clean:
-rm -rf old new dest* plist* src*
diff --git a/regress/usr.sbin/pkg_add/list3.out b/regress/usr.sbin/pkg_add/list3.out
new file mode 100644
index 00000000000..5419c75ff83
--- /dev/null
+++ b/regress/usr.sbin/pkg_add/list3.out
@@ -0,0 +1,2 @@
+k-1.0
+l-1.0