new options implemented: '-h|--help' and '-f|--file <filename>'

'-f|--file <filename>' is for obtaining package names
    from a specified file
manual page updated and slightly improved
This commit is contained in:
Aleksey Cheusov 2008-03-05 20:40:08 +00:00 committed by Thomas Klausner
parent 8e5d393129
commit 93c0cb9dc3
3 changed files with 51 additions and 8 deletions

View file

@ -1 +1 @@
VERSION=0.3.0
VERSION=0.4.0

View file

@ -37,13 +37,43 @@ fi
############################################################
usage (){
cat <<EOF
pkg_src_update_summary - efficiently updates
package summary from pkgsrc/ tree (pkg_info -X format)
pkg_src_update_summary - incrementally updates
package summary from pkgsrc/ tree (pkg_summary(5) format)
usage: pkg_src_update_summary summary_file
usage: pkg_src_update_summary [OPTIONS] summary_file
OPTIONS:
-h|--help display this help message
-f|--file <filename> obtain package names from
a specified file, - for stdin
EOF
}
pkgs_fn=''
while test $# -ne 1; do
case "$1" in
-h|--help)
usage
exit 0;;
-f|--file)
pkgs_fn="$2"
shift;;
--file=*|-f=*)
pkgs_fn="`printf '%s\n' \"$1\" | sed 's,^[^=]*=,,'`";;
-f*)
pkgs_fn="`printf '%s\n' \"$1\" | cut -b3-`";;
--)
shift
break;;
-*)
echo "Bad option $1" 1>&2
exit 1;;
*)
break
esac
shift
done
if test $# -ne 1; then
usage
exit 1
@ -63,7 +93,11 @@ mkdir -m 700 "$tmp_dir"
allpkgs_fn=$tmp_dir/allpkgs
pkg_list_all_pkgs > $allpkgs_fn
if test "$pkgs_fn"; then
awk '{sub(/#.*/, "")} NF > 0 {print $1}' $pkgs_fn > $allpkgs_fn
else
pkg_list_all_pkgs > $allpkgs_fn
fi
############################################################
#### process packages

View file

@ -1,4 +1,4 @@
.\" $NetBSD: pkg_src_update_summary.1,v 1.1 2008/02/14 19:37:41 cheusov Exp $
.\" $NetBSD: pkg_src_update_summary.1,v 1.2 2008/03/05 20:40:08 cheusov Exp $
.\"
.\" Copyright (c) 2008 by Aleksey Cheusov (vle@gmx.net)
.\" Absolutely no warranty.
@ -7,10 +7,11 @@
.Dt PKG_SRC_UPDATE_SUMMARY 1
.Sh NAME
.Nm pkg_src_update_summary
.Nd Incrementally updates source packages summary
.Nd incrementally updates source packages summary
.Sh SYNOPSIS
.Nm
.Op Ar summary_filename
.Op Ar OPTIONS
.Ar summary_filename
.Sh DESCRIPTION
.Nm
incrementally updates source packages summary about all packages in
@ -23,6 +24,13 @@ by PKGNAME field.
3) copying summary from summary_filename about unchanged packages.
4) collecting full summary information about all changed and new packages.
5) new summary = 3+4
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl h
display help message
.It Fl f Ar filename
package names are obtained from a specified file, not from pkgsrc tree
.Sh ENVIRONMENT
.Bd -literal
.Bl -tag -width Cm
@ -37,6 +45,7 @@ path to pkgsrc friendly make utility, defaults to make
pkg_src_update_summary /usr/pkgsrc/pkg_src_summary.txt
.Ed
.Sh SEE ALSO
.Xr pkg_summary 5 ,
.Xr pkg_src_summary 1 ,
.Xr pkg_src_micro_summary 1 ,
.Xr pkg_cmp_summary 1 ,