diff options
author | dmcmahill <dmcmahill> | 2003-02-05 15:01:57 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill> | 2003-02-05 15:01:57 +0000 |
commit | 0499e6a1a6d1ea96efc0c1641cbde1cfa887f10b (patch) | |
tree | ce164e2593d16e7fc203cf06d05d28c110b805f3 /pkgtools | |
parent | be5779a7af7c81a2f74f147694fce7c05a87df57 (diff) | |
download | pkgsrc-0499e6a1a6d1ea96efc0c1641cbde1cfa887f10b.tar.gz |
update to cdpack-1.5. The primary change is the addition of a '-dvd' option
which creates DVD sized images instead of the default CD-ROM sized images.
Prompted by the current size of an i386 CD-ROM set (7) and the suggestion
by David Brownlee that we create DVD images.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/cdpack/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/cdpack/files/cdgen.awk | 36 | ||||
-rw-r--r-- | pkgtools/cdpack/files/cdpack.1 | 59 | ||||
-rwxr-xr-x | pkgtools/cdpack/files/cdpack.sh | 92 |
4 files changed, 121 insertions, 70 deletions
diff --git a/pkgtools/cdpack/Makefile b/pkgtools/cdpack/Makefile index dc6cf97526a..94aad2af81d 100644 --- a/pkgtools/cdpack/Makefile +++ b/pkgtools/cdpack/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.9 2002/09/18 02:42:20 dmcmahill Exp $ +# $NetBSD: Makefile,v 1.10 2003/02/05 15:01:57 dmcmahill Exp $ # -DISTNAME= cdpack-1.4.2 +DISTNAME= cdpack-1.5 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/cdpack/files/cdgen.awk b/pkgtools/cdpack/files/cdgen.awk index 97c528d7dcb..75ea3e4ee72 100755 --- a/pkgtools/cdpack/files/cdgen.awk +++ b/pkgtools/cdpack/files/cdgen.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk -f -# $NetBSD: cdgen.awk,v 1.3 2002/05/19 07:59:46 dmcmahill Exp $ +# $NetBSD: cdgen.awk,v 1.4 2003/02/05 15:01:57 dmcmahill Exp $ # -# Copyright (c) 2001 Dan McMahill, All rights reserved. +# Copyright (c) 2001, 2002, 2003 Dan McMahill, All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,8 +44,9 @@ BEGIN { # ARGV[8] = verbose flag. "verbose=yes" for verbose output # ARGV[9] = xtra_size. How many kB are needed per CD for common files - if (ARGC != 11){ - printf("%s: wrong number of arguments\n",ARGV[0]); + reqnum = 12; + if (ARGC != reqnum){ + printf("cdgen.awk: wrong number of arguments (got %d, wanted %d)\n", ARGC, reqnum); usage(); exit(1); } @@ -57,8 +58,8 @@ BEGIN { exclude = ARGV[4]; order = ARGV[5]; cdlist = ARGV[6]; - xtra_size= ARGV[9]; - other_size= ARGV[10]; + xtra_size= ARGV[10]; + other_size= ARGV[11]; if (ARGV[7] ~ "dup=yes"){ dup=1; @@ -69,8 +70,11 @@ BEGIN { if (ARGV[8] ~ "verbose=yes"){ verbose=1; } + if (ARGV[9] ~ "dvd=yes"){ + dvd=1; + } else{ - verbose=0; + dvd=0; } # @@ -130,7 +134,7 @@ BEGIN { } close(order); npkgs = n-1; - printf("%d packages to go on CD-ROM!\n",npkgs); + printf("%d packages to go on CD-ROM/DVD!\n",npkgs); # # Read in the list of excluded packages @@ -187,11 +191,15 @@ BEGIN { # to the second, etc. This way, we never have to reinsert a CD # while installing pkgs. # - printf("Figuring out which packages go on each CD\n"); + printf("Figuring out which packages go on each CD/DVD\n"); # maximum kB for binary pkgs per CD. - maxcd=1024*620; + if( dvd ) + maxcd = 1024 * 4300; + else + maxcd = 1024 * 620; + if( verbose ) printf("Maximum image size = %g Mb\n", maxcd/1024); # # no package duplication # @@ -356,7 +364,7 @@ BEGIN { for (cdn=1; cdn<=ncd; cdn=cdn+1){ tot_cdpkgs = tot_cdpkgs + cdpkgs[cdn]; } - printf("CD images with package duplication resulted in %d packages total\n",tot_cdpkgs); + printf("CD/DVD images with package duplication resulted in %d packages total\n",tot_cdpkgs); printf("This is an increase of %d over the base %d packages\n",tot_cdpkgs-(npkgs-tot_ex),npkgs-tot_ex); } @@ -365,10 +373,10 @@ BEGIN { # Next, create a subdirectory for each CD and populate the directory # with links to the actual binary pkgs # - printf("Creating subdirectories for each CD and populating it with links\n"); + printf("Creating subdirectories for each CD/DVD and populating it with links\n"); printf("to the binary packages and other required files.\n"); for (cdn=1; cdn<=ncd; cdn=cdn+1){ - printf("----------- CD #%d ----------\n",cdn); + printf("----------- CD/DVD #%d ----------\n",cdn); printf(" %3d binary packages\n",cdpkgs[cdn]); outdir=cddir "/cd" cdn "/packages/All"; cmd="test -d " outdir; @@ -404,7 +412,7 @@ BEGIN { printf("\n"); exit 0 - } + } # BEGIN function getsize(name,cmd,sz){ diff --git a/pkgtools/cdpack/files/cdpack.1 b/pkgtools/cdpack/files/cdpack.1 index 0c5ac6674b9..dc7c1295d19 100644 --- a/pkgtools/cdpack/files/cdpack.1 +++ b/pkgtools/cdpack/files/cdpack.1 @@ -1,6 +1,6 @@ -.\" $NetBSD: cdpack.1,v 1.9 2002/09/18 02:42:20 dmcmahill Exp $ +.\" $NetBSD: cdpack.1,v 1.10 2003/02/05 15:01:57 dmcmahill Exp $ .\" -.\" Copyright (c) 2001 Dan McMahill, All rights reserved. +.\" Copyright (c) 2001, 2002, 2003 Dan McMahill, All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -34,11 +34,13 @@ .Os .Sh NAME .Nm cdpack -.Nd produce multi-CD binary package images +.Nd produce multi-CD/DVD binary package images .Sh SYNOPSIS .Nm "" .Op -ac | -ec .Op -af | -ef +.Op -dvd +.Op -h | --help .Op -l logfile .Op -dnRvV .Op -x common_directory @@ -49,7 +51,7 @@ The .Nm utility produces ISO 9660 image files for -a multiple CD-ROM collection of binary packages. +a multiple CD/DVD collection of binary packages. .Pp The .Nm @@ -57,58 +59,63 @@ utility extracts the dependency information from the binary packages in the directory .Ar packages_directory specified on the command line. The dependency information is -used to determine which packages are placed on which CD. The +used to determine which packages are placed on which CD/DVD. 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 will be left in the root -directory of each CD image. +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 ac -Include binary packages marked as NO_BIN_ON_CDROM on the CD set. +Include binary packages marked as NO_BIN_ON_CDROM on the CD/DVD set. The default is to omit any packages which were marked as NO_BIN_ON_CDROM. This option should -only be used when making a CD set for personal use and not for +only be used when making a CD/DVD set for personal use and not for distribution unless you are sure you have not violated any licenses. .It Fl af -Include binary packages marked as NO_BIN_ON_FTP on the CD set. +Include binary packages marked as NO_BIN_ON_FTP on the CD/DVD set. This option is enabled by default. .It Fl d Enable debugging by not deleting temporary files at the end of the run. These files are left in TMPDIR. .It Fl ec -Exclude packages marked as NO_BIN_ON_CDROM from the CD set. This is +Exclude packages marked as NO_BIN_ON_CDROM from the CD/DVD set. This is the default. .It Fl ef -Exclude packages marked as NO_BIN_ON_FTP from the CD set. The default +Exclude packages marked as NO_BIN_ON_FTP from the CD/DVD set. The default is to allow packages which are NO_BIN_ON_FTP. +.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 n -Do not duplicate packages in order to prevent inter-CD dependencies. +Do not duplicate packages in order to prevent inter-CD/DVD dependencies. The default without the .Fl n option will place a package and all of its dependencies on the same -CD. If a particular package is also required by pacakges on other -CD's, it will be placed there as well. +CD/DVD. If a particular package is also required by pacakges on other +CD/DVD's, it will be placed there as well. When the .Fl n option is used packages are not duplicated. This results in slightly smaller ISO 9660 images. .Nm places packages which are lower in the dependency tree on lower -numbered CD-ROM's and packages which are higher on the higher numbered -CD-ROM's. In this fashion, a package on CD number n -will have all of its dependencies on CD numbers 1 through n +numbered CD/DVD's and packages which are higher on the higher numbered +CD/DVD's. In this fashion, a package on CD/DVD number n +will have all of its dependencies on CD/DVD numbers 1 through n .It Fl R Generate a file, .Ar README.txt , -which will be placed in the root directory of each CD image. This +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 set. +of the CD/DVD set. .It Fl v Be verbose. Currently does not change things much. .It Fl V @@ -116,14 +123,14 @@ Print the program version number and exit. .It Fl x Ar directory Includes the contents of .Ar directory -on each CD. This is useful for README files, etc., which you want -to be present on each CD in the set. +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 in the set. This is useful for adding +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. +need to be on each CD/DVD. .El .Pp The @@ -145,7 +152,7 @@ This example takes all of the binary packages found in /u2/cdimages/cd{1,2,...} are used to create the ISO 9660 layouts. .D1 cdpack /usr/pkgsrc/packages/All /u2/cdimages .Pp -To include a common set of files on all CD's, place them in a +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 @@ -163,5 +170,5 @@ packages collection in April, 2001. The .Nm utility was written by Dan McMahill (dmcmahill@netbsd.org). The -idea of duplicating packages to eliminate inter-CD dependencies +idea of duplicating packages to eliminate inter-CD/DVD dependencies came from Todd Vierling (tv@netbsd.org). diff --git a/pkgtools/cdpack/files/cdpack.sh b/pkgtools/cdpack/files/cdpack.sh index 94a4dd96de1..ebdc5de7e1d 100755 --- a/pkgtools/cdpack/files/cdpack.sh +++ b/pkgtools/cdpack/files/cdpack.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $NetBSD: cdpack.sh,v 1.7 2002/09/18 02:42:20 dmcmahill Exp $ +# $NetBSD: cdpack.sh,v 1.8 2003/02/05 15:01:57 dmcmahill Exp $ # -# Copyright (c) 2001, 2002 Dan McMahill, All rights reserved. +# Copyright (c) 2001, 2002, 2003 Dan McMahill, All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -57,10 +57,13 @@ mkdir $TMP touch $exclude usage(){ + echo " " echo "$prog - generates ISO9660 images for a multi-cd binary package collection" - echo "Usage: $prog [-ac | -ec] [-af | -ef] [-l logfile] [-dnRvV] [-x dir] [-X dir] packages_directory cdimage_directory" + echo "Usage: $prog [-ac | -ec] [-af | -ef] [-dvd] [-h|--help] [-l logfile] [-dnRvV] " + echo " [-x dir] [-X dir] packages_directory cdimage_directory" echo "Example: $prog /usr/pkgsrc/packages/netbsd-1.5/alpha/All /images/netbsd-1.5/alpha" echo "Please refer to the manual page for complete documentation." + echo " " } clean_and_exit(){ @@ -97,6 +100,7 @@ mkisofslog=/dev/null ALLOW_NO_BIN_ON_CDROM=no ALLOW_NO_BIN_ON_FTP=yes +DVD=no while test -n "$1" @@ -118,6 +122,11 @@ do shift ;; + # make a DVD sized image + -dvd) DVD=yes + shift + ;; + # exclude NO_BIN_ON_CDROM packages -ec) ALLOW_NO_BIN_ON_CDROM=no shift @@ -128,6 +137,10 @@ do shift ;; + # help + -h|--help) usage + exit 0 + ;; # log file for the output of mkisofs -v -v -l) mkisofslog=$2 shift 2 @@ -193,18 +206,26 @@ fi packages=$1 cddir=$2 -if [ $VERBOSE = "yes" ]; then +if [ "$VERBOSE" = "yes" ]; then echo "Verbose output is on" + if [ "$ALLOW_NO_BIN_ON_CDROM" = "yes" ]; then echo "NO_BIN_ON_CDROM Packages will be included in the images" else echo "NO_BIN_ON_CDROM Packages will be excluded in the images" fi + if [ "$ALLOW_NO_BIN_ON_FTP" = "yes" ]; then echo "NO_BIN_ON_FTP Packages will be included in the images" else echo "NO_BIN_ON_FTP Packages will be excluded in the images" fi + + if [ "$DVD" = "yes" ]; then + echo "A DVD sized image will be created" + else + echo "A CD-ROM sized image will be created" + fi fi # @@ -378,9 +399,9 @@ tsort $deptree > $order # cdlist = ARGV[6]; # if [ "$VERBOSE" = "yes" ]; then - echo "awk -f @prefix@/libexec/cdgen.awk $packages $cddir $deptree $exclude $order $cdlist dup=$DUP verbose=$VERBOSE $XTRA_SIZE $OTHER_SIZE" + echo "awk -f @prefix@/libexec/cdgen.awk $packages $cddir $deptree $exclude $order $cdlist dup=$DUP verbose=$VERBOSE dvd=$DVD $XTRA_SIZE $OTHER_SIZE" fi -awk -f @prefix@/libexec/cdgen.awk $packages $cddir $deptree $exclude $order $cdlist dup=$DUP verbose=$VERBOSE $XTRA_SIZE $OTHER_SIZE +awk -f @prefix@/libexec/cdgen.awk $packages $cddir $deptree $exclude $order $cdlist dup=$DUP verbose=$VERBOSE dvd=$DVD $XTRA_SIZE $OTHER_SIZE if [ $? -ne 0 ]; then echo "$prog: ERROR: cdgen.awk has failed" @@ -390,8 +411,14 @@ fi # # Generate a README # +if [ "$DVD" = "yes" ]; then + what="DVD" +else + what="CD-ROM" +fi + cat <<EOF > $readme -This CD-ROM collection contains NetBSD binary packages. For +This $what collection contains NetBSD binary packages. For information on the NetBSD package collection, please visit http://www.netbsd.org/Documentation/software/packages.html. @@ -402,19 +429,19 @@ EOF if [ "$DUP" = "yes" ]; then cat <<EOF >> $readme -The packages on this CD have been arranged to eliminate all -inter-CD dependencies. In other words, each package on this -CD should have all of its dependencies (if they are allowed -to be provided on CD) present on the same CD. +The packages on this $what have been arranged to eliminate all +inter-$what dependencies. In other words, each package on this +$what should have all of its dependencies (if they are allowed +to be provided on $what) present on the same $what. EOF else cat <<EOF >> $readme -The packages on this CD have been arranged such that for a -given package on CD number n, all of the other required -packages are on CD number 1 through n. This allows the -user to make a single pass through the CD set when installing +The packages on this $what have been arranged such that for a +given package on $what number n, all of the other required +packages are on $what number 1 through n. This allows the +user to make a single pass through the $what set when installing a collection of packages. EOF @@ -431,10 +458,10 @@ this cd collection. EOF else cat <<EOF >> $readme -This CD collection includes packaged with NO_BIN_ON_CDROM set. -Please do not violate license agreements by selling this CD +This $what collection includes packaged with NO_BIN_ON_CDROM set. +Please do not violate license agreements by selling this $what without verifying that you are allowed to. A list of these -packages may be found in the ".restricted" file on this CD. +packages may be found in the ".restricted" file on this $what. EOF fi @@ -449,11 +476,11 @@ this cd collection. EOF else cat <<EOF >> $readme -This CD collection includes packages with NO_BIN_ON_FTP set. +This $what collection includes packages with NO_BIN_ON_FTP set. Please do not violate license agreements by placing this image on a public FTP site without verifying that you are allowed to. A list of these packages may be found in the - ".restricted" file on this CD. + ".restricted" file on this $what. EOF fi @@ -462,7 +489,7 @@ fi # cat <<EOF >> $readme -This README, along with the CD layout was created using the +This README, along with the $what layout was created using the cdpack program which is available as part of the NetBSD packages collection at ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/pkgtools/cdpack @@ -482,7 +509,7 @@ do # cdgen shouldn't have included any restricted pkgs, but # make 100% sure now! # - if [ $VERBOSE = "yes" ]; then + if [ "$VERBOSE" = "yes" ]; then echo "Removing any leftover restricted packages from $cdname" fi for pkg in `cat $exclude` @@ -490,7 +517,7 @@ do rm -f ${cddir}/${cdname}/packages/*/$pkg done - if [ $VERBOSE = "yes" ]; then + if [ "$VERBOSE" = "yes" ]; then echo "Creating index for $cdname" fi for pkg in ${cddir}/${cdname}/packages/All/* @@ -510,16 +537,25 @@ sort ${indexf}.tmp > $indexf # specified with the -x flag. # -if [ $VERBOSE = "yes" ]; then +if [ "$VERBOSE" = "yes" ]; then echo "Copying .index and .restricted files to the image directories." fi ncds=0 for cdname in `cat $cdlist` do - (cd ${cddir}/${cdname} && cp $indexf .index ; cp $restricted .restricted) + if [ -f $indexf ]; then + (cd ${cddir}/${cdname} && cp $indexf .index ) + fi - if [ $ADD_README = "yes" ]; then + if [ -f $indexf ]; then + (cd ${cddir}/${cdname} && cp $restricted .restricted ) + fi + + if [ "$ADD_README" = "yes" ]; then + if [ "$VERBOSE" = "yes" ]; then + echo "Copying README.txt file" + fi (cd ${cddir}/${cdname} && cp $readme README.txt) fi @@ -534,8 +570,8 @@ do done -if [ $USE_OTHERS = "yes" ]; then - if [ $VERBOSE = "yes" ]; then +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` |