summaryrefslogtreecommitdiff
path: root/ports-mgmt/bpkg
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2008-08-06 07:58:40 +0000
committerMartin Wilke <miwi@FreeBSD.org>2008-08-06 07:58:40 +0000
commitc588679cc24902854f61245d9f0d332fc647fd55 (patch)
tree8676696a35af70cd38894e871a5f0d4122e12bf0 /ports-mgmt/bpkg
parent- Update to 0.4.4 (diff)
- Update to 2.0.3
PR: 126277 Submitted by: Andy Kosela <akosela@andykosela.com> (maintainer)
Diffstat (limited to 'ports-mgmt/bpkg')
-rw-r--r--ports-mgmt/bpkg/Makefile3
-rw-r--r--ports-mgmt/bpkg/files/bpkg.846
-rw-r--r--ports-mgmt/bpkg/files/bpkg.sh.in125
3 files changed, 131 insertions, 43 deletions
diff --git a/ports-mgmt/bpkg/Makefile b/ports-mgmt/bpkg/Makefile
index d3ed84db08d9..5507f03f0ae8 100644
--- a/ports-mgmt/bpkg/Makefile
+++ b/ports-mgmt/bpkg/Makefile
@@ -8,8 +8,7 @@
#
PORTNAME= bpkg
-PORTVERSION= 2.0.2
-PORTREVISION= 1
+PORTVERSION= 2.0.3
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none
diff --git a/ports-mgmt/bpkg/files/bpkg.8 b/ports-mgmt/bpkg/files/bpkg.8
index 635a9bdfc5da..fe9c9714326a 100644
--- a/ports-mgmt/bpkg/files/bpkg.8
+++ b/ports-mgmt/bpkg/files/bpkg.8
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\"
-.Dd July 19, 2008
+.Dd August 5, 2008
.Dt BPKG 8
.Os
.Sh NAME
@@ -31,10 +31,10 @@
.Nd a simple tool for displaying information about ports.
.Sh SYNOPSIS
.Nm
-.Op Fl bdeEfgiIjkLmMoOpqQrsSwz
+.Op Fl bDdeFfgIijkLMmOopQqrSswz
.Ar pkg-name ...
.Nm
-.Op Fl cChltvZ
+.Op Fl CchltvZ
.Pp
.Sh DESCRIPTION
.Nm
@@ -46,15 +46,19 @@ The following command line arguments are supported:
.Bl -tag -width F1
.It Fl b
create backup package in /var/tmp/bpkg/ from a locally installed port.
-.It Fl c
-clean all distfiles in /usr/ports/distfiles/* [no arguments]
.It Fl C
-clean all distfiles in /usr/ports/distfiles/* and also all working directories
+clean all distfiles in /usr/ports/distfiles/* and also all work directories
of the ports tree /usr/ports/*/*/work/ [no arguments]
+.It Fl c
+clean all distfiles in /usr/ports/distfiles/* [no arguments]
+.It Fl D
+display size of port's source files.
.It Fl d
display description of the port.
.It Fl e
-configure options for the specified port using dialog(1).
+configure OPTIONS for the specified port.
+.It Fl F
+browse www.freshports.org port's entry. [text WWW browser required]
.It Fl f
show the packing list instructions for the port.
.It Fl g
@@ -70,40 +74,40 @@ display short info about the port (priority - installed ports).
search the ports tree according to ports' descriptions.
.It Fl k
show the deinstall script (if any) for the installed port.
-.It Fl l
-display short info about all installed ports. [no arguments]
.It Fl L
show the files within the installed port.
-.It Fl m
-display port's Makefile.
+.It Fl l
+display short info about all installed ports. [no arguments]
.It Fl M
show the install-message file for the installed port.
-.It Fl o
-display config options for the specified port.
+.It Fl m
+display port's Makefile.
.It Fl O
-remove config options for the specified port.
+remove config OPTIONS for the specified port.
+.It Fl o
+display config OPTIONS for the specified port.
.It Fl p
search the ports tree and display short info about the port.
-.It Fl q
-show the latest available package in the FreeBSD repository. [-RELEASE]
.It Fl Q
-show the latest available package in the FreeBSD repository. [-STABLE]
+display the latest available package in the FreeBSD repository. [-STABLE]
+.It Fl q
+display the latest available package in the FreeBSD repository. [-RELEASE]
.It Fl r
show the list of all port's dependencies.
-.It Fl s
-show the total size occupied by files installed within the port.
.It Fl S
search the ports tree and display info about the port.
+.It Fl s
+show the total size occupied by files installed within the port.
.It Fl t
list all installed ports with dates of their installation. [no arguments]
.It Fl w
which installed port owns the specified file.
.It Fl v
list all installed ports and possible updates. [no arguments]
-.It Fl z
-display dynamic object dependencies for the specified port.
.It Fl Z
display all missing dynamic object dependencies. [no arguments]
+.It Fl z
+display dynamic object dependencies for the specified port.
.El
.Sh EXIT STATUS
.Ex -std
diff --git a/ports-mgmt/bpkg/files/bpkg.sh.in b/ports-mgmt/bpkg/files/bpkg.sh.in
index f13b37de156b..d0e86cf3f790 100644
--- a/ports-mgmt/bpkg/files/bpkg.sh.in
+++ b/ports-mgmt/bpkg/files/bpkg.sh.in
@@ -309,13 +309,28 @@ pkg_path()
pkg_makefile()
{
path=`cd /usr/ports && make search path=/$pkg$ | grep -w Path | \
- cut -d/ -f4,5`
+ sed -n 1p | cut -d/ -f4,5`
[ -z "$path" ] && echo "bpkg: can't find the port in /usr/ports/"
less /usr/ports/$path/Makefile 2>/dev/null
exit 0
}
+pkg_distinfo()
+{
+ path=`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/"
+
+ for e in `cat /usr/ports/$path/distinfo 2>/dev/null | grep SIZE | \
+ cut -d'=' -f2`; do
+ echo "`cat /usr/ports/$path/distinfo | grep $e | \
+ sed 's/SIZE// ; s/(// ; s/)//' | \
+ cut -d' ' -f2` `convert $e`"
+ done
+ exit 0
+}
+
make_search()
{
for e in $pkg; do
@@ -365,9 +380,23 @@ pkg_ftp()
for e in $pkg; do
echo "ls $e*" >> /tmp/bpkg.tmp
done
- echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/"
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/ < /tmp/bpkg.tmp
- rm /tmp/bpkg.tmp
+ cat /tmp/bpkg.tmp | sed s/[0-9][0-9].*/*/ > /tmp/bpkg1.tmp
+
+ echo "ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/"
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-$sys/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
+
+ 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 | \
+ awk '{print $6, $7, $8}'`
+ echo "$e -> $size_pkg `convert $size` [$mtime]"
+ n=`expr $n + 1`
+ done
+ rm /tmp/bpkg*.tmp
exit 0
}
@@ -378,9 +407,23 @@ pkg_latestftp()
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-stable/Latest/"
- ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/ < /tmp/bpkg.tmp
- rm /tmp/bpkg.tmp
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/Latest/ < /tmp/bpkg1.tmp > /tmp/bpkg2.tmp
+ ftp -4Va ftp://ftp.freebsd.org/pub/FreeBSD/ports/$arch/packages-stable/All/ < /tmp/bpkg1.tmp > /tmp/bpkg3.tmp
+
+ 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 | \
+ awk '{print $6, $7, $8}'`
+ echo "$e -> $size_pkg `convert $size` [$mtime]"
+ n=`expr $n + 1`
+ done
+ rm /tmp/bpkg*.tmp
exit 0
}
@@ -569,6 +612,22 @@ make_config()
exit 0
}
+pkg_freshports()
+{
+ 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
+ echo "bpkg: text WWW browser required"
+ else
+ echo "Loading..."
+ path=`cd /usr/ports && make search path=/$pkg | grep -w Path | \
+ sed -n 1p | cut -d/ -f4,5`
+ $browser http://www.freshports.org/$path
+ fi
+ exit 0
+}
+
make_ldd()
{
for e in $pkg; do
@@ -801,12 +860,34 @@ make_ldd_all()
exit 0
}
+convert()
+{
+ kilo=$(echo "scale=1; $1/1024" | bc )
+ kiloint=$(echo "$1/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 )
+
+ if [ $kiloint -lt 1 ]; then
+ echo "$1 bytes"
+ elif [ $megaint -lt 1 ]; then
+ echo "${kilo}K"
+ elif [ $gigaint -lt 1 ]; then
+ echo "${mega}M"
+ else
+ echo "${giga}G"
+ fi
+}
+
help()
{
echo "bpkg version `pkg_info -xI bpkg | cut -d- -f2 | cut -d' ' -f1`"
echo ""
- echo "Usage: bpkg [-bdefgiIjkLmMoOpqQrsSwz] pkg-name ..."
- echo " bpkg [-cChltvZ]"
+ echo "Usage: bpkg [-bDdeFfgIijkLMmOopQqrSswz] pkg-name ..."
+ echo " bpkg [-CchltvZ]"
echo ""
echo "Please see the bpkg(8) man page for more information"
echo ""
@@ -816,54 +897,58 @@ help()
# End of functions
###############################################################################
-while getopts b:d:e:f:g:i:I:j:k:L:m:M:o:O:p:q:Q:r:s:S:w:z:cChltvZ opts; do
+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
pkg_backup;;
+ D) pkg=$OPTARG
+ pkg_distinfo;;
d) pkg=$OPTARG
pkg_info-x;;
e) pkg=$OPTARG
make_config;;
+ F) pkg=$OPTARG
+ pkg_freshports;;
f) pkg=$OPTARG
pkg_info-xf;;
g) pkg=$OPTARG
pkg_info-xg;;
- i) pkg=$OPTARG
- make_search;;
I) pkg=$OPTARG
pkg_info-xI;;
+ i) pkg=$OPTARG
+ make_search;;
j) pkg=$OPTARG
make_search_info;;
k) pkg=$OPTARG
pkg_info-xk;;
L) pkg=$OPTARG
pkg_info-xL;;
- m) pkg=$OPTARG
- pkg_makefile;;
M) pkg=$OPTARG
pkg_info-xD;;
- o) pkg=$OPTARG
- make_showc;;
+ m) pkg=$OPTARG
+ pkg_makefile;;
O) pkg=$OPTARG
make_rmc;;
+ o) pkg=$OPTARG
+ make_showc;;
p) pkg=$OPTARG
pkg_path;;
- q) pkg=$OPTARG
- pkg_ftp;;
Q) pkg=$OPTARG
pkg_latestftp;;
+ q) pkg=$OPTARG
+ pkg_ftp;;
r) pkg=$OPTARG
pkg_info-xr;;
- s) pkg=$OPTARG
- pkg_info-xs;;
S) pkg=$OPTARG
make_search_S;;
+ s) pkg=$OPTARG
+ pkg_info-xs;;
w) pkg=$OPTARG
pkg_which-;;
z) pkg=$OPTARG
make_ldd;;
- c) pkg_clean;;
C) pkg_clean2;;
+ c) pkg_clean;;
h) help;;
l) pkg_inf;;
t) pkg_time;;