summaryrefslogtreecommitdiff
path: root/pkgtools/cdpack
diff options
context:
space:
mode:
authordmcmahill <dmcmahill@pkgsrc.org>2008-01-28 23:06:13 +0000
committerdmcmahill <dmcmahill@pkgsrc.org>2008-01-28 23:06:13 +0000
commitb97269911b3d6adfb84805e36a788878ef4dc735 (patch)
tree06f65c5d3218a42db564dfb1eb9b3c180db37b15 /pkgtools/cdpack
parent99ea1f0246fb6928078dacb112b6164d9d806017 (diff)
downloadpkgsrc-b97269911b3d6adfb84805e36a788878ef4dc735.tar.gz
Update to cdpack-1.8. This change adds the cddist utility which may
be used for creating a cd/dvd set containing a distfile archive. No change to the existing portions of the package.
Diffstat (limited to 'pkgtools/cdpack')
-rw-r--r--pkgtools/cdpack/DESCR3
-rw-r--r--pkgtools/cdpack/Makefile27
-rw-r--r--pkgtools/cdpack/PLIST4
-rw-r--r--pkgtools/cdpack/files/cddist.1141
-rwxr-xr-xpkgtools/cdpack/files/cddist.sh533
-rw-r--r--pkgtools/cdpack/files/cdpack.13
6 files changed, 698 insertions, 13 deletions
diff --git a/pkgtools/cdpack/DESCR b/pkgtools/cdpack/DESCR
index 02be58cca57..a2b4159491b 100644
--- a/pkgtools/cdpack/DESCR
+++ b/pkgtools/cdpack/DESCR
@@ -12,3 +12,6 @@ The "no inter-CD/DVD depends" algorithm will place certain
packages on more than one CD/DVD to ensure that each CD/DVD is
self contained (all package dependencies are satisfied within
the single CD/DVD).
+
+The cddist utility in this package is used for creating an archive
+set of distfiles.
diff --git a/pkgtools/cdpack/Makefile b/pkgtools/cdpack/Makefile
index 6accc21bbf3..9baed31bb6f 100644
--- a/pkgtools/cdpack/Makefile
+++ b/pkgtools/cdpack/Makefile
@@ -1,15 +1,14 @@
-# $NetBSD: Makefile,v 1.25 2007/11/28 16:18:01 mishka Exp $
+# $NetBSD: Makefile,v 1.26 2008/01/28 23:06:13 dmcmahill Exp $
#
-DISTNAME= cdpack-1.7
-PKGREVISION= 2
+DISTNAME= cdpack-1.8
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= dmcmahill@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/
-COMMENT= Utility to create multi-cd binary package collections
+COMMENT= Utility to create multi-cd/dvd binary package collections
# for mkisofs
DEPENDS+= cdrtools-[0-9]*:../../sysutils/cdrtools
@@ -20,29 +19,35 @@ NO_CONFIGURE= yes
USE_TOOLS+= awk:run
USE_TOOLS+= expr:run
+USE_TOOLS+= printf:run
USE_TOOLS+= sort:run
USE_TOOLS+= tsort:run
INSTALLATION_DIRS= bin libexec ${PKGMANDIR}/man1
do-build:
+.for f in cdpack cddist
${SED} -e 's;@prefix@;${PREFIX};g' \
-e 's;@progver@;${PKGVERSION};g' \
-e 's;@AWK@;${AWK};g' \
-e 's;@EXPR@;${EXPR};g' \
+ -e 's;@PRINTF@;${PRINTF};g' \
-e 's;@SORT@;${SORT};g' \
-e 's;@TSORT@;${TSORT};g' \
- ${FILESDIR}/cdpack.sh > \
- ${WRKSRC}/cdpack
- ${CHMOD} 755 ${WRKDIR}/cdpack
- ${SED} -e 's;@AWK@;${AWK};g' ${FILESDIR}/cdpack.1 > \
- ${WRKSRC}/cdpack.1
+ ${FILESDIR}/${f}.sh > \
+ ${WRKSRC}/${f}
+ ${CHMOD} 755 ${WRKDIR}/${f}
+ ${SED} -e 's;@AWK@;${AWK};g' ${FILESDIR}/${f}.1 > \
+ ${WRKSRC}/${f}.1
+.endfor
${SED} -e 's;@AWK@;${AWK};g' ${FILESDIR}/cdgen.awk > \
${WRKSRC}/cdgen.awk
do-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/cdpack ${PREFIX}/bin
+.for f in cdpack cddist
+ ${INSTALL_SCRIPT} ${WRKSRC}/${f} ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/${f}.1 ${PREFIX}/${PKGMANDIR}/man1
+.endfor
${INSTALL_SCRIPT} ${WRKSRC}/cdgen.awk ${PREFIX}/libexec
- ${INSTALL_MAN} ${WRKSRC}/cdpack.1 ${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/cdpack/PLIST b/pkgtools/cdpack/PLIST
index 0b3fd9efc32..76f4e1c4304 100644
--- a/pkgtools/cdpack/PLIST
+++ b/pkgtools/cdpack/PLIST
@@ -1,4 +1,6 @@
-@comment $NetBSD: PLIST,v 1.2 2005/03/14 19:56:15 tv Exp $
+@comment $NetBSD: PLIST,v 1.3 2008/01/28 23:06:13 dmcmahill Exp $
+bin/cddist
bin/cdpack
libexec/cdgen.awk
+man/man1/cddist.1
man/man1/cdpack.1
diff --git a/pkgtools/cdpack/files/cddist.1 b/pkgtools/cdpack/files/cddist.1
new file mode 100644
index 00000000000..86f8f1671d2
--- /dev/null
+++ b/pkgtools/cdpack/files/cddist.1
@@ -0,0 +1,141 @@
+.\" $NetBSD: cddist.1,v 1.1 2008/01/28 23:06:13 dmcmahill Exp $
+.\"
+.\" Copyright (c) 2008 Dan McMahill, 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 Dan McMahill
+.\" 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 DAN MCMAHILL
+.\" ``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 FOUNDATION 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 January 28, 2008
+.Dt CDDIST 1
+.Os
+.Sh NAME
+.Nm cddist
+.Nd produce multi-CD/DVD distfile archive images
+.Sh SYNOPSIS
+.Nm ""
+.Op -dvd
+.Op -h | --help
+.Op -l logfile
+.Op -dnRvV
+.Op -x common_directory
+.Op -X extras_directory
+.Ar distfiles_directory
+.Ar image_directory
+.Sh DESCRIPTION
+The
+.Nm
+utility produces ISO 9660 image files for
+a multiple CD/DVD archive of pkgsrc distfiles.
+.Pp
+The
+.Nm
+utility archives all files and directories found in the directory
+.Ar distfiles_directory
+specified on the command line. The directory
+.Ar cd_image_directory
+is used as a staging area and the final ISO 9660 images are left in
+that directory. A file,
+.Ar .index ,
+which lists the contents of each CD/DVD will be left in the root
+directory of each CD/DVD image.
+.Bl -tag -width "-x directory "
+.It Fl d
+Enable debugging by not deleting temporary files at the end of the
+run. These files are left in TMPDIR.
+.It Fl dvd
+Create DVD sized images rather than the default CD-ROM sized images.
+.It Fl h
+.It Fl -help
+Displays a short usage message.
+.It Fl l Ar logfile
+Log the output of mkisofs -v -v to the file
+.Ar logfile .
+.It Fl R
+Generate a file,
+.Ar README.txt ,
+which will be placed in the root directory of each CD/DVD image. This
+README file contains a small amount of information about the contents
+of the CD/DVD set.
+.It Fl v
+Be verbose. Currently does not change things much.
+.It Fl V
+Print the program version number and exit.
+.It Fl x Ar directory
+Includes the contents of
+.Ar directory
+on each CD/DVD. This is useful for README files, etc., which you want
+to be present on each CD/DVD in the set.
+.It Fl X Ar directory
+Includes the contents of
+.Ar directory
+on the last CD/DVD in the set. This is useful for adding
+a pkgsrc.tar.gz tarball, i.e. a file which does not
+need to be on each CD/DVD.
+.El
+.Pp
+The
+.Nm
+utility exits 0 on success, and >0 if an error occurs.
+.Sh ENVIRONMENT
+.Nm
+uses the fillowing environment variables if set.
+.Bl -tag -width "TMPDIR"
+.It Ev AWK
+awk implementation to use.
+Defaults to
+.Dq Li @AWK@ .
+.It Ev TMPDIR
+Directory for holding temporary files during the image creation.
+Defaults to
+.Dq Li /tmp .
+.El
+.Sh EXAMPLES
+This example takes all of the distfiles found in
+/usr/pkgsrc/distfiles and creates cd images in
+/u2/images/disk{1,2,...}.iso. The directories
+/u2/images/disk{1,2,...} are used to create the ISO 9660 layouts.
+.D1 cddist /usr/pkgsrc/distfiles /u2/images
+.Pp
+To include a common set of files on all CD/DVD's, place them in a
+directory, /tmp/foo, in this example, and pass in the directory name
+with the
+.Fl x
+option.
+.Dl cddist -x /tmp/foo /usr/pkgsrc/distfiles /u2/images
+.Sh SEE ALSO
+.Xr cdpack 1
+.Xr mkisofs 1
+.Sh HISTORY
+The
+.Nm
+utility first appeared in the
+.Nx
+packages collection in January, 2008.
+.Sh AUTHORS
+The
+.Nm
+utility was written by Dan McMahill (dmcmahill@NetBSD.org).
diff --git a/pkgtools/cdpack/files/cddist.sh b/pkgtools/cdpack/files/cddist.sh
new file mode 100755
index 00000000000..283f00daaaa
--- /dev/null
+++ b/pkgtools/cdpack/files/cddist.sh
@@ -0,0 +1,533 @@
+#!/bin/sh
+# $NetBSD: cddist.sh,v 1.1 2008/01/28 23:06:13 dmcmahill Exp $
+#
+# Copyright (c) 2008 Dan McMahill, 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 Dan McMahill
+# 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 DAN MCMAHILL
+# ``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 FOUNDATION 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.
+#
+
+# $0 = program name
+# $2 = distfiles directory (/usr/pkgsrc/distfiles)
+# $3 = output directory
+
+prog=cddist
+progver=@progver@
+
+TMPDIR=${TMPDIR:-/tmp}
+TMP=${TMPDIR}/${prog}.$$
+AWK=${AWK:-@AWK@}
+EXPR="@EXPR@"
+PRINTF="@PRINTF@"
+SORT="@SORT@"
+
+sizes=$TMP/sizes
+sorted=$TMP/sorted
+
+cdlist=$TMP/cdlist
+indexf=$TMP/indexf
+readme=$TMP/readme
+warnings=$TMP/warnings
+
+
+rm -fr $TMP
+mkdir -m 0700 $TMP
+if test $? -ne 0 ; then
+ echo "Could not create temporary directory $TMP"
+ exit 1
+fi
+
+touch $exclude
+
+usage(){
+ cat << EOF
+$prog - generates ISO9660 images for a multi-cd/dvd pkgsrc distfiles archive
+Usage: $prog [-dvd] [-h|--help] [-l logfile] [-dRvV]
+ [-x dir] [-X dir] distfiles_directory cdimage_directory
+Example: $prog /usr/pkgsrc/packages/distfiles /images/distfiles
+Please refer to the manual page for complete documentation."
+
+EOF
+echo " "
+}
+
+clean_and_exit(){
+ if test $# -ge 1 ; then
+ rc=$1
+ else
+ rc=0
+ fi
+ if [ "x$DEBUG" = "xno" ]; then
+ rm -fr $TMP
+ else
+ echo "Debugging output left in $TMP"
+ fi
+ exit $rc
+}
+
+# return the full path name from a path which may
+# be a full path name or a relative path name
+fullpath(){
+ local x
+ x=$1
+ case $x in
+ /*) # do nothing, its an absolute path
+ ;;
+ *) x=`pwd`/$x
+ ;;
+ esac
+ echo $x
+}
+
+ADD_README=no
+DEBUG=no
+VERBOSE=no
+VERSION=no
+USE_XTRA=no
+USE_OTHERS=no
+mkisofslog=/dev/null
+
+DVD=no
+
+while
+ test -n "$1"
+do
+ case "$1"
+ in
+ # enable debugging
+ -d) DEBUG=yes
+ shift
+ ;;
+
+ # make a DVD sized image
+ -dvd) DVD=yes
+ shift
+ ;;
+
+ # help
+ -h|--help) usage
+ exit 0
+ ;;
+
+ # log file for the output of mkisofs -v -v
+ -l) mkisofslog=$2
+ shift 2
+ ;;
+
+ # automatically generate a README.txt file for each CD-ROM
+ -R) ADD_README=yes
+ shift
+ ;;
+
+ # be verbose
+ -v) VERBOSE=yes
+ shift
+ ;;
+
+ # display version
+ -V) VERSION=yes
+ shift
+ ;;
+
+ # extra directory to go on each CD.
+ -x) extra=$2
+ USE_XTRA=yes
+ shift 2
+ ;;
+
+ # extra directory to go on only 1 CD (pkgsrc.tar.gz for example)
+ -X) others=$2
+ USE_OTHERS=yes
+ shift 2
+ ;;
+
+ -*) echo "$prog: ERROR: $s is not a valid option"
+ usage
+ clean_and_exit 1
+ ;;
+
+ *) ARGS="$ARGS $1"
+ shift
+ ;;
+ esac
+done
+
+if [ $VERSION = "yes" ]; then
+ echo "$prog-$progver"
+ clean_and_exit 0
+fi
+
+set -- $ARGS
+
+if [ $# -ne 2 ]; then
+ echo "$prog: wrong number of arguments"
+ usage
+ clean_and_exit 1
+fi
+
+distfiles=$1
+cddir=$2
+
+if [ "$VERBOSE" = "yes" ]; then
+ echo "Verbose output is on"
+
+ if [ "$DVD" = "yes" ]; then
+ echo "A DVD sized image will be created"
+ else
+ echo "A CD-ROM sized image will be created"
+ fi
+fi
+
+#
+# Make sure all required directories and files exist
+#
+
+if [ ! -d $distfiles ]; then
+ echo "$prog: packages directory \"$distfiles\" does not exist"
+ usage
+ clean_and_exit 1
+else
+ distfiles=`fullpath $distfiles`
+fi
+
+if [ ! -d $cddir ]; then
+ echo "$prog: cd image directory \"$cddir\" does not exist"
+ usage
+ clean_and_exit 1
+else
+ cddir=`fullpath $cddir`
+fi
+
+if [ "$USE_XTRA" = "yes" -a ! -d $extra ]; then
+ echo "$prog: extra directory \"$extra\" specified with -x does not exist"
+ usage
+ clean_and_exit 1
+fi
+
+if [ "$USE_XTRA" = "yes" ]; then
+ extra=`fullpath $extra`
+ XTRA_SIZE=`du -sk $extra | ${AWK} '{print $1 * 1024}'`
+ if [ "$VERBOSE" = "yes" ]; then
+ echo "Extra directory full path name is \"$extra\". It contains $XTRA_SIZE bytes."
+ fi
+else
+ XTRA_SIZE=0
+fi
+
+if [ "$USE_OTHERS" = "yes" -a ! -d $others ]; then
+ echo "$prog: other files directory \"$others\" specified with -X does not exist"
+ usage
+ clean_and_exit 1
+fi
+
+if [ "$USE_OTHERS" = "yes" ]; then
+ others=`fullpath $others`
+ OTHER_SIZE=`du -sk $others | ${AWK} '{print $1 * 1024}'`
+ if [ "$VERBOSE" = "yes" ]; then
+ echo "Other files directory full path name is \"$others\". It contains $OTHER_SIZE bytes."
+ fi
+else
+ OTHER_SIZE=0
+fi
+
+echo " "
+echo "$prog starting: `date`"
+echo " "
+
+find_size() {
+ d=$1
+ if test $# -eq 1 ; then
+ sz=0
+ else
+ sz=$2
+ fi
+ test "$VERBOSE" = "yes" && echo "find_size $d $sz" >/dev/stderr
+
+ szf=0
+ if test -f $d ; then
+ szf=`wc -c $d | ${AWK} '{print $1}'`
+ elif test -d $d ; then
+ for f in $d/* ; do
+ szf=`find_size $f $szf`
+ done
+ else
+ echo "WARNING: I do not know what to do with" >/dev/stderr
+ echo " $d">/dev/stderr
+ echo "which is neither a file nor a directory" >/dev/stderr
+ fi
+
+ tot=`${EXPR} $sz + $szf`
+ test "$VERBOSE" = "yes" && echo " return $tot" >/dev/stderr
+ echo "$tot"
+}
+
+
+ndist=0
+echo "Extracting sizes for the distfiles ..."
+rm -f $sizes
+here="`pwd`"
+cd $distfiles
+for d in *
+do
+ case $d in
+ CVS)
+ echo "Skip CVS directory"
+ ;;
+ *)
+ sz=`find_size $d`
+ echo "$d $sz" >> $sizes
+ ndist=`${EXPR} $ndist + 1`
+ esac
+done
+cd "$here"
+
+echo " "
+echo "Finished extracting sizes for $ndist distfiles"
+echo " "
+
+#
+# sort the distfiles alphabetically
+#
+${SORT} $sizes > $sorted
+
+#
+# Create directories for each image and populate the directories
+# with symlinks that will be resolved when we actually create the
+# ISO image
+#
+if [ "$DVD" = "yes" ]; then
+ what="DVD"
+ space=" "
+ capacity=4300000000
+else
+ what="CD-ROM"
+ space=""
+ capacity=700000000
+fi
+
+new_image() {
+ cdn=`${EXPR} $cdn + 1`
+ dest=$cddir/disk$cdn
+ mkdir -p $dest/distfiles
+ echo "disk$cdn" >> $cdlist
+ cds=${XTRA_SIZE}
+}
+
+cdn=0
+new_image
+cds=`${EXPR} $cds + ${OTHER_SIZE}`
+cat $sorted | while read f s ; do
+ newsize=`${EXPR} $cds + $s`
+
+ # use awk instead of test because we overflow the 32 bit
+ # signed values used by test when we're using a DVD image
+ full=`echo "$newsize $capacity" | \
+ ${AWK} '{if($1 > $2) {print "yes"} else {print "no"}}'`
+ if test "$full" = "no" ; then
+ echo "Add $f to image #$cdn to increase the size to $newsize"
+ cds=$newsize
+ ln -sf $distfiles/$f $dest/distfiles/$f
+ else
+ new_image
+ cds=`${EXPR} $cds + $s`
+ echo "Add $f to new image #$cdn with starting size $s"
+ ln -sf $distfiles/$f $dest/distfiles/$f
+ fi
+done
+
+#
+# Generate a README
+#
+
+cat <<EOF > $readme
+This is @DISKNAME@ of a @NDISKS@-disk ${what} collection
+containing an archive of distfiles used by the NetBSD
+pkgsrc system.
+
+For information on the NetBSD package collection, please visit
+the NetBSD pkgsrc homepage at
+
+ http://www.pkgsrc.org
+
+For more information about the NetBSD project, please visit the
+project's homepage at
+
+ http://www.NetBSD.org
+
+Please do not distribute this ${what} set unless you have verified
+that the individual licenses of all the distfiles allows you to.
+It is anticipated that the primary use of this ${what} set is
+not for distribution, but rather for archiving. Some licenses
+require that if you distribute a binary package that you are willing
+to provide sources on request. By archiving the distfiles, you are
+ensuring that you are able to fulfill such a request.
+
+EOF
+
+
+#
+# cdpack Comment
+#
+cat <<EOF >> $readme
+
+This file, along with the ${what} layout was created using the
+cddist program which is available as part of the cdpack package
+in the NetBSD packages collection at
+
+ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/cdpack/
+
+EOF
+
+#
+# Generate an index file which lists the contents of each CD.
+#
+
+echo "Creating Disk Index File"
+
+show_files() {
+ d="$1"
+ path=
+ if test -d "$d" ; then
+ for fs in $d/* ; do
+ show_files $fs
+ done
+ else
+ ${PRINTF} "%-60s %s\n" $d $cdname >> $indexf
+ fi
+}
+
+numdisks=0
+for cdname in `cat ${cdlist}`
+do
+ if [ "$VERBOSE" = "yes" ]; then
+ echo "Creating index for $cdname"
+ fi
+ cd ${cddir}/${cdname}/distfiles && for d in *
+ do
+ show_files $d
+ done
+ numdisks=`${EXPR} ${numdisks} + 1`
+done
+mv $indexf ${indexf}.tmp
+${SORT} ${indexf}.tmp > $indexf
+
+#
+# Populate the cd's with the index file and readme
+# actually copy these over since the originals will
+# be deleted from their temporary directories
+#
+# Also make symlinks to the stuff in the extra directory
+# specified with the -x flag.
+#
+
+if [ "$VERBOSE" = "yes" ]; then
+ echo "Copying .index file to the image directories."
+fi
+
+ncds=0
+for cdname in `cat $cdlist`
+do
+ if [ -f $indexf ]; then
+ (cd ${cddir}/${cdname} && cp $indexf .index)
+ fi
+
+ if [ "$ADD_README" = "yes" ]; then
+ if [ "$VERBOSE" = "yes" ]; then
+ echo "Copying README.txt file"
+ fi
+ (cd ${cddir}/${cdname} && sed -e "s/@DISKNAME@/$cdname/g" \
+ -e "s/@NDISKS@/${numdisks}/g" \
+ < $readme > README.txt)
+ fi
+
+ if [ $USE_XTRA = "yes" ]; then
+ for f in $extra/*
+ do
+ (cd ${cddir}/${cdname} && ln -sf $f)
+ done
+ fi
+
+ ncds=`${EXPR} $ncds + 1`
+done
+
+
+if [ "$USE_OTHERS" = "yes" ]; then
+ if [ "$VERBOSE" = "yes" ]; then
+ echo "Creating symlinks from $others (specified with -X) to ${cddir}/${cdname}"
+ fi
+ cdname=`tail -1 $cdlist`
+ for f in $others/*
+ do
+ (cd ${cddir}/${cdname} && ln -sf $f)
+ done
+fi
+
+#
+# Create the ISO Images
+#
+volid=DistDisk
+#mkisofs_flags="-f -l -r -J -allow-leading-dots -volset-size $ncds -V $volid "
+mkisofs_flags="-v -v -f -l -r -J -allow-leading-dots "
+
+echo "Creating the ISO images"
+cdn=1
+for cdname in `cat $cdlist`
+do
+ echo "----------- $cdname ----------"
+ #mkisofs_flags2=" -volset-ID $cdname -volset-seqno $cdn "
+ mkisofs_flags2=" -V ${volid}$cdn "
+ echo "( cd ${cddir} && mkisofs $mkisofs_flags $mkisofs_flags2 -o ${cdname}.iso $cdname >> $mkisofslog 2>&1)"
+ ( cd ${cddir} && mkisofs $mkisofs_flags $mkisofs_flags2 -o ${cdname}.iso $cdname >> $mkisofslog 2>&1)
+ if [ $? != 0 ]; then
+ echo "mkisofs failed"
+ clean_and_exit 1
+ fi
+ cdn=`${EXPR} $cdn + 1`
+done
+
+echo "ISO Images are available in $cddir"
+
+if [ -f $warnings ]; then
+ echo "There were warnings generated:"
+ cat $warnings
+fi
+
+cat <<EOF
+
+-----------------------------------------------------------------
+* Please note: This ${what} set may contain files which may ${space}*
+* not be redistributed. Before you distribute this set you *
+* must verify that you will not violate any licenses with this *
+* ${what} set. ${space}*
+-----------------------------------------------------------------
+
+$prog finished: `date`
+
+EOF
+
+clean_and_exit 0
+
diff --git a/pkgtools/cdpack/files/cdpack.1 b/pkgtools/cdpack/files/cdpack.1
index 31599d318f0..e2cae81ecc5 100644
--- a/pkgtools/cdpack/files/cdpack.1
+++ b/pkgtools/cdpack/files/cdpack.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: cdpack.1,v 1.12 2005/08/01 21:47:43 dmcmahill Exp $
+.\" $NetBSD: cdpack.1,v 1.13 2008/01/28 23:06:14 dmcmahill Exp $
.\"
.\" Copyright (c) 2001, 2002, 2003, 2005 Dan McMahill, All rights reserved.
.\"
@@ -178,6 +178,7 @@ with the
option.
.Dl cdpack -x /tmp/foo /usr/pkgsrc/packages/All /u2/cdimages
.Sh SEE ALSO
+.Xr cddist 1
.Xr mkisofs 1
.Sh HISTORY
The