aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt/bpkg
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2008-11-20 23:18:30 +0800
committerpav <pav@FreeBSD.org>2008-11-20 23:18:30 +0800
commit63df439fffc25397040f30be935f2f2827519ae9 (patch)
tree6a7589e94b6baeb7f1f1df486d2c77885b0aaee4 /ports-mgmt/bpkg
parent13d486967b468054342ac21bf0bc1c934556178c (diff)
downloadfreebsd-ports-gnome-63df439fffc25397040f30be935f2f2827519ae9.tar.gz
freebsd-ports-gnome-63df439fffc25397040f30be935f2f2827519ae9.tar.zst
freebsd-ports-gnome-63df439fffc25397040f30be935f2f2827519ae9.zip
- Update to 2.0.5
PR: ports/129017 Submitted by: Andy Kosela <akosela@andykosela.com> (maintainer)
Diffstat (limited to 'ports-mgmt/bpkg')
-rw-r--r--ports-mgmt/bpkg/Makefile2
-rw-r--r--ports-mgmt/bpkg/files/bpkg.sh.in438
2 files changed, 220 insertions, 220 deletions
diff --git a/ports-mgmt/bpkg/Makefile b/ports-mgmt/bpkg/Makefile
index 94ca281c5fc2..e809c33e89d8 100644
--- a/ports-mgmt/bpkg/Makefile
+++ b/ports-mgmt/bpkg/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= bpkg
-PORTVERSION= 2.0.4
+PORTVERSION= 2.0.5
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none
diff --git a/ports-mgmt/bpkg/files/bpkg.sh.in b/ports-mgmt/bpkg/files/bpkg.sh.in
index cc628ffbbb5b..d739ab5d3fef 100644
--- a/ports-mgmt/bpkg/files/bpkg.sh.in
+++ b/ports-mgmt/bpkg/files/bpkg.sh.in
@@ -27,7 +27,7 @@
# SUCH DAMAGE.
trap trap_exit 2
-pkg=$@
+PKG=$@
trap_exit()
{
@@ -48,21 +48,21 @@ root()
pkg_info-xI()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d/ -f5`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e | \
grep -w Path | cut -d/ -f4,5`
echo -e "\033[33m*** not installed ***\033[0m"
- for i in $path; do
+ for i in $PWD; do
echo "$i: `cat /usr/ports/$i/Makefile | \
grep COMMENT | cut -d= -f2`"
done
else
echo -e "\033[33m*** installed ***\033[0m"
- pkg_info -I $info
+ pkg_info -I $INFO
fi
done
exit 0
@@ -70,12 +70,12 @@ pkg_info-xI()
pkg_info-xL()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ ! -z "$info" ]; then
- for i in $info; do
+ if [ ! -z "$INFO" ]; then
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -100,12 +100,12 @@ pkg_inf()
pkg_info-xs()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ ! -z "$info" ]; then
- for i in $info; do
+ if [ ! -z "$INFO" ]; then
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -122,14 +122,14 @@ pkg_info-xs()
pkg_info-xr()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep -w Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep -w COMMENT | cut -d= -f2`"
@@ -140,7 +140,7 @@ pkg_info-xr()
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -159,12 +159,12 @@ pkg_info-xr()
pkg_info-xg()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ ! -z "$info" ]; then
- for i in $info; do
+ if [ ! -z "$INFO" ]; then
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -181,14 +181,14 @@ pkg_info-xg()
pkg_info-xf()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep -w Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep -w COMMENT | cut -d= -f2`"
@@ -198,7 +198,7 @@ pkg_info-xf()
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -213,12 +213,12 @@ pkg_info-xf()
pkg_info-xk()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ ! -z "$info" ]; then
- for i in $info; do
+ if [ ! -z "$INFO" ]; then
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -235,12 +235,12 @@ pkg_info-xk()
pkg_info-xD()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ ! -z "$info" ]; then
- for i in $info; do
+ if [ ! -z "$INFO" ]; then
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -257,14 +257,14 @@ pkg_info-xD()
pkg_info-x()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep -w Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep -w COMMENT | cut -d= -f2`"
@@ -274,7 +274,7 @@ pkg_info-x()
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -297,9 +297,9 @@ pkg_ver()
pkg_path()
{
- path=`cd /usr/ports && make search path=/$pkg | grep -w Path | \
+ PWD=`cd /usr/ports && make search path=/$PKG | grep -w Path | \
cut -d/ -f4,5`
- for e in $path; do
+ for e in $PWD; do
echo "$e" ; cat /usr/ports/$e/Makefile | grep -w COMMENT | \
cut -d= -f2
done
@@ -308,23 +308,23 @@ pkg_path()
pkg_makefile()
{
- path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
+ PWD=`cd /usr/ports && make search path=/$PKG$ | grep -w Path | \
sed -n 1p | cut -d/ -f4,5`
- [ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
+ [ -z "$PWD" ] && echo "bpkg: can't find the port in /usr/ports/"
- less /usr/ports/$path/Makefile 2>/dev/null
+ less /usr/ports/$PWD/Makefile 2>/dev/null
exit 0
}
pkg_distinfo()
{
- path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
+ PWD=`cd /usr/ports && make search path=/$PKG$ | grep -w Path | \
sed -n 1p | cut -d/ -f4,5`
- [ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
+ [ -z "$PWD" ] && echo "bpkg: can't find the port in /usr/ports/"
- for e in `cat /usr/ports/$path/distinfo 2>/dev/null | grep SIZE | \
+ for e in `cat /usr/ports/$PWD/distinfo 2>/dev/null | grep SIZE | \
cut -d'=' -f2`; do
- echo "`cat /usr/ports/$path/distinfo | grep $e | \
+ echo "`cat /usr/ports/$PWD/distinfo | grep $e | \
sed 's/SIZE// ; s/(// ; s/)//' | \
cut -d' ' -f2` `convert $e`"
done
@@ -333,18 +333,18 @@ pkg_distinfo()
make_search()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e | \
grep -w Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
cd /usr/ports && make search path=/$i$
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
@@ -358,7 +358,7 @@ make_search()
make_search_S()
{
- for e in $pkg; do
+ for e in $PKG; do
cd /usr/ports && make search path=/$e
done
exit 0
@@ -366,7 +366,7 @@ make_search_S()
make_search_info()
{
- for e in $pkg; do
+ for e in $PKG; do
cd /usr/ports && make search info=$e
done
exit 0
@@ -374,27 +374,27 @@ make_search_info()
pkg_ftp()
{
- arch=`uname -m`
- sys=`uname -r | cut -d- -f1`
+ ARCH=`uname -m`
+ SYS=`uname -r | cut -d- -f1`
- for e in $pkg; do
+ for e in $PKG; do
echo "ls $e*" >> /tmp/bpkg.tmp
done
cat /tmp/bpkg.tmp | sed s/[0-9][0-9].*/*/ > /tmp/bpkg1.tmp
- echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-release/Latest/"
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-release/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-release/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
+ echo "ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-release/Latest/"
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-release/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-release/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
- n=1
+ N=1
for e in `cat /tmp/bpkg2.tmp | awk '{print $9}' | cut -d. -f1`; do
- size_pkg=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
- sed -n ${n}p | awk '{print $11}' | cut -d/ -f3`
- size=`cat /tmp/bpkg3.tmp | grep $size_pkg | awk '{print $5}'`
- mtime=`cat /tmp/bpkg3.tmp | grep $size_pkg | \
+ SIZE_PKG=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
+ sed -n ${N}p | awk '{print $11}' | cut -d/ -f3`
+ SIZE=`cat /tmp/bpkg3.tmp | grep $SIZE_PKG | awk '{print $5}'`
+ MTIME=`cat /tmp/bpkg3.tmp | grep $SIZE_PKG | \
awk '{print $6, $7, $8}'`
- echo "$e -> $size_pkg `convert $size` [$mtime]"
- n=`expr $n + 1`
+ echo "$e -> $SIZE_PKG `convert $SIZE` [$MTIME]"
+ N=`expr $N + 1`
done
rm /tmp/bpkg*.tmp
exit 0
@@ -402,27 +402,27 @@ pkg_ftp()
pkg_latestftp()
{
- arch=`uname -m`
- sys=`uname -r | cut -d. -f1`
+ ARCH=`uname -m`
+ SYS=`uname -r | cut -d. -f1`
- for e in $pkg; do
+ for e in $PKG; do
echo "ls $e*" >> /tmp/bpkg.tmp
done
cat /tmp/bpkg.tmp | sed s/[0-9][0-9].*/*/ > /tmp/bpkg1.tmp
- echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-stable/Latest/"
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-stable/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys-stable/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
+ echo "ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-stable/Latest/"
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-stable/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$ARCH/packages-$SYS-stable/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
- n=1
+ N=1
for e in `cat /tmp/bpkg2.tmp | awk '{print $9}' | cut -d. -f1`; do
- size_pkg=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
- sed -n ${n}p | awk '{print $11}' | cut -d/ -f3`
- size=`cat /tmp/bpkg3.tmp | grep $size_pkg | awk '{print $5}'`
- mtime=`cat /tmp/bpkg3.tmp | grep $size_pkg | \
+ SIZE_PKG=`cat /tmp/bpkg2.tmp | sed '/^[A-Z]/d' | \
+ sed -n ${N}p | awk '{print $11}' | cut -d/ -f3`
+ SIZE=`cat /tmp/bpkg3.tmp | grep $SIZE_PKG | awk '{print $5}'`
+ MTIME=`cat /tmp/bpkg3.tmp | grep $SIZE_PKG | \
awk '{print $6, $7, $8}'`
- echo "$e -> $size_pkg `convert $size` [$mtime]"
- n=`expr $n + 1`
+ echo "$e -> $SIZE_PKG `convert $SIZE` [$MTIME]"
+ N=`expr $N + 1`
done
rm /tmp/bpkg*.tmp
exit 0
@@ -449,7 +449,7 @@ pkg_clean2()
pkg_which-()
{
- grep "$pkg"$ /var/db/pkg/*/+CONTENTS | awk -F 'pkg/' '{ print $2 }' | \
+ grep "$PKG"$ /var/db/pkg/*/+CONTENTS | awk -F 'pkg/' '{ print $2 }' | \
sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | awk -F: '{ print $1 ":\t" $2 }'
exit 0
}
@@ -457,19 +457,19 @@ pkg_which-()
pkg_backup()
{
root
- z=`pkg_info -xoQ $pkg 2>/dev/null`
+ Z=`pkg_info -xoQ $PKG 2>/dev/null`
- if [ -z "$z" ]; then
+ if [ -z "$Z" ]; then
echo "bpkg: no installed ports match pattern(s)"
exit 0
fi
- pkg_install=`pkg_info -xoQ ^$pkg | cut -d: -f1 | awk '{ORS=" " ;print}'`
- echo "Creating backup package(s) "$pkg_install"in /var/tmp/bpkg/"
+ PKG_INSTALL=`pkg_info -xoQ ^$PKG | cut -d: -f1 | awk '{ORS=" " ;print}'`
+ echo "Creating backup package(s) "$PKG_INSTALL"in /var/tmp/bpkg/"
[ ! -d /var/tmp/bpkg/ ] && mkdir /var/tmp/bpkg/
- for e in $pkg; do
- i=`pkg_info -xoQ ^$e | cut -d: -f1'`
- cd /var/tmp/bpkg/ && pkg_create -xb $i 1>/dev/null 2>&1
+ for e in $PKG; do
+ I=`pkg_info -xoQ ^$e | cut -d: -f1'`
+ cd /var/tmp/bpkg/ && pkg_create -xb $I 1>/dev/null 2>&1
done
echo "Done."
exit 0
@@ -485,13 +485,13 @@ pkg_time()
make_showc()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep COMMENT | cut -d= -f2`"
@@ -506,15 +506,15 @@ make_showc()
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
echo ""
echo -n \
"Do you want to display config options recursively? [n] "
- read key
- case $key in
+ read KEY
+ case $KEY in
y) cd /usr/ports/$i && make showconfig-recursive;;
*) cd /usr/ports/$i && make showconfig;;
esac
@@ -528,37 +528,37 @@ make_showc()
make_rmc()
{
root
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep COMMENT | cut -d= -f2`"
echo ""
echo -n \
"Do you want to remove config options recursively? [n] "
- read key
- case $key in
+ read KEY
+ case $KEY in
y) cd /usr/ports/$i && make rmconfig-recursive;;
*) cd /usr/ports/$i && make rmconfig;;
esac
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
echo ""
echo -n \
"Do you want to remove config options recursively? [n] "
- read key
- case $key in
+ read KEY
+ case $KEY in
y) cd /usr/ports/$i && make rmconfig-recursive;;
*) cd /usr/ports/$i && make rmconfig;;
esac
@@ -572,37 +572,37 @@ make_rmc()
make_config()
{
root
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
- path=`cd /usr/ports && make search path=/$e.* | \
+ if [ -z "$INFO" ]; then
+ PWD=`cd /usr/ports && make search path=/$e.* | \
grep Path | cut -d/ -f4,5`
- for i in $path; do
+ for i in $PWD; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | \
grep COMMENT | cut -d= -f2`"
echo ""
echo -n \
"Do you want to set config options recursively? [n] "
- read key
- case $key in
+ read KEY
+ case $KEY in
y) cd /usr/ports/$i && make config-recursive;;
*) cd /usr/ports/$i && make config;;
esac
echo ""
done
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
echo ""
echo -n \
"Do you want to set config options recursively? [n] "
- read key
- case $key in
+ read KEY
+ case $KEY in
y) cd /usr/ports/$i && make config-recursive;;
*) cd /usr/ports/$i && make config;;
esac
@@ -615,40 +615,40 @@ make_config()
pkg_freshports()
{
- browser=`ls /usr/local/bin/w3m 2>/dev/null || \
+ BROWSER=`ls /usr/local/bin/w3m 2>/dev/null || \
ls /usr/local/bin/lynx 2>/dev/null || \
ls /usr/local/bin/links 2>/dev/null`
- if [ -z "$browser" ]; then
+ if [ -z "$BROWSER" ]; then
echo "bpkg: text WWW browser required"
else
echo "Loading..."
- path=`cd /usr/ports && make search path=/$pkg | grep -w Path | \
+ PWD=`cd /usr/ports && make search path=/$PKG | grep -w Path | \
sed -n 1p | cut -d/ -f4,5`
- $browser http://www.freshports.org/$path
+ $BROWSER http://www.freshports.org/$PWD
fi
exit 0
}
make_ldd()
{
- for e in $pkg; do
- info=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
+ for e in $PKG; do
+ INFO=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | \
cut -d: -f3`
- if [ -z "$info" ]; then
+ if [ -z "$INFO" ]; then
echo "bpkg: no installed ports match $e"
else
- for i in $info; do
+ for i in $INFO; do
echo -e "\033[33m*** installed ***\033[0m"
echo "$i: `grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`"
echo ""
echo "List of dynamic object dependencies:"
- pkg=`grep $i /var/db/pkg/*/+CONTENTS | \
+ PKG=`grep $i /var/db/pkg/*/+CONTENTS | \
grep -w ORIGIN | cut -d/ -f5`
- bin=`pkg_info -L $pkg | awk '/\/usr\/local\/bin/ \
+ BIN=`pkg_info -L $PKG | awk '/\/usr\/local\/bin/ \
/\/usr\/local\/sbin/ /usr\/local\/libexec/'`
- for o in $bin; do
+ for o in $BIN; do
/usr/bin/ldd -a $o
done
echo ""
@@ -664,13 +664,13 @@ make_ldd_all()
echo "List of all missing dynamic object dependencies:"
for e in `/bin/ls -l /bin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /bin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /bin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -680,13 +680,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /sbin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /sbin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /sbin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -696,13 +696,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/bin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/bin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/bin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -712,13 +712,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/games/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/games/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/games/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -728,13 +728,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/libexec/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/libexec/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/libexec/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -744,13 +744,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/sbin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/sbin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/sbin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -760,13 +760,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/local/bin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/local/bin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/local/bin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -777,13 +777,13 @@ make_ldd_all()
for e in `/bin/ls -l /usr/local/libexec/ 2>/dev/null | \
awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/local/libexec/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/local/libexec/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -794,13 +794,13 @@ make_ldd_all()
for e in `/bin/ls -l /usr/local/sbin/ 2>/dev/null | \
awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/local/sbin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/local/sbin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -810,13 +810,13 @@ make_ldd_all()
done
for e in `/bin/ls -l /usr/X11R6/bin/ 2>/dev/null | awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/X11R6/bin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/X11R6/bin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -827,13 +827,13 @@ make_ldd_all()
for e in `/bin/ls -l /usr/X11R6/libexec/ 2>/dev/null | \
awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/X11R6/libexec/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/X11R6/libexec/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -844,13 +844,13 @@ make_ldd_all()
for e in `/bin/ls -l /usr/X11R6/sbin/ 2>/dev/null | \
awk -F' ' '{print $9}'`; do
- libs=`/usr/bin/ldd -a /usr/X11R6/sbin/$e 2>/dev/null | grep found`
- if [ ! -z "$libs" ]; then
+ LIBS=`/usr/bin/ldd -a /usr/X11R6/sbin/$e 2>/dev/null | grep found`
+ if [ ! -z "$LIBS" ]; then
grep "$e"$ /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $1 ":\t" $2 }'
- echo "$libs"
- for i in `echo $libs | cut -d' ' -f1 | cut -d. -f1,2`; do
+ echo "$LIBS"
+ for i in `echo $LIBS | cut -d' ' -f1 | cut -d. -f1,2`; do
grep "$i". /var/db/pkg/*/+CONTENTS | \
awk -F 'pkg/' '{ print $2 }' | sed '/@dirrm/ d ; /@unexec/ d ; /@comment/ d ; s/\/+CONTENTS//g ; s/:@comment .*ORIGIN//g' | \
awk -F: '{ print $2 "\t [" $1 "]" }'
@@ -863,23 +863,23 @@ make_ldd_all()
convert()
{
- kilo=$(echo "scale=1; $1/1024" | bc )
- kiloint=$(echo "$1/1024" | bc )
+ KILO=$(echo "scale=1; $1/1024" | bc )
+ KILOINT=$(echo "$1/1024" | bc )
- mega=$(echo "scale=1; $kilo/1024" | bc )
- megaint=$(echo "$kilo/1024" | bc )
+ MEGA=$(echo "scale=1; $KILO/1024" | bc )
+ MEGAINT=$(echo "$KILO/1024" | bc )
- giga=$(echo "scale=1; $mega/1024" | bc )
- gigaint=$(echo "$mega/1024" | bc )
+ GIGA=$(echo "scale=1; $MEGA/1024" | bc )
+ GIGAINT=$(echo "$MEGA/1024" | bc )
- if [ $kiloint -lt 1 ]; then
+ if [ $KILOINT -lt 1 ]; then
echo "$1 bytes"
- elif [ $megaint -lt 1 ]; then
- echo "${kilo}K"
- elif [ $gigaint -lt 1 ]; then
- echo "${mega}M"
+ elif [ $MEGAINT -lt 1 ]; then
+ echo "${KILO}K"
+ elif [ $GIGAINT -lt 1 ]; then
+ echo "${MEGA}M"
else
- echo "${giga}G"
+ echo "${GIGA}G"
fi
}
@@ -900,53 +900,53 @@ help()
while getopts b:D:d:e:F:f:g:I:i:j:k:L:M:m:O:o:p:Q:q:r:S:s:w:z:CchltvZ opts; do
case $opts in
- b) pkg=$OPTARG
+ b) PKG=$OPTARG
pkg_backup;;
- D) pkg=$OPTARG
+ D) PKG=$OPTARG
pkg_distinfo;;
- d) pkg=$OPTARG
+ d) PKG=$OPTARG
pkg_info-x;;
- e) pkg=$OPTARG
+ e) PKG=$OPTARG
make_config;;
- F) pkg=$OPTARG
+ F) PKG=$OPTARG
pkg_freshports;;
- f) pkg=$OPTARG
+ f) PKG=$OPTARG
pkg_info-xf;;
- g) pkg=$OPTARG
+ g) PKG=$OPTARG
pkg_info-xg;;
- I) pkg=$OPTARG
+ I) PKG=$OPTARG
pkg_info-xI;;
- i) pkg=$OPTARG
+ i) PKG=$OPTARG
make_search;;
- j) pkg=$OPTARG
+ j) PKG=$OPTARG
make_search_info;;
- k) pkg=$OPTARG
+ k) PKG=$OPTARG
pkg_info-xk;;
- L) pkg=$OPTARG
+ L) PKG=$OPTARG
pkg_info-xL;;
- M) pkg=$OPTARG
+ M) PKG=$OPTARG
pkg_info-xD;;
- m) pkg=$OPTARG
+ m) PKG=$OPTARG
pkg_makefile;;
- O) pkg=$OPTARG
+ O) PKG=$OPTARG
make_rmc;;
- o) pkg=$OPTARG
+ o) PKG=$OPTARG
make_showc;;
- p) pkg=$OPTARG
+ p) PKG=$OPTARG
pkg_path;;
- Q) pkg=$OPTARG
+ Q) PKG=$OPTARG
pkg_latestftp;;
- q) pkg=$OPTARG
+ q) PKG=$OPTARG
pkg_ftp;;
- r) pkg=$OPTARG
+ r) PKG=$OPTARG
pkg_info-xr;;
- S) pkg=$OPTARG
+ S) PKG=$OPTARG
make_search_S;;
- s) pkg=$OPTARG
+ s) PKG=$OPTARG
pkg_info-xs;;
- w) pkg=$OPTARG
+ w) PKG=$OPTARG
pkg_which-;;
- z) pkg=$OPTARG
+ z) PKG=$OPTARG
make_ldd;;
C) pkg_clean2;;
c) pkg_clean;;