ports/115268: [PATCH] ports-mgmt/bpkg: update to 1.3
Andy Kosela
andy.kosela at gmail.com
Tue Aug 7 14:00:03 UTC 2007
>Number: 115268
>Category: ports
>Synopsis: [PATCH] ports-mgmt/bpkg: update to 1.3
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Tue Aug 07 14:00:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Andy Kosela
>Release: FreeBSD 6.2-RELEASE-p2 i386
>Organization:
Protect Ya Neck Records/Wu-Tang Management
>Environment:
System: FreeBSD aegis.um.lublin.pl 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Tue Feb 27 22:56:09 UTC 2007
>Description:
- Update to 1.3
>How-To-Repeat:
>Fix:
--- bpkg-1.3.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/bpkg/Makefile /usr/home/spear/downloads/bpkg-1.3/Makefile
--- /usr/ports/ports-mgmt/bpkg/Makefile Mon Jul 23 12:54:18 2007
+++ /usr/home/spear/downloads/bpkg-1.3/Makefile Tue Aug 7 14:29:45 2007
@@ -2,13 +2,13 @@
# Date created: 24 June 2007
# Whom: Andy Kosela <andy.kosela at gmail.com>
#
-# $FreeBSD: ports/ports-mgmt/bpkg/Makefile,v 1.4 2007/07/23 10:54:18 chinsan Exp $
+# $FreeBSD$
#
# This port is self contained in the files directory.
#
PORTNAME= bpkg
-PORTVERSION= 1.2
+PORTVERSION= 1.3
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/bpkg/files/bpkg.8 /usr/home/spear/downloads/bpkg-1.3/files/bpkg.8
--- /usr/ports/ports-mgmt/bpkg/files/bpkg.8 Mon Jul 23 12:54:18 2007
+++ /usr/home/spear/downloads/bpkg-1.3/files/bpkg.8 Tue Aug 7 15:39:20 2007
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\"
-.Dd July 9, 2007
+.Dd August 7, 2007
.Dt BPKG 8
.Os
.Sh NAME
@@ -31,7 +31,7 @@
.Nd a simple tool for managing FreeBSD packages/ports.
.Sh SYNOPSIS
.Nm
-.Op Fl bdDeEfFgiIkLmMnNoOprsSwz
+.Op Fl bBdDeEfFgiIkLmMnoOprsSwz
.Ar pkg-name ...
.Nm
.Op Fl aAcChltvZ
@@ -54,12 +54,14 @@
The following command line arguments are supported:
.Bl -tag -width F1
.It Ar pkg-name ...
-with no additional arguments, upgrade/install the specified packages/ports.
+with no additional arguments, upgrade/install the specified packages.
.It Fl a
upgrade all installed packages (interactive mode). [no arguments]
.It Fl A
upgrade all installed packages (non-interactive mode). [no arguments]
.It Fl b
+upgrade/install the specified ports.
+.It Fl B
create backup package file in /usr/tmp/ from a locally installed package.
.It Fl c
clean all distfiles in /usr/ports/distfiles/* [no arguments]
@@ -85,9 +87,9 @@
.It Fl h
display help. [no arguments]
.It Fl i
-display info about the package/port.
+display info about the package/port (priority - installed packages).
.It Fl I
-display short info about the package/port.
+display short info about the package/port (priority - installed packages).
.It Fl k
show the deinstall script (if any) for the installed package.
.It Fl l
@@ -100,20 +102,18 @@
show the install-message file for the installed package.
.It Fl n
simulation mode, do not actually install a package/port.
-.It Fl N
-perform non-interactive installation of the binary package.
.It Fl o
display config options for the specified package/port.
.It Fl O
remove config options for the specified package/port.
.It Fl p
-search the ports tree for the specified port's name and display its path.
+search the ports tree and display short info about the port.
.It Fl r
show the list of all package/port's dependencies.
.It Fl s
show the total size occupied by files installed within the package.
.It Fl S
-search the ports tree for the specified string.
+search the ports tree and display info about the port.
.It Fl t
list all installed packages and dates of their installation. [no arguments]
.It Fl w
@@ -135,7 +135,11 @@
.Pp
.Dl Ar "# bpkg foo"
.Pp
-Upgrade or install a package/port named foo (root privileges required).
+Upgrade or install a package named foo (root privileges required).
+.Pp
+.Dl Ar "# bpkg -b foo"
+.Pp
+Upgrade or install a port named foo (root privileges required).
.Pp
.Dl Ar "> bpkg -i 'foo bar'"
.Pp
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/bpkg/files/bpkg.sh.in /usr/home/spear/downloads/bpkg-1.3/files/bpkg.sh.in
--- /usr/ports/ports-mgmt/bpkg/files/bpkg.sh.in Mon Jul 23 12:54:18 2007
+++ /usr/home/spear/downloads/bpkg-1.3/files/bpkg.sh.in Tue Aug 7 14:56:06 2007
@@ -1,5 +1,5 @@
#!/bin/sh
-# $FreeBSD: ports/ports-mgmt/bpkg/files/bpkg.sh.in,v 1.3 2007/07/23 10:54:18 chinsan Exp $
+# $FreeBSD$
# Copyright (c) 2007 Andy Kosela <andy.kosela at gmail.com>
# All rights reserved.
@@ -52,94 +52,51 @@
echo "bpkg: you didn't specify any package to install/upgrade"
exit 0
fi
-
- for e in $pkg; do
- [ -z "`cd /usr/ports && make search path=/$e[0-9]*$`" ] && missing
- done
echo "Available in ports:"
for e in $pkg; do
- cd /usr/ports && make search path=/$e[0-9]*$ | awk '/Port/ /Path/ { print $0 "\n" }'
+ cd /usr/ports && make search path=/$e.* | awk '/Port/ /Path/ { print $0 "\n" }'
done
for z in $pkg; do
- pkg_install=`cd /usr/ports && make search path=/$z[0-9]*$ | grep Path | cut -d/ -f4,5`
+ pkg_install=`cd /usr/ports && make search path=/$z.* | grep Path | cut -d/ -f4,5`
for e in $pkg_install; do
e_stripped=`echo $e | cut -d/ -f2`
- e_installed=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
+ e_installed=`grep $e$ /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
if [ -z "$e_installed" ]; then
- e_install=`cd /usr/ports && make search path=/$e[0-9]*$ | grep Path | cut -d/ -f4,5`
- echo -n "Do you want to install new $e_install? [y] "
+ echo -n "Do you want to install new $e? [y] "
else
echo -n "Do you want to upgrade installed $e_installed? [y] "
fi
read key
case $key in
n) ;;
- *) echo -n "Fetch binary package? [y] "
- read key
-
+ *)
if [ ! -z "$e_installed" ]; then
echo -n "Creating backup package in /usr/tmp/$e_installed.tbz... "
cd /usr/tmp/ && pkg_create -b $e_installed
echo "Done."
fi
- case $key in
-
- # Install from port (source)
-
- n) echo ""
- if [ ! -z "$e_installed" ]; then
- echo "Upgrading installed port:"
- pkg_delete -f $e_installed 1>/dev/null 2>&1
- if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
- echo "*** cannot proceed without first removing the package ***"
- exit 0
- fi
- else
- echo "Installing new port:"
- fi
-
- echo -n "Do you want to explicitly set config options now? [n] "
- read key2
- case $key2 in
- y) echo -n "Recursive? [n] "
- read key
- case $key in
- y) cd /usr/ports/$e_install && make config-recursive
- cd /usr/ports/$e_install && make install clean
- exit 0;;
- *) cd /usr/ports/$e_install && make config
- cd /usr/ports/$e_install && make install clean
- exit 0;;
- esac;;
-
- *) cd /usr/ports/$e_install && make install clean
- exit 0;;
- esac
- exit 0;;
-
- # Fetch and install binary package
+ # Fetch and install binary package
- *) echo ""
- if [ ! -z "$e_installed" ]; then
- echo "Upgrading installed package:"
- pkg_delete -f $e_installed 1>/dev/null 2>&1
- if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
- echo "*** cannot proceed without first removing the package ***"
- exit 0
- fi
- pkg_add -r $e_stripped
- exit 0
- else
- echo "Installing new package:"
- pkg_add -r $e_stripped
+ echo ""
+ if [ ! -z "$e_installed" ]; then
+ echo "Upgrading installed package:"
+ pkg_delete -f $e_installed 1>/dev/null 2>&1
+ if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
+ echo "*** cannot proceed without first removing the package ***"
exit 0
- fi;;
- esac
+ fi
+ pkg_add -r $e_stripped
+ exit 0
+ else
+ echo "Installing new package:"
+ pkg_add -r $e_stripped
+ exit 0
+ fi;;
esac
done
done
@@ -151,149 +108,119 @@
echo "bpkg: you didn't specify any package to install/upgrade"
exit 0
fi
-
- for e in $pkg; do
- [ -z "`cd /usr/ports && make search name=$e-[0-9]`" ] && missing
- done
echo "Available in ports:"
for e in $pkg; do
- cd /usr/ports && make search path=/$e[0-9]*$ | awk '/Port/ /Path/ { print $0 "\n" }'
+ cd /usr/ports && make search path=/$e.* | awk '/Port/ /Path/ { print $0 "\n" }'
done
for z in $pkg; do
- pkg_install=`cd /usr/ports && make search path=/$z[0-9]*$ | grep Path | cut -d/ -f4,5`
+ pkg_install=`cd /usr/ports && make search path=/$z.* | grep Path | cut -d/ -f4,5`
for e in $pkg_install; do
- e_install=`cd /usr/ports && make search path=/$e[0-9]*$ | grep Path | cut -d/ -f4,5`
e_stripped=`echo $e | cut -d/ -f2`
- e_installed=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
+ e_installed=`grep $e$ /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
if [ -z "$e_installed" ]; then
- echo -n "Do you want to install new $e_install? [y] "
+ echo -n "Do you want to install new $e? [y] "
else
echo -n "Do you want to upgrade installed $e_installed? [y] "
fi
read key
case $key in
n) ;;
- *) echo -n "Fetch binary package? [y] "
- read key
-
+ *)
if [ ! -z "$e_installed" ]; then
echo -n "Creating backup package in /usr/tmp/$e_installed.tbz... "
+ cd /usr/tmp/ && pkg_create -b $e_installed
echo "Done."
fi
- case $key in
-
- # Install from port (source)
-
- n) echo ""
- if [ ! -z "$e_installed" ]; then
- echo "Upgrading installed port:"
- pkg_delete -n $e_installed 1>/dev/null 2>&1
- if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
- echo "*** cannot proceed without first removing the package ***"
- exit 0
- fi
- else
- echo "Installing new port:"
- fi
+ # Fetch and install binary package
- echo -n "Do you want to explicitly set config options now? [n] "
- read key2
- case $key2 in
- y) echo -n "Recursive? [n] "
- read key
- case $key in
- y) exit 0;;
- *) exit 0;;
- esac;;
-
- *) exit 0;;
- esac
- exit 0;;
-
- # Fetch and install binary package
-
- *) echo ""
- if [ ! -z "$e_installed" ]; then
- echo "Upgrading installed package:"
- pkg_delete -n $e_installed 1>/dev/null 2>&1
- if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
- echo "*** cannot proceed without first removing the package ***"
- exit 0
- fi
- pkg_add -rn $e_stripped
- exit 0
- else
- echo "Installing new package:"
- pkg_add -rn $e_stripped
- exit 0
- fi;;
- esac
+ echo ""
+ if [ ! -z "$e_installed" ]; then
+ echo "Upgrading installed package:"
+ pkg_delete -n $e_installed 1>/dev/null 2>&1
+ pkg_add -rn $e_stripped
+ exit 0
+ else
+ echo "Installing new package:"
+ pkg_add -rn $e_stripped
+ exit 0
+ fi;;
esac
done
done
}
-non-interactive() {
+build_port() {
root
if [ -z "$pkg" ]; then
echo "bpkg: you didn't specify any package to install/upgrade"
exit 0
fi
-
- for e in $pkg; do
- [ -z "`cd /usr/ports && make search name=$e-[0-9]`" ] && missing
- done
echo "Available in ports:"
for e in $pkg; do
- cd /usr/ports && make search path=/$e[0-9]*$ | awk '/Port/ /Path/ { print $0 "\n" }'
+ cd /usr/ports && make search path=/$e.* | awk '/Port/ /Path/ { print $0 "\n" }'
done
for z in $pkg; do
- pkg_install=`cd /usr/ports && make search path=/$z[0-9]*$ | grep Path | cut -d/ -f4,5`
+ pkg_install=`cd /usr/ports && make search path=/$z.* | grep Path | cut -d/ -f4,5`
for e in $pkg_install; do
- e_install=`cd /usr/ports && make search path=/$e[0-9]*$ | grep Path | cut -d/ -f4,5`
e_stripped=`echo $e | cut -d/ -f2`
- e_installed=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
+ e_installed=`grep $e$ /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
if [ -z "$e_installed" ]; then
- echo -n "Do you want to install new $e_install? [y] "
+ echo -n "Do you want to install new $e? [y] "
else
echo -n "Do you want to upgrade installed $e_installed? [y] "
fi
read key
case $key in
n) ;;
- *)
+ *)
if [ ! -z "$e_installed" ]; then
echo -n "Creating backup package in /usr/tmp/$e_installed.tbz... "
cd /usr/tmp/ && pkg_create -b $e_installed
echo "Done."
fi
- # Fetch and install binary package
+ # Install from port (source)
echo ""
if [ ! -z "$e_installed" ]; then
- echo "Upgrading installed package:"
+ echo "Upgrading installed port:"
pkg_delete -f $e_installed 1>/dev/null 2>&1
if [ ! -z `pkg_info -oq $e_installed 2>/dev/null` ]; then
echo "*** cannot proceed without first removing the package ***"
exit 0
fi
- pkg_add -r $e_stripped
- exit 0
else
- echo "Installing new package:"
- pkg_add -r $e_stripped
- exit 0
- fi;;
+ echo "Installing new port:"
+ fi
+
+ echo -n "Do you want to explicitly set config options now? [n] "
+ read key2
+ case $key2 in
+ y) echo -n "Recursive? [n] "
+ read key
+ case $key in
+ y) cd /usr/ports/$e && make config-recursive
+ cd /usr/ports/$e && make install clean
+ exit 0;;
+ *) cd /usr/ports/$e && make config
+ cd /usr/ports/$e && make install clean
+ exit 0;;
+ esac;;
+
+ *) cd /usr/ports/$e && make install clean
+ exit 0;;
+ esac
+ exit 0;;
+
esac
done
done
@@ -407,7 +334,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -456,7 +383,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -518,7 +445,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -692,7 +619,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -729,7 +656,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -766,7 +693,7 @@
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[0-9]*$ | grep Path | cut -d/ -f4,5`
+ path=`cd /usr/ports && make search path=/$e.* | grep Path | cut -d/ -f4,5`
for i in $path; do
echo -e "\033[33m*** not installed ***\033[0m"
echo "$i: `cat /usr/ports/$i/Makefile | grep COMMENT | cut -d= -f2`"
@@ -798,25 +725,26 @@
}
make_depends() {
- for e in $pkg; do
- [ -z "`cd /usr/ports && make search path=/$e[0-9]*$`" ] && missing
- done
+ root
+ if [ -z "$pkg" ]; then
+ echo "bpkg: you didn't specify any package to install/upgrade"
+ exit 0
+ fi
echo "Available in ports:"
- for e in $pkg; do
- cd /usr/ports && make search path=/$e[0-9]*$ | awk '/Port/ /Path/ { print $0 "\n" }'
+ for i in $pkg; do
+ cd /usr/ports && make search path=/$e.* | awk '/Port/ /Path/ { print $0 "\n" }'
done
for z in $pkg; do
- pkg_install=`cd /usr/ports && make search path=/$z[0-9]*$ | grep Path | cut -d/ -f4,5`
+ pkg_install=`cd /usr/ports && make search path=/$z.* | grep Path | cut -d/ -f4,5`
for e in $pkg_install; do
e_stripped=`echo $e | cut -d/ -f2`
- e_installed=`grep $e /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
+ e_installed=`grep $e$ /var/db/pkg/*/+CONTENTS | grep -w ORIGIN | cut -d/ -f5`
if [ -z "$e_installed" ]; then
- e_install=`cd /usr/ports && make search path=/$e[0-9]*$ | grep Path | cut -d/ -f4,5`
- echo -n "Do you want to install new $e_install? [y] "
+ echo -n "Do you want to install new $e? [y] "
else
echo -n "Do you want to upgrade installed $e_installed? [y] "
fi
@@ -825,8 +753,7 @@
n) ;;
*)
if [ ! -z "$e_installed" ]; then
- echo ""
- echo "*** Creating backup package in /usr/tmp/$e_installed.tbz ***"
+ echo -n "Creating backup package in /usr/tmp/$e_installed.tbz... "
cd /usr/tmp/ && pkg_create -b $e_installed
echo "Done."
fi
@@ -849,15 +776,15 @@
y) echo -n "Recursive? [n] "
read key
case $key in
- y) cd /usr/ports/$e_install && make config-recursive
- cd /usr/ports/$e_install && make depends && make install clean
+ y) cd /usr/ports/$e && make config-recursive
+ cd /usr/ports/$e && make depends && make install clean
exit 0;;
- *) cd /usr/ports/$e_install && make config
- cd /usr/ports/$e_install && make depends && make install clean
+ *) cd /usr/ports/$e && make config
+ cd /usr/ports/$e && make depends && make install clean
exit 0;;
esac;;
- *) cd /usr/ports/$e_install && make depends && make install clean
+ *) cd /usr/ports/$e && make depends && make install clean
exit 0;;
esac
exit 0;;
@@ -1082,7 +1009,7 @@
help() {
echo "bpkg version `pkg_info -xI bpkg | cut -d- -f2 | cut -d' ' -f1`"
echo ""
- echo "Usage: bpkg [-bdDeEfFgiIkLmMnNoOprsSwz] pkg-name ..."
+ echo "Usage: bpkg [-bBdDeEfFgiIkLmMnoOprsSwz] pkg-name ..."
echo " bpkg [-aAcChltvZ]"
echo ""
echo "Please see the bpkg(8) man page for more information"
@@ -1093,9 +1020,11 @@
# End of functions
################################################################################
-while getopts b:d:D:e:E:f:F:g:i:I:k:L:m:M:n:N:o:O:p:r:s:S:w:z:aAcChltvZ opts; do
+while getopts b:B:d:D:e:E:f:F:g:i:I:k:L:m:M:n:o:O:p:r:s:S:w:z:aAcChltvZ opts; do
case $opts in
b) pkg=$OPTARG
+ build_port;;
+ B) pkg=$OPTARG
pkg_backup;;
d) pkg=$OPTARG
pkg_delete-xr;;
@@ -1125,8 +1054,6 @@
pkg_info-xD;;
n) pkg=$OPTARG
simulation;;
- N) pkg=$OPTARG
- non-interactive;;
o) pkg=$OPTARG
make_showc;;
O) pkg=$OPTARG
--- bpkg-1.3.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list