pkgsrc-Bugs archive

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

pkg/42267: pkg_comp: quick exit if pkg is installed already (patch)

>Number:         42267
>Category:       pkg
>Synopsis:       pkg_comp: quick exit if pkg is installed already (patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 04 17:00:00 +0000 2009
>Originator:     Martin S. Weber
>Release:        NetBSD 5.0_STABLE
System: NetBSD agamemnon.entropie.local 5.0_STABLE NetBSD 5.0_STABLE 
(AGAMEMNON5) #0: Sat Jun 27 14:44:07 EDT 2009 
Architecture: i386
Machine: i386
(copied from the following email:
, PR'd by req of JMMV.)

``I've noticed a little annoyance for pkg_comp: if you give it a
list of packages that are installed already, it will a) try to
build these packages nonetheless, and b) note that this package
is "in error", because the install target failed. In fact everything
is fine though. This can be provoked two ways:
1) pkg_comp build (a package that is installed in chroot already)
2) pkg_comp build (list of package names including dependencies)

The first case is obvious, the second builds the dependencies as
required, but if your dependencies come later in the invocation
(say, you are taking the list of packages to build from a pkgchk.conf,
which is alphabetically sorted, not topologically) ... stuff "fails".''

Yeah, except this will not catch cases where the installed package is
older than the newest one.(...)''

Intentionally. I expect an error in that case: if I build binary packages
with pkg_comp I expect a binary package whose version matches that in
the underlying pkgsrc. I do want an error in that case.(...) ''

        pkg_chk -g
        pkg_comp build $(grep -v '^#' /usr/pkgsrc/pkgchk.conf)

Index: files/
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_comp/files/,v
retrieving revision 1.35
diff -u -r1.35
--- files/   13 May 2009 10:40:24 -0000      1.35
+++ files/   4 Nov 2009 16:53:26 -0000
@@ -729,6 +729,10 @@
         init_script $script
         cat >> $script <<EOF
+if pkg_info -qe "\$(make show-var VARNAME=PKGNAME)" ; then
+       echo "PKG_COMP ==> $p is already installed!"
+       exit 0
 cd /usr/pkgsrc/$p
 if [ \$? != 0 ]; then

        rev 1.35

Home | Main Index | Thread Index | Old Index