View | Details | Raw Unified | Return to bug 218348
Collapse All | Expand All

(-)ports-mgmt/portmaster/Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	portmaster
3
PORTNAME=	portmaster
4
PORTVERSION=	3.17.10
4
PORTVERSION=	3.17.10
5
PORTREVISION=	1
5
CATEGORIES=	ports-mgmt
6
CATEGORIES=	ports-mgmt
6
MASTER_SITES=	LOCAL/bdrewery/${PORTNAME}/ \
7
MASTER_SITES=	LOCAL/bdrewery/${PORTNAME}/ \
7
		http://mirror.shatow.net/freebsd/${PORTNAME}/ \
8
		http://mirror.shatow.net/freebsd/${PORTNAME}/ \
(-)ports-mgmt/portmaster/files/patch-portmaster (-3 / +281 lines)
Lines 1-6 Link Here
1
--- portmaster.orig	2016-02-05 22:36:56 UTC
1
--- portmaster.orig	2017-02-03 22:10:23 UTC
2
+++ portmaster
2
+++ portmaster
3
@@ -1239,7 +1239,8 @@ all_pkgs_by_origin () {
3
@@ -404,6 +404,24 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then
4
 	[ -n "$use_pkgng" ] && export use_pkgng
5
 fi
6
 
7
+# Fn names map
8
+if [ -z "$use_pkgng" ]; then
9
+	pkg_list="/usr/sbin/pkg_info -q -L"
10
+	pkg_version="/usr/sbin/pkg_version"
11
+	pkg_add="/usr/sbin/pkg_add --no-deps "
12
+	pkg_create="/usr/sbin/pkg_create -b"
13
+	pkg_delete="/usr/sbin/pkg_delete"
14
+	pkg_ext="tbz"
15
+else
16
+	pkg_list="/usr/local/sbin/pkg query %Fp"
17
+	pkg_version="/usr/local/sbin/pkg version"
18
+	pkg_add="/usr/local/sbin/pkg add --accept-missing "
19
+	pkg_create="/usr/local/sbin/pkg create "
20
+	pkg_delete="/usr/local/sbin/pkg delete"
21
+	pkg_ext="txz"
22
+fi
23
+
24
+
25
 usage () {
26
 	local pd pdb port_dbdir
27
 
28
@@ -838,12 +856,6 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then
29
 	    fail 'The -[ar] options are not compatible with other updates'
30
 
31
 	if [ -n "$PM_PACKAGES" -o -n "$PM_PACKAGES_BUILD" ]; then
32
-		if [ -n "$use_pkgng" ]; then
33
-			unset PM_PACKAGES PM_PACKAGES_BUILD PM_PACKAGES_LOCAL PM_PACKAGES_NEWER PM_ALWAYS_FETCH PM_DELETE_PACKAGES
34
-			echo "===>>> Package installation support cannot be used with pkgng yet,"
35
-			echo "       it will be disabled"
36
-			echo ''
37
-		fi
38
 		[ `/sbin/sysctl -n kern.osreldate 2>/dev/null` -lt 600400 ] &&
39
 			fail Package installation support requires FreeBSD 6.4 or newer
40
 	fi
41
@@ -910,11 +922,6 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then
42
 		fi
43
 		unset INDEXFILE INDEXDIR
44
 
45
-		if [ -z "$use_pkgng" ]; then
46
-			pkg_version="pkg_version"
47
-		else
48
-			pkg_version="pkg version"
49
-		fi
50
 		PM_INDEX_PORTS=`$pkg_version -Ivl\< $PM_INDEX | cut -f1 -d\<`
51
 		export PM_INDEX_PORTS
52
 
53
@@ -1242,7 +1249,8 @@ all_pkgs_by_origin () {
4
 			echo $iport $origin
54
 			echo $iport $origin
5
 		done
55
 		done
6
 	else
56
 	else
Lines 10-16 Link Here
10
 	fi
60
 	fi
11
 	return
61
 	return
12
 }
62
 }
13
@@ -1644,42 +1645,21 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then
63
@@ -1647,42 +1655,21 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then
14
 	unique_list=':'
64
 	unique_list=':'
15
 
65
 
16
 	echo "===>>> Building list of installed port names"; echo ''
66
 	echo "===>>> Building list of installed port names"; echo ''
Lines 67-69 Link Here
67
 
117
 
68
 	echo "===>>> Checking $port_dbdir"
118
 	echo "===>>> Checking $port_dbdir"
69
 
119
 
120
@@ -1826,12 +1813,6 @@ check_for_updates () {
121
 				unset port_ver
122
 			fi
123
 		else
124
-			local pkg_version
125
-			if [ -z "$use_pkgng" ]; then
126
-				pkg_version="pkg_version"
127
-			else
128
-				pkg_version="pkg version"
129
-			fi
130
 			case `$pkg_version -t $iport $port_ver` in
131
 			\<)	do_update=upd_lt ;;
132
 			=)	;;	# Can be reached if same version with different options
