#!/usr/local/bin/bash
PKGLISTPATH="/PATH/TO/STORE/PKGLIST"
if [ -n "$1" ]; then
keyword="$1"
shift
else
echo "Usage: $0 keyword"
echo "Example: $0 lib"
exit 1
fi
echo $keyword
if [ -f $PKGLISTPATH/pkgversion_`date +"%Y%m%d"`.txt ]
then
echo "Had $PKGLISTPATH/pkgversion_`date +"%Y%m%d"`.txt"
else
echo "Generating $PKGLISTPATH/pkgversion_`date +"%Y%m%d"`.txt"
portversion -l '<' > $PKGLISTPATH/pkgversion_`date +"%Y%m%d"`.txt
fi
for i in $(cat $PKGLISTPATH/pkgversion_`date +"%Y%m%d"`.txt | grep $keyword | awk '{ print $1 }'); do portmaster -D $i; done
Saturday, February 18, 2012
在 FreeBSD 使用 portmaster 更新已安裝的 ports - 程式碼修改
程式碼:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment