pkgsrc-Bugs archive

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

Re: pkg/43689: USE_DESTDIR breaks undo-replace



The following reply was made to PR pkg/43689; it has been noted by GNATS.

From: "OBATA Akio" <obache%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/43689: USE_DESTDIR breaks undo-replace
Date: Wed, 04 May 2011 15:12:42 +0900

 How about following patch?
 
 Index: install/replace.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/install/replace.mk,v
 retrieving revision 1.11
 diff -u -r1.11 replace.mk
 --- install/replace.mk  9 Jun 2009 08:40:28 -0000       1.11
 +++ install/replace.mk  4 May 2011 06:03:07 -0000
 @@ -22,6 +22,9 @@
   # _flavor-undo-replace:
   #      Undoes a previous "make _flavor-replace".
 
 +# _flavor-destdir-undo-replace:
 +#      Undoes a previous "make _flavor-destdir-replace".
 +
   .if ${_USE_DESTDIR} == "no"
   _REPLACE_TARGETS+=     ${_PKGSRC_BUILD_TARGETS}
   .else
 @@ -62,5 +65,9 @@
          @${PHASE_MSG} "Undoing replacement for ${PKGNAME}"
          @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR."
 
 +.if ${_USE_DESTDIR} == "no"
   su-undo-replace: .PHONY _flavor-undo-replace
 +.else
 +su-undo-replace: .PHONY _flavor-destdir-undo-replace
 +.endif
   MAKEFLAGS.su-undo-replace=     _UPDATE_RUNNING=yes
 Index: flavor/pkg/replace.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/replace.mk,v
 retrieving revision 1.31
 diff -u -r1.31 replace.mk
 --- flavor/pkg/replace.mk       14 Sep 2010 22:30:42 -0000      1.31
 +++ flavor/pkg/replace.mk       4 May 2011 06:03:07 -0000
 @@ -29,6 +29,7 @@
 
   _flavor-destdir-replace: \
          replace-names \
 +       replace-tarup \
          replace-destdir \
          .PHONY
 
 @@ -48,6 +49,12 @@
          replace-clean \
          .PHONY
 
 +_flavor-destdir-undo-replace: \
 +       undo-replace-check \
 +       undo-destdir-replace-install \
 +       replace-clean \
 +       .PHONY
 +
   _INSTALLED_INFO_FILE=  ${WRKDIR}/.replace-+INSTALLED_INFO
   _REQUIRED_BY_FILE=     ${WRKDIR}/.replace-+REQUIRED_BY
 
 @@ -90,6 +97,12 @@
          ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
          ${PKG_ADD} ${WRKDIR}/$${oldname}${PKG_SUFX}
 
 +undo-destdir-replace-install: .PHONY
 +       @${PHASE_MSG} "Re-adding ${PKGNAME} from saved tar-up package."
 +       ${RUN} ${_REPLACE_OLDNAME_CMD};                                 \
 +       ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
 +       ${PKG_ADD} -U -D ${WRKDIR}/$${oldname}${PKG_SUFX}
 +
   # Computes and saves the full names of the installed package to be replaced
   # (oldname) and the package that will be installed (newname), so that these
   # names are available later.
 obata@miki[/usr/pkgsrc] cat d.diff
 Index: install/replace.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/install/replace.mk,v
 retrieving revision 1.11
 diff -u -r1.11 replace.mk
 --- install/replace.mk  9 Jun 2009 08:40:28 -0000       1.11
 +++ install/replace.mk  4 May 2011 06:03:07 -0000
 @@ -22,6 +22,9 @@
   # _flavor-undo-replace:
   #      Undoes a previous "make _flavor-replace".
 
 +# _flavor-destdir-undo-replace:
 +#      Undoes a previous "make _flavor-destdir-replace".
 +
   .if ${_USE_DESTDIR} == "no"
   _REPLACE_TARGETS+=     ${_PKGSRC_BUILD_TARGETS}
   .else
 @@ -62,5 +65,9 @@
          @${PHASE_MSG} "Undoing replacement for ${PKGNAME}"
          @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR."
 
 +.if ${_USE_DESTDIR} == "no"
   su-undo-replace: .PHONY _flavor-undo-replace
 +.else
 +su-undo-replace: .PHONY _flavor-destdir-undo-replace
 +.endif
   MAKEFLAGS.su-undo-replace=     _UPDATE_RUNNING=yes
 Index: flavor/pkg/replace.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/replace.mk,v
 retrieving revision 1.31
 diff -u -r1.31 replace.mk
 --- flavor/pkg/replace.mk       14 Sep 2010 22:30:42 -0000      1.31
 +++ flavor/pkg/replace.mk       4 May 2011 06:03:07 -0000
 @@ -29,6 +29,7 @@
 
   _flavor-destdir-replace: \
          replace-names \
 +       replace-tarup \
          replace-destdir \
          .PHONY
 
 @@ -48,6 +49,12 @@
          replace-clean \
          .PHONY
 
 +_flavor-destdir-undo-replace: \
 +       undo-replace-check \
 +       undo-destdir-replace-install \
 +       replace-clean \
 +       .PHONY
 +
   _INSTALLED_INFO_FILE=  ${WRKDIR}/.replace-+INSTALLED_INFO
   _REQUIRED_BY_FILE=     ${WRKDIR}/.replace-+REQUIRED_BY
 
 @@ -90,6 +97,12 @@
          ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
          ${PKG_ADD} ${WRKDIR}/$${oldname}${PKG_SUFX}
 
 +undo-destdir-replace-install: .PHONY
 +       @${PHASE_MSG} "Re-adding ${PKGNAME} from saved tar-up package."
 +       ${RUN} ${_REPLACE_OLDNAME_CMD};                                 \
 +       ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
 +       ${PKG_ADD} -U -D ${WRKDIR}/$${oldname}${PKG_SUFX}
 +
   # Computes and saves the full names of the installed package to be replaced
   # (oldname) and the package that will be installed (newname), so that these
   # names are available later.
 
 -- 
 OBATA Akio / obache%NetBSD.org@localhost
 


Home | Main Index | Thread Index | Old Index