Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jan 2018 12:22:04 +0000 (UTC)
From:      Stefan Esser <se@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r460294 - in head/ports-mgmt/portmaster: . files
Message-ID:  <201801291222.w0TCM4eB016971@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: se
Date: Mon Jan 29 12:22:04 2018
New Revision: 460294
URL: https://svnweb.freebsd.org/changeset/ports/460294

Log:
  Fix a problem that could result in de-installation of a port that shares
  a prefix of the package name with a new port to be installed. The cause of
  this bug was that a pattern was applied without anchor at the end.
  
  Testing revealed that "pkg info -x" ignores an anchor at the end of the
  pattern (which might be a bug in pkg), therefore the output of the query
  is now additionally filtered with egrep to obtain the desired result.
  
  PR:		225496
  Reported by:	Martin Birgmeier
  Approved by:	antoine (implicit)

Modified:
  head/ports-mgmt/portmaster/Makefile
  head/ports-mgmt/portmaster/files/patch-portmaster

Modified: head/ports-mgmt/portmaster/Makefile
==============================================================================
--- head/ports-mgmt/portmaster/Makefile	Mon Jan 29 12:20:02 2018	(r460293)
+++ head/ports-mgmt/portmaster/Makefile	Mon Jan 29 12:22:04 2018	(r460294)
@@ -2,7 +2,7 @@
 
 PORTNAME=	portmaster
 PORTVERSION=	3.19
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	ports-mgmt
 
 MAINTAINER=	se@FreeBSD.org

Modified: head/ports-mgmt/portmaster/files/patch-portmaster
==============================================================================
--- head/ports-mgmt/portmaster/files/patch-portmaster	Mon Jan 29 12:20:02 2018	(r460293)
+++ head/ports-mgmt/portmaster/files/patch-portmaster	Mon Jan 29 12:22:04 2018	(r460294)
@@ -177,7 +177,23 @@
  else
  	portdir="${1#$pd/}" ; portdir="${portdir%/}"
  	export_flavor=$(flavor_part $portdir)
-@@ -3229,11 +3246,14 @@ if [ -n "$PM_FIRST_PASS" -a -z "$FETCH_ONLY" ]; then
+@@ -3138,12 +3155,13 @@ if [ -z "$PM_INDEX_ONLY" ] && ! pm_isdir_pd "$portdir"
+ fi
+ 
+ iport_from_pkgname () {
+-	local dir flavor pkgname
++	local dir flavor pkgname pattern
+ 
+ 	dir=$(dir_part $1)
+ 	flavor=$(flavor_part $1)
+ 	pkgname=$(FLAVOR=$flavor make -C "$pd/$dir" -V PKGNAME) || return 1
+-	pkg info -x "^${pkgname%-*}"'-[^-]*' 2>/dev/null
++	pattern="^${pkgname%-*}"'-[^-]*$'
++	pkg info -x "$pattern" 2>/dev/null | egrep -- "$pattern"
+ }
+ 
+ if [ -z "$upg_port" -a -z "$REPLACE_ORIGIN" ]; then
+@@ -3229,11 +3247,14 @@ if [ -n "$PM_FIRST_PASS" -a -z "$FETCH_ONLY" ]; then
  		fi
  	fi
  
@@ -193,7 +209,7 @@
  # Do these things first time through
  if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUILDING" -a -z "$SHOW_WORK" -a -z "$NO_ACTION" ]; then
  	# Do not start this in the background until we are sure we are going to proceed
-@@ -3639,12 +3659,18 @@ pkg_flavor () {
+@@ -3639,12 +3660,18 @@ pkg_flavor () {
  	if [ -n "$HIDE_BUILD" ] && [ -n "$(pm_make -V LICENSE)" ]; then
  		pm_make extract ask-license || fail "make extract ask-license failed for $portdir"
  	fi
@@ -212,7 +228,7 @@
  else
  	[ -z "$local_package" ] && {
  		fetch_package $latest_pv || fail "Fetch for ${latest_pv}.txz failed"; }
-@@ -3876,9 +3902,12 @@ if [ -n "$MAKE_PACKAGE" ]; then
+@@ -3876,9 +3903,12 @@ if [ -n "$MAKE_PACKAGE" ]; then
  fi
  
  if [ -z "$use_package" -a -z "$DONT_POST_CLEAN" ]; then



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801291222.w0TCM4eB016971>