summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2001-11-29 14:13:27 +0000
committerseb <seb@pkgsrc.org>2001-11-29 14:13:27 +0000
commit1892676705c2de4421fdcfa0bbf2dafb7ff1fe52 (patch)
tree331100f5c5a7da0724d749b975264c88590c763c /pkgtools
parent485bf3c195bd75a0290723bd113bb7d6d36a9fb6 (diff)
downloadpkgsrc-1892676705c2de4421fdcfa0bbf2dafb7ff1fe52.tar.gz
Initial import of pkgcvsupdate-0.1.
Thanks to wiz for the manpage! Pkgcvsupdate is a tool to ease updating package source files from CVS. It can update a single package and its dependencies or a whole category of packages and their dependencies.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkgcvsupdate/DESCR3
-rw-r--r--pkgtools/pkgcvsupdate/Makefile46
-rw-r--r--pkgtools/pkgcvsupdate/PLIST4
-rw-r--r--pkgtools/pkgcvsupdate/files/pkgcvsupdate.162
-rwxr-xr-xpkgtools/pkgcvsupdate/files/pkgcvsupdate.sh96
5 files changed, 211 insertions, 0 deletions
diff --git a/pkgtools/pkgcvsupdate/DESCR b/pkgtools/pkgcvsupdate/DESCR
new file mode 100644
index 00000000000..d0994119b39
--- /dev/null
+++ b/pkgtools/pkgcvsupdate/DESCR
@@ -0,0 +1,3 @@
+Pkgcvsupdate is a tool to ease updating package source files from CVS.
+It can update a single package and its dependencies or a whole category of
+packages and their dependencies.
diff --git a/pkgtools/pkgcvsupdate/Makefile b/pkgtools/pkgcvsupdate/Makefile
new file mode 100644
index 00000000000..0b38d42d069
--- /dev/null
+++ b/pkgtools/pkgcvsupdate/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/11/29 14:13:27 seb Exp $
+
+DISTNAME= pkgcvsupdate-0.1
+CATEGORIES= pkgtools devel
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= seb@netbsd.org
+HOMEPAGE= ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/Packages.txt
+COMMENT= Tool to ease updating package source files from CVS
+
+EXTRACT_ONLY= # empty
+WRKSRC= ${WRKDIR}
+NO_CHECKSUM= yes
+NO_PATCH= yes
+NO_CONFIGURE= yes
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+BUILD_DEPENDS+= groff-[0-9]*:../../textproc/groff
+NROFF= gnroff
+DIFF?= gdiff
+.else
+NROFF= nroff
+DIFF?= diff
+.endif
+
+do-build:
+ ${SED} \
+ -e 's|@BASENAME@|${BASENAME}|g' \
+ -e 's|@DIRNAME@|${DIRNAME}|g' \
+ -e 's|@GREP@|${GREP}|g' \
+ -e 's|@LS@|${LS}|g' \
+ -e 's|@MAKE@|${MAKE}|g' \
+ -e 's|@TEST@|${TEST}|g' \
+ < ${FILESDIR}/pkgcvsupdate.sh \
+ > ${WRKSRC}/pkgcvsupdate
+ ${NROFF} -mandoc ${FILESDIR}/pkgcvsupdate.1 >${WRKSRC}/pkgcvsupdate.0
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/pkgcvsupdate ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/pkgcvsupdate.0 ${DESTDIR}${PREFIX}/man/cat1
+ ${INSTALL_MAN} ${FILESDIR}/pkgcvsupdate.1 ${DESTDIR}${PREFIX}/man/man1
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/pkgcvsupdate/PLIST b/pkgtools/pkgcvsupdate/PLIST
new file mode 100644
index 00000000000..41e89046521
--- /dev/null
+++ b/pkgtools/pkgcvsupdate/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/11/29 14:13:27 seb Exp $
+bin/pkgcvsupdate
+man/cat1/pkgcvsupdate.0
+man/man1/pkgcvsupdate.1
diff --git a/pkgtools/pkgcvsupdate/files/pkgcvsupdate.1 b/pkgtools/pkgcvsupdate/files/pkgcvsupdate.1
new file mode 100644
index 00000000000..f52f682948b
--- /dev/null
+++ b/pkgtools/pkgcvsupdate/files/pkgcvsupdate.1
@@ -0,0 +1,62 @@
+.\" $NetBSD: pkgcvsupdate.1,v 1.1.1.1 2001/11/29 14:13:27 seb Exp $
+.\"
+.\" Copyright (c) 2001 Stoned Elipot. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Stoned Elipot
+.\" for the NetBSD Project
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd November 19, 2001
+.Dt PKGCVSUPDATE 1
+.Os
+.Sh NAME
+.Nm pkgcvsupdate
+.Nd run CVS to update package sources in pkgsrc
+.Sh SYNOPSIS
+.Nm
+.Ar arguments
+.Sh DESCRIPTION
+The
+.Nm
+utility should be run from a package's main directory or a package category
+directory. It first updates the pkgsrc infrastructure in
+.Pa ${PKGSRCDIR}/mk ,
+then the package's files and recursively all the packages' files it
+depend on.
+.Pp
+Any arguments of
+.Nm
+are passed down to the CVS's update command.
+.Sh SEE ALSO
+.Xr cvs 1 ,
+.Pa ${PKGSRCDIR}/Packages.txt
+and
+.Rs
+.%T "Documentation on the NetBSD Package System"
+.Re
+.Sh AUTHORS
+The pkgcvsupdate utility was written by
+.An Stoned Elipot Aq seb@netbsd.org .
diff --git a/pkgtools/pkgcvsupdate/files/pkgcvsupdate.sh b/pkgtools/pkgcvsupdate/files/pkgcvsupdate.sh
new file mode 100755
index 00000000000..0ad3e34ff7b
--- /dev/null
+++ b/pkgtools/pkgcvsupdate/files/pkgcvsupdate.sh
@@ -0,0 +1,96 @@
+#! /bin/sh -
+# $NetBSD: pkgcvsupdate.sh,v 1.1.1.1 2001/11/29 14:13:27 seb Exp $
+
+BASENAME=@BASENAME@
+DIRNAME=@DIRNAME@
+GREP=@GREP@
+LS=@LS@
+MAKE=@MAKE@
+TEST=@TEST@
+
+args="$@"
+cwd=`pwd`
+
+# get packages to update for a start
+if $TEST -f ../../Packages.txt && $TEST -d ../../pkgtools/digest ; then
+ # we are in a package directory: only one package to start with
+ start_pkgs=`$MAKE show-var VARNAME=PKGPATH`
+ if $TEST $? -ne 0 || $TEST x"$start_pkgs" = x ; then
+ exit 1
+ fi
+ pkgsrcdir=`$MAKE show-var VARNAME=PKGSRCDIR`
+ if $TEST $? -ne 0 || $TEST x"$pkgsrcdir" = x ; then
+ exit 1
+ fi
+elif $TEST -f Makefile && $TEST -f ../Packages.txt ; then
+ # we are in category directory: get the package list of this
+ # category
+ pkg_list=`$MAKE -V SUBDIR`
+ if $TEST $? -ne 0 || $TEST x"$start_pkgs" = x ; then
+ # perhaps we don't have the -V flags to make (pre NetBSD 1.3
+ # make ?)
+ pkg_list=""
+ for f in * ; do
+ if $TEST -f $f/Makefile ; then
+ pkg_list="$pkg_list $f"
+ fi
+ done
+ fi
+ category=`$BASENAME $cwd`
+ if $TEST $? -ne 0 || $TEST x"$category" = x ; then
+ exit 1
+ fi
+ start_pkgs=""
+ for p in $pkg_list ; do
+ start_pkgs="$start_pkgs $category/$p"
+ done
+ pkgsrcdir=`$DIRNAME $cwd`
+ if $TEST $? -ne 0 || $TEST x"$pkgsrcdir" = x ; then
+ exit 1
+ fi
+else
+ echo "Not in a package or category directory" 1>&2
+ exit
+fi
+
+# first update pkgsrc infrastructure...
+cd $pkgsrcdir/mk || exit 1
+echo "==> mk"
+cvs update $@ || exit 1
+
+# ... then needed packages
+pkg_toupdate=$start_pkgs
+pkg_updated=""
+while true; do
+ # get next package to update
+ set blah $pkg_toupdate
+ shift
+ pkg=$1
+ if $TEST x"$pkg" = x ; then
+ break # all done
+ fi
+ shift
+ pkg_toupdate="$*"
+ # check if we already updated it...
+ case :$pkg_updated: in
+ *:$pkg:*) continue ;; # ...yes: on to next one
+ esac
+ # ...no: updating it
+ if cd $pkgsrcdir/$pkg ; then :; else
+ # package directory is not there, this may be a new package:
+ # try to check it out. This would also fail if it is
+ # a brand new category! Oh well...
+ cd $pkgsrcdir/`$BASENAME $pkg` || exit 1
+ cvs checkout $args `$DIRNAME $pkg` || exit 1
+ fi
+ echo "==> $pkg"
+ cvs update $args || exit 1
+ # record we updated if
+ pkg_updated="$pkg_updated:$pkg"
+ # queue dependency packages
+ pkg_depends=`$MAKE show-depends-dirs`
+ if $TEST $? -ne 0 ; then
+ exit 1
+ fi
+ pkg_toupdate="$pkg_toupdate $pkg_depends"
+done