Created
October 21, 2018 14:34
-
-
Save dlangille/c05e283e8eda6a0c26aaaf8adaa9666d to your computer and use it in GitHub Desktop.
Obtain package names & flavors for a given port - credit to Brian Drewery for the idea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% make flavors-package-names -f /var/db/repos/PORTS-head/security/py-requests-kerberos/Makefile PORTSDIR=/var/db/repos/PORTS-head | |
py27-requests-kerberos-0.11.0_2 | |
py36-requests-kerberos-0.11.0_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[freshports@pro02-dev02 ~/ports-jail]$ sudo /usr/sbin/chroot -u freshports /var/db/freshports/ports-jail /make-flavors-package-names.sh /var/db/repos/PORTS-head security/py-requests-kerberos | |
py27-requests-kerberos | |
py36-requests-kerberos | |
no flavors: | |
[freshports@pro02-dev02 ~/ports-jail]$ sudo /usr/sbin/chroot -u freshports /var/db/freshports/ports-jail /make-flavors-package-names.sh /var/db/repos/PORTS-head sysutils/bacula-server | |
[freshports@pro02-dev02 ~/ports-jail]$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This extracts information from a port Makefile regarding packages and flavors | |
# | |
# expected usage: sudo /usr/sbin/chroot -u USER JAIL /make-flavors-package-names.sh REPO_PATH PORTDIR | |
# | |
# where USER - user as which to execute the commands. e.g. dan | |
# JAIL - path to the jail created with the create-jail-directories.sh command. e.g. /usr/jail/FreshPorts | |
# REPO_PATH - path to the SVN repository e.g. /usr/local/PORTS-RELENG_9_1_0 | |
# PORTDIR - sysutils/bacula-server | |
# | |
. ./vars.sh | |
REPO_PATH=$1 | |
PORT=$2 | |
cd ${REPO_PATH}/${PORT} | |
FLAVORS=`${MAKE} -V FLAVORS -f ${REPO_PATH}/${PORT}/Makefile PORTSDIR=${REPO_PATH}` | |
for flavor in ${FLAVORS} | |
do | |
PKGBASE=`${MAKE} make -V PKGBASE FLAVOR=${flavor} -f ${REPO_PATH}/${PORT}/Makefile PORTSDIR=${REPO_PATH}` | |
if [ $? != 0 ] | |
then | |
return $? | |
else | |
echo ${PKGBASE} | |
fi | |
done | |
return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment