ports/152547: [PATCH] ports-mgmt/portmaster: support .txz and .tgz packages

Martin Matuska mm at FreeBSD.org
Wed Nov 24 16:50:10 UTC 2010


>Number:         152547
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portmaster: support .txz and .tgz packages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 24 16:50:10 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 8.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.1-STABLE FreeBSD 8.1-STABLE #2 r215471M: Thu Nov 18 23:08:16 CET
>Description:
- add support for .txz and .tgz packages as pkg_install does
- fetch is unchanged (still uses .tbz)

Added file(s):
- files/patch-portmaster.sh.in

Port maintainer (dougb at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- portmaster-3.4.patch begins here ---
Index: files/patch-portmaster.sh.in
===================================================================
RCS file: files/patch-portmaster.sh.in
diff -N files/patch-portmaster.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-portmaster.sh.in	24 Nov 2010 16:38:18 -0000
@@ -0,0 +1,110 @@
+--- portmaster.sh.in.orig	2010-11-10 04:14:56.000000000 +0100
++++ portmaster.sh.in	2010-11-24 17:36:50.011522143 +0100
+@@ -1085,7 +1085,7 @@
+ 
+ 	echo "===>>> Checking for stale packages"
+ 	for package in `find $PACKAGES -type f | sort`; do
+-		pkg_dir=${package##*/} ; pkg_dir=${pkg_dir%\.tbz} ; echo ''
++		pkg_dir=${package##*/} ; pkg_dir=${pkg_dir%\.tbz} ; pkg_dir=${pkg_dir%\.txz};  pkg_dir=${pkg_dir%\.tgz} ; echo ''
+ 
+ 		origin=`tar -O -zxvf $package '+CONTENTS' 2>/dev/null | grep '@comment ORIGIN:'` ||
+ 			fail Empty origin in $package
+@@ -1105,7 +1105,7 @@
+ 		fi
+ 
+ 		if [ -n "$port_ver" ]; then
+-			if [ "${port_ver}.tbz" = "${package##*/}" ]; then
++			if [ "${port_ver}.tbz" = "${package##*/}" -o "${port_ver}.txz" = "${package##*/}" -o "${port_ver}.tgz" = "${package##*/}" ]; then
+ 				echo "===>>> ${package##*/} is up to date"
+ 				if [ -z "$ALL" ]; then
+ 					if [ ! -d "${pdb}/${pkg_dir}" ]; then
+@@ -1584,8 +1584,9 @@
+ 
+ 				pm_cd_pd $portdir
+ 				latest_link=`pm_make -V LATEST_LINK`
++				pkg_sufx=`pm_make -V PKG_SUFX`
+ 				cd ${1}/Latest
+-				$PM_SU_CMD ln -sf ../All/$pkg ${latest_link}.tbz
++				$PM_SU_CMD ln -sf ../All/$pkg ${latest_link}${pkg_sufx}
+ 			fi
+ 
+ 			cd ${1}/${portdir%/*}
+@@ -3200,7 +3201,7 @@
+ 	fi
+ 
+ 	if [ -z "$PM_ALWAYS_FETCH" ]; then
+-		if [ -r "${ppd}/${1}.tbz" ]; then
++		if [ -r "${ppd}/${1}.tbz" -o -r "${ppd}/${1}.txz" -o -r "${ppd}/${1}.tgz" ]; then
+ 			pm_v "===>>> Package exists, skipping fetch"
+ 			return 0
+ 		else
+@@ -3254,20 +3255,39 @@
+ 	echo "===>>> Checking package repository for latest available version"
+ 
+ 	if [ -n "$LOCAL_PACKAGEDIR" ]; then
++		suffix=
+ 		if [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.tbz" ]; then
+-			local_package=${LOCAL_PACKAGEDIR}/All/${new_port}.tbz
++			suffix=.tbz
++		elif [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.txz" ]; then
++			suffix=.txz
++		elif [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.tgz" ]; then
++			suffix=.tgz
++		fi
++		if [ -n "$suffix" ]; then
++			local_package=${LOCAL_PACKAGEDIR}/All/${new_port}${suffix}
+ 			latest_pv=${local_package##*/}
+ 		fi
+ 		if [ -z "$latest_pv" -a -z "$PM_INDEX_ONLY" ]; then
+ 			s=`pm_make -V LATEST_LINK`
++			suffix=
+ 			if [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.tbz" ]; then
+-				local_package=${LOCAL_PACKAGEDIR}/Latest/${s}.tbz
+-				latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}.tbz`
++				suffix=.tbz
++			elif [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.txz" ]; then
++				suffix=.txz
++			elif [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.tgz" ]; then
++				suffix=.tgz
++			fi
++
++			if [ -n "$suffix" ]; then
++				local_package=${LOCAL_PACKAGEDIR}/Latest/${s}${suffix}
++				latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}${suffix}`
+ 				latest_pv=${latest_pv##*/}
+ 			else
+ 				pm_v "===>>> No local package for ${new_port}, attempting fetch"
+ 			fi
+ 		fi
++	else
++		suffix=.tbz
+ 	fi
+ 
+ 	if [ -z "$latest_pv" -a -z "$PM_PACKAGES_LOCAL" ]; then
+@@ -3305,6 +3325,8 @@
+ 	else
+ 		latest_pv=${latest_pv#*href=\"}
+ 		latest_pv=${latest_pv%%\.tbz*}
++		latest_pv=${latest_pv%%\.txz*}
++		latest_pv=${latest_pv%%\.tgz*}
+ 	fi
+ 
+ notnewer () {
+@@ -3505,13 +3527,13 @@
+ 	[ -n "$local_package" ] && ppd=${LOCAL_PACKAGEDIR}/All
+ 
+ 	echo "===>>> Installing package"
+-	if $PM_SU_CMD pkg_add --no-deps --force ${ppd}/${latest_pv}.tbz; then
++	if $PM_SU_CMD pkg_add --no-deps --force ${ppd}/${latest_pv}${suffix}; then
+ 		if [ -n "$PM_DELETE_PACKAGES" ]; then
+-			pm_v "===>>> Deleting ${latest_pv}.tbz"
+-			pm_unlink_s ${ppd}/${latest_pv}.tbz
++			pm_v "===>>> Deleting ${latest_pv}${suffix}"
++			pm_unlink_s ${ppd}/${latest_pv}${suffix}
+ 		fi
+ 	else
+-		install_failed ${latest_pv}.tbz
++		install_failed ${latest_pv}${suffix}
+ 	fi
+ fi
+ echo ''
--- portmaster-3.4.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list