133
@@ -1912,12 +1893,6 @@ pm_pkg_create () {
134
 	fi
135
 
136
 	pm_cd $pkgdir || fail "Cannot cd into $pkgdir to create a package"
137
-	local pkg_create
138
-	if [ -z "$use_pkgng" ]; then
139
-		pkg_create="pkg_create -b"
140
-	else
141
-		pkg_create="pkg create "
142
-	fi
143
 	if $PM_SU_CMD $pkg_create $2; then
144
 		if [ "$1" = "$pbu" ]; then
145
 			if [ -n "$BACKUP" ]; then
146
@@ -1935,7 +1910,7 @@ pm_pkg_create () {
147
 				pm_cd_pd $portdir
148
 				latest_link=`pm_make -V LATEST_LINK`
149
 				cd ${1}/Latest
150
-				$PM_SU_CMD ln -sf ../All/$pkg ${latest_link}.tbz
151
+				$PM_SU_CMD ln -sf ../All/$pkg ${latest_link}.${pkg_ext}
152
 			fi
153
 
154
 			cd ${1}/${portdir%/*}
155
@@ -2310,11 +2285,6 @@ if [ -n "$EXPUNGE" ]; then
156
 	[ -n "$BACKUP" ] && { init_packages ; pm_pkg_create $pbu $EXPUNGE; }
157
 	[ -z "$DONT_SCRUB_DISTFILES" ] && delete_all_distfiles $origin
158
 
159
-	if [ -z "$use_pkgng" ]; then
160
-		pkg_delete="pkg_delete"
161
-	else
162
-		pkg_delete="pkg delete"
163
-	fi
164
 	echo "===>>> Running $pkg_delete -f $EXPUNGE"
165
 	pm_pkg_delete_s $EXPUNGE || fail "$pkg_delete failed"
166
 
167
@@ -2355,10 +2325,8 @@ if [ -n "$CLEAN_STALE" ]; then
168
 
169
 		if [ -z "$use_pkgng" ]; then
170
 			echo '' ; pkg_info $iport
171
-			pkg_delete="pkg_delete"
172
 		else
173
 			echo '' ; pkg info -f $iport
174
-			pkg_delete="pkg delete"
175
 		fi
176
 
177
 		get_answer_yn n "\t===>>> ${iport} is no longer depended on, delete"
178
@@ -2532,12 +2500,6 @@ update_build_l () {
179
 
180
 	find_new_port $origin
181
 
182
-	local pkg_version
183
-	if [ -z "$use_pkgng" ]; then
184
-		pkg_version="pkg_version"
185
-	else
186
-		pkg_version="pkg version"
187
-	fi
188
 	case `$pkg_version -t $iport $new_port 2>/dev/null` in
189
 	\<)	build_l="${build_l}\tUpgrade $iport to $new_port\n" ;;
190
 	=)	build_l="${build_l}\tRe-install $iport\n" ;;
191
@@ -3746,7 +3708,7 @@ fetch_package () {
192
 	fi
193
 
194
 	if [ -z "$PM_ALWAYS_FETCH" ]; then
195
-		if [ -r "${ppd}/${1}.tbz" ]; then
196
+		if [ -r "${ppd}/${1}.${pkg_ext}" ]; then
197
 			pm_v "===>>> Package exists, skipping fetch"
198
 			return 0
199
 		else
200
@@ -3754,7 +3716,7 @@ fetch_package () {
201
 		fi
202
 	else
203
 		do_fetch=do_fetch_always_fetch
204
-		pm_unlink_s ${ppd}/${1}.tbz
205
+		pm_unlink_s ${ppd}/${1}.${pkg_ext}
206
 	fi
207
 
208
 	if [ -n "$do_fetch" ]; then
209
@@ -3766,10 +3728,10 @@ fetch_package () {
210
 			fi
211
 		fi
212
 
213
-		pm_sv Fetching ${1}.tbz
214
-		if ! $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.tbz 2>/dev/null; then
215
-			pm_unlink_s ${ppd}/${1}.tbz
216
-			$PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.tbz 2>/dev/null
217
+		pm_sv Fetching ${1}.${pkg_ext}
218
+		if ! $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.${pkg_ext} 2>/dev/null; then
219
+			pm_unlink_s ${ppd}/${1}.${pkg_ext}
220
+			$PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.${pkg_ext} 2>/dev/null
221
 		fi
222
 	fi
223
 }
224
@@ -3783,6 +3745,8 @@ fetch_package () {
225
 				release=packages-${release%-RELEASE*}-release ;;
226
 		9\.0-CURRENT*)	release=packages-9-current ;;
227
 		10\.0-CURRENT*)	release=packages-10-current ;;
228
+		11\.0-CURRENT*)	release=packages-11-current ;;
229
+		12\.0-CURRENT*)	release=packages-12-current ;;
230
 		*RC[0-9]*)	release=${release%-RC[0-9]}
231
 				release=packages-${release}-release ;;
232
 		*BETA[0-9]*)	release=${release%-BETA[0-9]}
233
@@ -3802,15 +3766,17 @@ fetch_package () {
234
 	echo "===>>> Checking package repository for latest available version"
235
 
236
 	if [ -n "$LOCAL_PACKAGEDIR" ]; then
237
-		if [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.tbz" ]; then
238
-			local_package=${LOCAL_PACKAGEDIR}/All/${new_port}.tbz
239
+		echo "===>>> ...checking: ${LOCAL_PACKAGEDIR}/All/${new_port}.${pkg_ext}"
240
+		if [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.${pkg_ext}" ]; then
241
+			local_package=${LOCAL_PACKAGEDIR}/All/${new_port}.${pkg_ext}
242
 			latest_pv=${local_package##*/}
243
 		fi
244
 		if [ -z "$latest_pv" -a -z "$PM_INDEX_ONLY" ]; then
245
 			s=`pm_make -V LATEST_LINK`
246
-			if [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.tbz" ]; then
247
-				local_package=${LOCAL_PACKAGEDIR}/Latest/${s}.tbz
248
-				latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}.tbz`
249
+			echo "===>>> ...checking: ${LOCAL_PACKAGEDIR}/Latest/${s}.${pkg_ext}"
250
+			if [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.${pkg_ext}" ]; then
251
+				local_package=${LOCAL_PACKAGEDIR}/Latest/${s}.${pkg_ext}
252
+				latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}.${pkg_ext}`
253
 				latest_pv=${latest_pv##*/}
254
 			else
255
 				pm_v "===>>> No local package for ${new_port}, attempting fetch"
256
@@ -3873,7 +3839,7 @@ fetch_package () {
257
 		fi
258
 	else
259
 		latest_pv=${latest_pv#*href=\"}
260
-		latest_pv=${latest_pv%%\.tbz*}
261
+		latest_pv=${latest_pv%%\.${pkg_ext}*}
262
 	fi
263
 
264
 notnewer () {
265
@@ -3888,11 +3854,6 @@ notnewer () {
266
 		pm_v "===>>> Available package ($latest_pv) matches the current version"
267
 	elif [ -n "$latest_pv" -a -n "$PM_PACKAGES_NEWER" ]; then
268
 		if [ -n "$upg_port" ]; then
269
-			if [ -z "$use_pkgng" ]; then
270
-				pkg_version="pkg_version"
271
-			else
272
-				pkg_version="pkg version"
273
-			fi
274
 			case `$pkg_version -t $upg_port $latest_pv` in
275
 			\<)	use_package=up_newer
276
 				pm_v "===>>> Available package ($latest_pv)"
277
@@ -3909,11 +3870,7 @@ notnewer () {
278
 			pm_v "===>>> There is a package available ($latest_pv)"
279
 		fi
280
 	elif [ -n "$latest_pv" ]; then
281
-		if [ -z "$use_pkgng" ]; then
282
-			pkg_version="pkg_version"
283
-		else
284
-			pkg_version="pkg version"
285
-		fi
286
+		echo "       $pkg_version -t $new_port $latest_pv"
287
 		case `$pkg_version -t $new_port $latest_pv` in
288
 		\<)	# Could happen if ports tree is out of date
289
 			use_package=up_old_tree
290
@@ -4002,7 +3959,7 @@ if [ -z "$use_package" ]; then
291
 	eval pm_make -DNO_DEPENDS stage $port_log_args || fail "make stage failed for $portdir"
292
 else
293
 	[ -z "$local_package" ] && {
294
-		fetch_package $latest_pv || fail "Fetch for ${latest_pv}.tbz failed"; }
295
+		fetch_package $latest_pv || fail "Fetch for ${latest_pv}.${pkg_ext} failed"; }
296
 fi
297
 
298
 # Ignore if no old port exists, or -F
299
@@ -4019,12 +3976,7 @@ if [ -n "$upg_port" -o -n "$ro_upg_port"
300
 		    grep -v ^$LOCALBASE_COMPAT > $pm_mktemp_file
301
 
302
 		unset temp
303
-		if [ -z "$use_pkgng" ]; then
304
-			pkglist="pkg_info -q -L"
305
-		else
306
-			pkglist="pkg query %Fp"
307
-		fi
308
-		for file in `$pkglist $UPGRADE_PORT |
309
+		for file in `$pkg_list $UPGRADE_PORT |
310
 		    sort - $pm_mktemp_file | uniq -d`; do
311
 			temp="${temp}$file "
312
 		done
313
@@ -4137,14 +4089,14 @@ if [ -z "$use_package" ]; then
314
 else
315
 	[ -n "$local_package" ] && ppd=${LOCAL_PACKAGEDIR}/All
316
 
317
-	echo "===>>> Installing package"
318
-	if $PM_SU_CMD pkg_add --no-deps --force ${ppd}/${latest_pv}.tbz; then
319
+	echo "===>>> Installing package from: ${ppd}/${latest_pv}.${pkg_ext}"
320
+	if $PM_SU_CMD $pkg_add --force ${ppd}/${latest_pv}.${pkg_ext}; then
321
 		if [ -n "$PM_DELETE_PACKAGES" ]; then
322
-			pm_v "===>>> Deleting ${latest_pv}.tbz"
323
-			pm_unlink_s ${ppd}/${latest_pv}.tbz
324
+			pm_v "===>>> Deleting ${latest_pv}.${pkg_ext}"
325
+			pm_unlink_s ${ppd}/${latest_pv}.${pkg_ext}
326
 		fi
327
 	else
328
-		install_failed ${latest_pv}.tbz
329
+		install_failed ${latest_pv}.${pkg_ext}
330
 	fi
331
 fi
332
 
333
@@ -4188,12 +4140,7 @@ echo ''
334
 temp=`find $LOCALBASE_COMPAT -type d -empty 2>/dev/null`
335
 if [ -z "$temp" ] && [ -d "$LOCALBASE_COMPAT" ]; then
336
 	unset files
337
-	if [ -z "$use_pkgng" ]; then
338
-		pkglist="pkg_info -q -L"
339
-	else
340
-		pkglist="pkg query %Fp"
341
-	fi
342
-	for file in `$pkglist $new_port`; do
343
+	for file in `$pkg_list $new_port`; do
344
 		[ -f "${LOCALBASE_COMPAT}/${file##*/}" ] &&
345
 			files="${files}${LOCALBASE_COMPAT}/${file##*/} "
346
 	done
347

Return to bug 218348