tech-pkg archive

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

add PKG_INSTALL_TRY_UPGRADE -- please review



I am getting pretty sick of the following workflow:

cd /usr/src/pkgsrc; cvs update
cd devel/tig
make install clean

... (an hour later)

pkg_add: A different version of foo-dependency-1.0.1 is already
installed: foo-dependency-1.0.0
pkg_add: 1 package addition failed
*** Error code 1

...
(grumble) pkg_add -u /usr/src/packages/All/foo-depdendency-1.0.1
make install

repeat...

----

So anyway, I added a way to have pkgsrc attempt to add a '-u' during
su-real-package-install
Here's is the diff (very early, I definitely need help and feedback)



Index: package.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/pkgformat/pkg/package.mk,v
retrieving revision 1.1
diff -u -r1.1 package.mk
--- package.mk  15 Oct 2011 00:23:09 -0000      1.1
+++ package.mk  7 May 2013 17:34:37 -0000
@@ -16,6 +16,11 @@
 PKGREPOSITORY?=                ${PACKAGES}/${PKGREPOSITORYSUBDIR}
 PKGREPOSITORYSUBDIR?=  All

+PKGADD_OPTS= ""
+.if !empty(PKG_INSTALL_TRY_UPGRADE:M[yY][eE][sS])
+PKG_ADD+= "-u"
+.endif
+
 ######################################################################
 ### package-check-installed (PRIVATE, pkgsrc/mk/package/package.mk)
 ######################################################################


Home | Main Index | Thread Index | Old Index