pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/43689: USE_DESTDIR breaks undo-replace

>Number:         43689
>Category:       pkg
>Synopsis:       USE_DESTDIR breaks undo-replace
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 01 00:40:01 +0000 2010
>Originator:     David A. Holland
>Release:        NetBSD 5.99.29 (pkgsrc 20100731)
System: NetBSD valkyrie 5.99.29 NetBSD 5.99.29 (VALKYRIE) #1: Sat May 29 
23:00:44 EDT 2010  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE 
Architecture: x86_64
Machine: amd64

If USE_DESTDIR is enabled (e.g. via PKG_DEVELOPER) it is no longer
possible to back out from "make replace": the old installed material
is not preserved and undo-replace fails.


In some harmless already-installed package like xbiff, build it, then
do make replace, then make undo-replace:

# make replace
=> Bootstrap dependency digest>=20010302: found digest-20080510
WARNING: [] Every package should define a LICENSE.
===> Checking for vulnerabilities in xbiff-1.0.1nb1
===> Installing for xbiff-1.0.1nb1
=> Generating pre-install file lists
/bin/sh ./mkinstalldirs /usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/bin
mkdir -p -- /usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/bin
  /usr/bin/install -c -s -o root -g wheel -m 755 xbiff 
/bin/sh ./mkinstalldirs /usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/man/man1
mkdir -p -- /usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/man/man1
 /usr/bin/install -c -o root -g wheel -m 644 xbiff.1 
=> Automatic manual page handling
=> Generating post-install file lists
=> Checking file-check results for xbiff-1.0.1nb1
=> Checking for non-existent script interpreters in xbiff-1.0.1nb1
=> Checking file permissions in xbiff-1.0.1nb1
=> Checking for missing run-time search paths in xbiff-1.0.1nb1
=> Checking for work-directory references in xbiff-1.0.1nb1
===> Building binary package for xbiff-1.0.1nb1
=> Creating binary package /usr/pkgsrc/packages/All/xbiff-1.0.1nb1.tgz
===> Replacing for xbiff-1.0.1nb1
WARNING: experimental target - DATA LOSS MAY OCCUR.
===> Updating using binary package of xbiff-1.0.1nb1
/usr/pkg/sbin/pkg_add -K /var/db/pkg -U 
/usr/pkgsrc/packages/All/xbiff-1.0.1nb1.tgz || /usr/pkg/sbin/pkg_add -K 
/var/db/pkg -U -f /usr/pkgsrc/packages/All/xbiff-1.0.1nb1.tgz

# make undo-replace
===> Undoing replacement for xbiff-1.0.1nb1
WARNING: experimental target - DATA LOSS MAY OCCUR.
=> Preserving existing +INSTALLED_INFO file.
=> Preserving existing +REQUIRED_BY file.
===> Deinstalling for xbiff-1.0.1nb1
Running /usr/pkg/sbin/pkg_delete -K /var/db/pkg  xbiff-1.0.1nb1
===> Re-adding xbiff-1.0.1nb1 from saved tar-up package.
Installing saved package /usr/pkgsrc/mail/xbiff/work/xbiff-1.0.1nb1.tgz
pkg_add: no pkg found for '/usr/pkgsrc/mail/xbiff/work/xbiff-1.0.1nb1.tgz', 
pkg_add: 1 package addition failed
*** Error code 1

make: stopped in /usr/pkgsrc/mail/xbiff
*** Error code 1

make: stopped in /usr/pkgsrc/mail/xbiff

Note that no package is saved; there is no way that undo-replace could
possibly succeed. Nor is the old metadata saved...


Probably something like this:
(Not tested though, and the metadata handling probably won't work)

Index: mk/flavor/pkg/
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/,v
retrieving revision 1.30
diff -u -r1.30
--- mk/flavor/pkg/    16 Jun 2010 15:15:05 -0000      1.30
+++ mk/flavor/pkg/    1 Aug 2010 00:37:12 -0000
@@ -29,7 +29,12 @@
 _flavor-destdir-replace: \
        replace-names \
+       replace-tarup \
+       replace-preserve-installed-info \
+       replace-preserve-required-by \
        replace-destdir \
+       replace-fixup-required-by \
+       replace-fixup-installed-info \
 # _flavor-undo-replace:

Home | Main Index | Thread Index | Old Index