diff --git a/poudlist-all/README.md b/poudlist-all/README.md index 60f9d7b..968ad24 100644 --- a/poudlist-all/README.md +++ b/poudlist-all/README.md @@ -2,7 +2,10 @@ ## Description A small script to generate a list of all ports installed, excluding leaf ports which you don't want to be rebuilt in conjunction of others.
-The author created this script because `poudriere bulk -a -j jailname` forces rebuilding ALL ports, which any of ports they depends on are updated, regardless it's too time-consuming or not. +The author created this script because `poudriere bulk -a -j jailname` forces rebuilding ALL ports, which any of ports they depends on are updated, regardless it's too time-consuming or not.
+This script recognizes FLAVORS. +The logic to support FLAVORs are tricky, as pkg does not support providing to list all installed ports as category/origin[@flavor] format.
+Currently, flavors of individual ports installed is listed only in annotations with other entries. ## Usage No command line arguments.Simply run it as a bourne shell script.
@@ -14,8 +17,9 @@ You need to edit the script and set variables in it. ### Variables for configuration #### BLOCKLISTS -ports origins you want to block from building.
+Origins of ports you want to block from building.
Each origins must be the form poudriere can accept.
+For ports having flavors, if you want to block specific flavor only, you can specify the flavor by adding @flavor like `textproc/fcitx5-qt@qt6`. Otherwise, all flavors installed for the origin are blocked from listing.
Note that poudriere does not block building listed ports if it is depended upon by any non-listed ports. Beware! If the origin is NOT a leaf ports, you must specify ALL origins of the ports/pkgs which depends on it, for example, japanese/libreoffice as the actual leaf of editors/libreoffice must be specified in conjunction with editors/libreoffice. diff --git a/poudlist-all/poudlist-all.sh b/poudlist-all/poudlist-all.sh index d046de4..6abea6e 100755 --- a/poudlist-all/poudlist-all.sh +++ b/poudlist-all/poudlist-all.sh @@ -40,6 +40,8 @@ TMPFILE=${LISTFILE}-`id -u`-`date "+%Y%m%d%H%M%S"` echo Output = ${LISTDIR}/${LISTFILE} echo Temporary = ${TMPDIR}/${TMPFILE} +# End configurations section. + # Cleanup old lists if exists, and rotate list. @@ -50,15 +52,31 @@ if [ -f ${LISTDIR}/${LISTFILE}.old ] ; then chmod 666 ${LISTDIR}/${LISTFILE}.old # Regenerate list with newly installed ports. -for PORT in `pkg query -a %n` ; do +for PACKAGE in `pkg query -a %n` ; do + PORT=`pkg query %o ${PACKAGE}` + FLAVOR=`pkg info -A ${PACKAGE} | fgrep "flavor" | cut -f 4 -w` FLG=NO for NONEED in ${BLOCKLISTS} ; do + if [ -n ${FLAVOR} ] ; then + if [ ${PORT}@${FLAVOR} = ${NONEED} ] ; then FLG="YES" ; fi + fi if [ ${PORT} = ${NONEED} ] ; then FLG="YES" ; fi done fgrep "${PORT}\|\|" ${PORTSDIR}/MOVED > /dev/null RET=$? if [ 0 -eq $((RET)) ] ; then FLG="YES" ; fi - if [ "NO" = ${FLG} ] ; then echo ${PORT} >> ${TMPDIR}/${TMPFILE} ; fi + if [ -n ${FLAVOR} ] ; then + fgrep "${PORT}@${FLAVOR}\|\|" ${PORTSDIR}/MOVED > /dev/null + RET=$? + if [ 0 -eq $((RET)) ] ; then FLG="YES" ; fi + fi + if [ "NO" = ${FLG} ] ; then + if [ -z ${FLAVOR} ] ; then + echo ${PORT} >> ${TMPDIR}/${TMPFILE} + else + echo ${PORT}@${FLAVOR} >> ${TMPDIR}/${TMPFILE} + fi + fi done sort ${TMPDIR}/${LISTFILE} | uniq > ${LISTDIR}/${LISTFILE}