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)
>Organization:
>Environment:
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 
amd64
Architecture: x86_64
Machine: amd64
>Description:

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.

>How-To-Repeat:

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: [license.mk] 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 
/usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/bin/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 
/usr/pkgsrc/mail/xbiff/work/.destdir/usr/pkg/man/man1/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', 
sorry.
pkg_add: 1 package addition failed
*** Error code 1

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

Stop.
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...

>Fix:

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

Index: mk/flavor/pkg/replace.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/replace.mk,v
retrieving revision 1.30
diff -u -r1.30 replace.mk
--- mk/flavor/pkg/replace.mk    16 Jun 2010 15:15:05 -0000      1.30
+++ mk/flavor/pkg/replace.mk    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 \
        .PHONY
 
 # _flavor-undo-replace:




Home | Main Index | Thread Index | Old Index