pkgsrc-Bugs archive

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

Re: pkg/53897: tools/pkg_chk bug with python multi-version pkgs



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

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/53897: tools/pkg_chk bug with python multi-version pkgs
Date: Fri, 25 Jan 2019 09:41:29 +0100

 Noticing that pkg_chk already special-cases py[0-9][0-9]-* in one place,
 I thought maybe it would be OK to add more of this.
 
 The patch below is incomplete but makes things a bit better for me.
 I must have missed some place where a similar hack is needed.
 
 With this patch the installed pkg is considered newer than the current
 and ignored - obviously wrong but better than trying to build the wrong
 version.
 
 How to experiment is simple:
 
 	make /etc/mk.conf contain PYTHON_VERSION_DEFAULT=37
 	cd math/py-roman
 	make cleandir install PYTHON_VERSION_DEFAULT=27
 	pkg_chk -nr
 
 Martin
 
 
 Index: pkg_chk.sh
 ===================================================================
 RCS file: /cvsroot/pkgsrc/pkgtools/pkg_chk/files/pkg_chk.sh,v
 retrieving revision 1.75
 diff -u -r1.75 pkg_chk.sh
 --- pkg_chk.sh	25 Nov 2018 20:17:26 -0000	1.75
 +++ pkg_chk.sh	25 Jan 2019 08:33:54 -0000
 @@ -119,15 +119,25 @@
  	    # XXX need to handle multiple matching package case
  	    msg_n "$pkgdir - "
  	    pkg=$(echo $PKGNAME | ${SED} 's/-[0-9].*//')
 -	    pkginstalled=$(sh -c "${PKG_INFO} -e $pkg" || true)
 +	    pat=$pkg
 +	    case $pkg in
 +		py[0-9][0-9]-*)
 +			pat=$( echo $pkg | sed 's/^py[0-9][0-9]-/py\*-/' )
 +			;;
 +	    esac
 +	    pkginstalled=$(sh -c "${PKG_INFO} -e $pat" || true)
  	    if [ -z "$pkginstalled" ];then
  		msg_n "$PKGNAME missing"
  		MISSING_TODO="$MISSING_TODO $PKGNAME $pkgdir"
  	    else
  		pkgmatch=$(echo $PKGNAME | ${SED} 's/-\([0-9].*\)/>=\1/')
 +		if [ $pat != $pkg ]; then
 +			pyver=$( echo $pkginstalled | sed 's/^py\([0-9][0-9]\)-.*/\1/' )
 +			pkgmatch=$( echo $pkgmatch | ${SED} 's/^py[0-9][0-9]-/'"py${pyver}-/" )
 +		fi
  		if ! ${PKG_ADMIN} pmatch "$pkgmatch" "$pkginstalled" ; then
  		    INSTALL=
 -		    if [ -n "$pkginstalled" ];then
 +		    if [ -n "$pkginstalled" ]; then
  			msg_n "$pkginstalled < $PKGNAME"
  			MISMATCH_TODO="$MISMATCH_TODO $pkginstalled"
  		    else
 


Home | Main Index | Thread Index | Old Index