Index: head/ports-mgmt/portmaster/Makefile =================================================================== --- head/ports-mgmt/portmaster/Makefile (revision 456783) +++ head/ports-mgmt/portmaster/Makefile (revision 456784) @@ -1,57 +1,57 @@ # $FreeBSD$ PORTNAME= portmaster PORTVERSION= 3.17.11 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= ports-mgmt MASTER_SITES= LOCAL/bdrewery/${PORTNAME}/ \ http://mirror.shatow.net/freebsd/${PORTNAME}/ \ GH MAINTAINER= se@FreeBSD.org COMMENT= Manage your ports without external databases or languages LICENSE= BSD2CLAUSE USE_GITHUB= yes GH_ACCOUNT= freebsd OPTIONS_DEFINE= BASH ZSH OPTIONS_DEFAULT=BASH ZSH PLIST_FILES= sbin/portmaster \ etc/portmaster.rc.sample \ man/man8/portmaster.8.gz BASH_PLIST_FILES= etc/bash_completion.d/portmaster.sh ZSH_PLIST_FILES= share/zsh/site-functions/_portmaster NO_ARCH= yes verify: checksum do-build: .for file in portmaster files/portmaster.rc.sample files/portmaster.8 ${SED} -e 's#/usr/local#${LOCALBASE}#g' ${WRKSRC}/${file} \ > ${WRKDIR}/${file:T} .endfor do-install: ${INSTALL_SCRIPT} ${WRKDIR}/portmaster \ ${STAGEDIR}${PREFIX}/sbin ${INSTALL_DATA} ${WRKDIR}/portmaster.rc.sample \ ${STAGEDIR}${PREFIX}/etc ${INSTALL_MAN} ${WRKSRC}/files/portmaster.8 \ ${STAGEDIR}${MAN8PREFIX}/man/man8 post-install-BASH-on: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d ${INSTALL_DATA} ${WRKSRC}/files/bash-completions \ ${STAGEDIR}${PREFIX}/etc/bash_completion.d/portmaster.sh post-install-ZSH-on: ${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions ${INSTALL_DATA} ${WRKSRC}/files/zsh-completions \ ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_portmaster .include Index: head/ports-mgmt/portmaster/files/patch-portmaster =================================================================== --- head/ports-mgmt/portmaster/files/patch-portmaster (revision 456783) +++ head/ports-mgmt/portmaster/files/patch-portmaster (revision 456784) @@ -1,284 +1,330 @@ --- portmaster.orig 2017-12-14 16:26:55 UTC +++ portmaster @@ -310,7 +310,7 @@ safe_exit () { } # safe_exit() flavor_part () { expr "$1" : ".*@" >/dev/null && echo "${1#*@}"; } -dir_part () { echo "${1%@*}"; } +dir_part () { echo "${1%%@*}"; } export_flavor () { local flavor="$1"; if [ "$FLAVOR" != "$flavor" ]; then pm_v "===>>> Setting FLAVOR to '$flavor' (was '$FLAVOR')"; export FLAVOR="$flavor"; fi; } @@ -652,7 +652,7 @@ for var in "$@" ; do export LOCAL_PACKAGEDIR ;; --delete-packages) PM_DELETE_PACKAGES=pm_delete_packages export PM_DELETE_PACKAGES ;; - --flavor=*) PM_FLAVOR=${var#--flavor=} ;; +# --flavor=*) PM_FLAVOR=${var#--flavor=} ;; --update-if-newer) PM_UPDATE_IF_NEWER=pm_update_if_newer export PM_UPDATE_IF_NEWER ;; --delete-build-only) PM_DEL_BUILD_ONLY=pm_dbo @@ -811,15 +811,6 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then [ -n "$PM_URB" -o -n "$UPDATE_ALL" ] && [ -n "$1" ] && fail 'The -[ar] options are not compatible with other updates' - if [ -n "$PM_PACKAGES" -o -n "$PM_PACKAGES_BUILD" ]; then - unset PM_PACKAGES PM_PACKAGES_BUILD PM_PACKAGES_LOCAL PM_PACKAGES_NEWER PM_ALWAYS_FETCH PM_DELETE_PACKAGES - echo "===>>> Package installation support cannot be used with pkgng yet," - echo " it will be disabled" - echo '' - [ `/sbin/sysctl -n kern.osreldate 2>/dev/null` -lt 600400 ] && - fail Package installation support requires FreeBSD 6.4 or newer - fi - if [ -n "$PM_INDEX" ] && [ -z "$LIST" -a -z "$LIST_ORIGINS" -a -z "$EXPUNGE" -a -z "$CLEAN_STALE" ]; then if [ -z "$INDEXFILE" ]; then @@ -1039,7 +1030,7 @@ find_moved_port () { return 0 else reason=${moved##*|} - [ "$3" != 'nonfatal' ] && + [ "$flag" != 'nonfatal' ] && fail "The $sf port has been deleted: $reason" fi ;; ${sf}\|*) moved_npd=${moved#*\|} # New port directory -@@ -1449,6 +1440,24 @@ check_force_multi () { +@@ -1349,15 +1340,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then + fi # [ -n "$CLEAN_PACKAGES" ] + + if [ -n "$CHECK_DEPENDS" ]; then +- missing_deps=$(pkg check -dn) +- pkg query "%o %do" | while read origin dep; do +- for missing_dep in ${missing_deps}; do +- if [ "${missing_dep}" = "${dep}" ]; then +- echo "${origin} requires missing ${dep}" +- break +- fi +- done +- done ++ pkg check -dn + exit 0 + fi + +@@ -1449,6 +1432,24 @@ check_force_multi () { fi } +find_new_port () { + # Global: new_port + local portdir flavor flavor_option + + [ -n "$new_port" ] && return + + portdir=$(dir_part "$1") + flavor=$(flavor_part "$1") + flavor_option=${flavor:+FLAVOR=$flavor} +# export_flavor $flavor + if pm_cd_pd $portdir; then + new_port=`pm_make -V PKGNAME ${flavor_option}` + else + new_port=`parse_index $portdir name` || + fail "No entry for $portdir in $PM_INDEX" + fi +} + check_for_updates () { # Global: num_updates local nf iport originflavor flavor origin port_ver do_update skip -@@ -1622,7 +1631,7 @@ pm_pkg_create () { +@@ -1622,7 +1623,7 @@ pm_pkg_create () { pm_cd_pd $portdir latest_link=`pm_make -V LATEST_LINK` cd ${1}/Latest - $PM_SU_CMD ln -sf ../All/$pkg ${latest_link}.tbz + $PM_SU_CMD ln -sf ../All/$pkg ${latest_link}.txz fi cd ${1}/${portdir%/*} -@@ -2148,24 +2157,6 @@ update_pm_nu () { +@@ -1994,8 +1995,8 @@ fi + if [ -n "$CLEAN_STALE" ]; then + [ -z "$no_del_list" ] && export no_del_list=':' + +- find_stale_ports="pkg query -ae '%a = 1' '%?r %n-%v' | awk '/^0/ { print \$2 }'" +- for file in `eval $find_stale_ports` ; do ++ stale_ports=`pkg query -ae '%a = 1' '%?r %n-%v' | awk '/^0 / { print \$2 }'` ++ for file in $stale_ports; do + iport="${file%/+REQUIRED_BY}" ; iport=${iport#$pdb/} + + case "$no_del_list" in *:${iport}:*) continue ;; esac +@@ -2148,24 +2149,6 @@ update_pm_nu () { PM_NEEDS_UPDATE="${PM_NEEDS_UPDATE}${1} " } -find_new_port () { - # Global: new_port - local portdir flavor flavor_option - - [ -n "$new_port" ] && return - - portdir=$(dir_part "$1") - flavor=$(flavor_part "$1") - flavor_option=${flavor:+FLAVOR=$flavor} -# export_flavor $flavor - if pm_cd_pd $portdir; then - new_port=`pm_make -V PKGNAME ${flavor_option}` - else - new_port=`parse_index $portdir name` || - fail "No entry for $portdir in $PM_INDEX" - fi -} - update_build_l () { local originflavor origin flavor iport -@@ -2280,10 +2271,12 @@ make_dep_list () { +@@ -2280,10 +2263,12 @@ make_dep_list () { for dep_type in $*; do case $dep_type in + all-depends-list) + var_opt="$var_opt -V BUILD_DEPENDS -V LIB_DEPENDS -V RUN_DEPENDS" ;; build-depends-list) - var_opt="$var_opt -V BUILD_DEPENDS" ;; + var_opt="$var_opt -V BUILD_DEPENDS -V LIB_DEPENDS" ;; run-depends-list) - var_opt="$var_opt -V RUN_DEPENDS" ;; + var_opt="$var_opt -V RUN_DEPENDS -V LIB_DEPENDS" ;; *) fail "make_dep_list: Unsupported option '$dep_type'" esac -@@ -2436,9 +2429,7 @@ dependency_check () { +@@ -2364,7 +2349,7 @@ dependency_check () { + continue + case "$rundeps" in + *" ${dep} "*|*${dep}*) +- varname=`echo ${dep#$pd/} | sed 's#[-+/\.]#_#g'` ++ varname=`echo ${dep#$pd/} | sed 's#[-+/\.@]#_#g'` + rundep_list="$rundep_list $varname" + eval $varname=\"$portdir \$$varname\" + eval ${varname}_p=$dep +@@ -2436,9 +2421,7 @@ dependency_check () { confl_p=`pkg query -g "%n-%v" $glob 2>/dev/null` if [ -n "$confl_p" ]; then confl_p=${confl_p%% *} -echo -e "<><><> Changing d_port from $d_port " d_port="$pd/`origin_from_pdb $confl_p`" -echo "to $d_port" if [ "${d_port#$pd/}" = "$portdir" ]; then echo -e "\n===>>> $origin seems to depend on $portdir" echo ' which looks like a dependency loop' -@@ -2797,7 +2788,12 @@ multiport () { +@@ -2797,7 +2780,12 @@ multiport () { numports=$(( $numports - 1 )) continue fi - origin=`origin_from_pdb $port` ;; + origin=$(origin_from_pdb $port) + unset PM_OLD_ORIGIN + if [ -n "$origin" ] && ! pm_isdir_pd "$origin"; then + export PM_OLD_ORIGIN=$origin + find_moved_port $origin $port nonfatal && origin=$moved_npd + fi ;; esac case "$PM_NEEDS_UPDATE" in -@@ -3033,7 +3029,7 @@ if [ -z "$REPLACE_ORIGIN" ]; then +@@ -3033,7 +3021,7 @@ if [ -z "$REPLACE_ORIGIN" ]; then *) echo '' ; no_valid_port ;; esac done ;; - *) upg_port=$(pkg query %n-%v $argv) ;; + *) upg_port=$(pkg query %n-%v "$argv") ;; esac if [ -z "$portdir" -a -z "$upg_port" ]; then -@@ -3129,12 +3125,13 @@ iport_from_pkgname () { +@@ -3129,12 +3117,13 @@ iport_from_pkgname () { dir=$(dir_part $1) flavor=$(flavor_part $1) pkgname=$(make -C "$pd/$dir" -V PKGNAME FLAVOR=$flavor) || return 1 - pkg info -x ${pkgname%-*}'-[^-]*' + pkg info -x "^${pkgname%-*}"'-[^-]*' 2>/dev/null } if [ -z "$upg_port" -a -z "$REPLACE_ORIGIN" ]; then upg_port=`iport_from_origin ${portdir}` || - upg_port=`iport_from_pkgname $portdir` + upg_port=`iport_from_pkgname $portdir` || + upg_port="$PM_OLD_ORIGIN" # || fail "XXX Cannot find installed port '$portdir'" fi -@@ -3383,7 +3380,7 @@ fetch_package () { +@@ -3383,7 +3372,7 @@ fetch_package () { fi if [ -z "$PM_ALWAYS_FETCH" ]; then - if [ -r "${ppd}/${1}.tbz" ]; then + if [ -r "${ppd}/${1}.txz" ]; then pm_v "===>>> Package exists, skipping fetch" return 0 else -@@ -3391,7 +3388,7 @@ fetch_package () { +@@ -3391,7 +3380,7 @@ fetch_package () { fi else do_fetch=do_fetch_always_fetch - pm_unlink_s ${ppd}/${1}.tbz + pm_unlink_s ${ppd}/${1}.txz fi if [ -n "$do_fetch" ]; then -@@ -3403,10 +3400,10 @@ fetch_package () { +@@ -3403,10 +3392,10 @@ fetch_package () { fi fi - pm_sv Fetching ${1}.tbz - if ! $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.tbz 2>/dev/null; then - pm_unlink_s ${ppd}/${1}.tbz - $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.tbz 2>/dev/null + pm_sv Fetching ${1}.txz + if ! $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.txz 2>/dev/null; then + pm_unlink_s ${ppd}/${1}.txz + $PM_SU_CMD fetch $FETCH_ARGS -o $ppd ${sitepath}${1}.txz 2>/dev/null fi fi } -@@ -3420,9 +3417,11 @@ fetch_package () { +@@ -3420,9 +3409,11 @@ fetch_package () { release=packages-${release%-RELEASE*}-release ;; 9\.0-CURRENT*) release=packages-9-current ;; 10\.0-CURRENT*) release=packages-10-current ;; - *RC[0-9]*) release=${release%-RC[0-9]} + 11\.0-CURRENT*) release=packages-11-current ;; + 12\.0-CURRENT*) release=packages-12-current ;; + *RC[0-9]*) release=${release%-RC[0-9]*} release=packages-${release}-release ;; - *BETA[0-9]*) release=${release%-BETA[0-9]} + *BETA[0-9]*) release=${release%-BETA[0-9]*} release=packages-${release}-release ;; esac -@@ -3439,15 +3438,17 @@ fetch_package () { +@@ -3439,15 +3430,17 @@ fetch_package () { echo "===>>> Checking package repository for latest available version" if [ -n "$LOCAL_PACKAGEDIR" ]; then - if [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.tbz" ]; then - local_package=${LOCAL_PACKAGEDIR}/All/${new_port}.tbz + pm_v "===>>> ... checking: ${LOCAL_PACKAGEDIR}/All/${new_port}.txz" + if [ -r "${LOCAL_PACKAGEDIR}/All/${new_port}.txz" ]; then + local_package=${LOCAL_PACKAGEDIR}/All/${new_port}.txz latest_pv=${local_package##*/} fi if [ -z "$latest_pv" -a -z "$PM_INDEX_ONLY" ]; then s=`pm_make -V LATEST_LINK` - if [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.tbz" ]; then - local_package=${LOCAL_PACKAGEDIR}/Latest/${s}.tbz - latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}.tbz` + echo "===>>> ... checking: ${LOCAL_PACKAGEDIR}/Latest/${s}.txz" + if [ -r "${LOCAL_PACKAGEDIR}/Latest/${s}.txz" ]; then + local_package=${LOCAL_PACKAGEDIR}/Latest/${s}.txz + latest_pv=`readlink ${LOCAL_PACKAGEDIR}/Latest/${s}.txz` latest_pv=${latest_pv##*/} else pm_v "===>>> No local package for ${new_port}, attempting fetch" -@@ -3510,7 +3511,7 @@ fetch_package () { +@@ -3510,7 +3503,7 @@ fetch_package () { fi else latest_pv=${latest_pv#*href=\"} - latest_pv=${latest_pv%%\.tbz*} + latest_pv=${latest_pv%%\.txz*} fi notnewer () { -@@ -3594,6 +3595,7 @@ if [ -z "$use_package" ]; then +@@ -3594,6 +3587,7 @@ if [ -z "$use_package" ]; then fi pm_cd_pd $portdir + export_flavor $(flavor_part $portdir) [ -z "$DONT_PRE_CLEAN" ] && { pm_make clean NOCLEANDEPENDS=ncd || fail 'make clean failed'; } -@@ -3635,7 +3637,7 @@ pkg_flavor () { +@@ -3635,7 +3629,7 @@ pkg_flavor () { eval pm_make -DNO_DEPENDS stage $port_log_args || fail "make stage failed for $portdir" else [ -z "$local_package" ] && { - fetch_package $latest_pv || fail "Fetch for ${latest_pv}.tbz failed"; } + fetch_package $latest_pv || fail "Fetch for ${latest_pv}.txz failed"; } fi # Ignore if no old port exists, or -F -@@ -3762,14 +3764,14 @@ if [ -z "$use_package" ]; then +@@ -3685,7 +3679,7 @@ if [ -n "$upg_port" -o -n "$ro_upg_port" ] && [ -z "$F + if [ -n "$upg_port" ]; then + case " $PM_PRESERVE_PORTS " in + *" $portdir "*) +- preserve_port=`echo $portdir | sed 's#[-+/\.]#_#g'` ++ preserve_port=`echo $portdir | sed 's#[-+/\.@]#_#g'` + eval preserve_port_files="\$${preserve_port}_files" + preserve_dir=`/usr/bin/mktemp -d ${TMPDIR}/d-${PM_PARENT_PID}-${preserve_port} 2>/dev/null` || + fail "Could not create a temporary directory for $preserve_port in $TMPDIR" +@@ -3762,14 +3756,14 @@ if [ -z "$use_package" ]; then else [ -n "$local_package" ] && ppd=${LOCAL_PACKAGEDIR}/All - echo "===>>> Installing package" - if $PM_SU_CMD pkg add --accept-missing --force ${ppd}/${latest_pv}.tbz; then + echo "===>>> Installing package from: ${ppd}/${latest_pv}.txz" + if $PM_SU_CMD pkg add --accept-missing --force ${ppd}/${latest_pv}.txz; 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}.txz" + pm_unlink_s ${ppd}/${latest_pv}.txz fi else - install_failed ${latest_pv}.tbz + install_failed ${latest_pv}.txz fi fi