Better MacPorts release flow.

This commit is contained in:
tlimoncelli@stackexchange.com
2015-02-22 11:25:42 -05:00
parent ee3b6612ff
commit 19facd35da
4 changed files with 120 additions and 0 deletions

29
tools/macports_update.sh Executable file
View File

@@ -0,0 +1,29 @@
#! /usr/bin/env bash
# Generate the Macports Portfile and test it.
PORTVERSION=${1?"Arg 1 must be a version number like 1.20150222 (with no v)"} ; shift
tools/mk_portfile.sh tools/Portfile.template Portfile "$PORTVERSION"
echo
echo 'Adding file:///var/tmp/ports to the start of /opt/local/etc/macports/sources.conf'
echo
fgrep >/dev/null -x 'file:///var/tmp/ports' /opt/local/etc/macports/sources.conf || sudo sed -i -e '1s@^@file:///var/tmp/ports\'$'\n@' /opt/local/etc/macports/sources.conf
echo
echo 'Installing port using local repo.'
echo
sudo port uninstall vcs_blackbox
rm -rf /var/tmp/ports
mkdir -p /var/tmp/ports/security/vcs_blackbox
cp Portfile /var/tmp/ports/security/vcs_blackbox
cd /var/tmp/ports && portindex
sudo port clean --all vcs_blackbox
sudo port install vcs_blackbox
#echo
#echo 'Removing file:///var/tmp/ports from /opt/local/etc/macports/sources.conf'
#echo
#sudo sed -i -e '\@^file:///var/tmp/ports@d' /opt/local/etc/macports/sources.conf
echo 'You may wish to: sudo vi /opt/local/etc/macports/sources.conf'