diff options
author | danfe <danfe@FreeBSD.org> | 2006-11-03 05:31:07 +0000 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2006-11-03 05:31:07 +0000 |
commit | 528496352e88c4a9cc6fd91c51dd753bd03965cb (patch) | |
tree | ece08db851c64f1173c39939ff2cffdb1fa06ca8 /archivers | |
parent | 3b80c080b81d69e4ceb1f8eb94ea418c65ff5108 (diff) | |
download | FreeBSD-ports-528496352e88c4a9cc6fd91c51dd753bd03965cb.zip FreeBSD-ports-528496352e88c4a9cc6fd91c51dd753bd03965cb.tar.gz |
Add a patch to allow to list pak-file contents without extracting it.
Diffstat (limited to 'archivers')
-rw-r--r-- | archivers/nwreckdum/Makefile | 1 | ||||
-rw-r--r-- | archivers/nwreckdum/files/patch-nwreckdu.c | 90 |
2 files changed, 91 insertions, 0 deletions
diff --git a/archivers/nwreckdum/Makefile b/archivers/nwreckdum/Makefile index 9402d48..36b0652 100644 --- a/archivers/nwreckdum/Makefile +++ b/archivers/nwreckdum/Makefile @@ -7,6 +7,7 @@ PORTNAME= nwreckdum PORTVERSION= 0.0.6 +PORTREVISION= 1 CATEGORIES= archivers games MASTER_SITES= http://freebsd.nsu.ru/distfiles/ diff --git a/archivers/nwreckdum/files/patch-nwreckdu.c b/archivers/nwreckdum/files/patch-nwreckdu.c new file mode 100644 index 0000000..81ac5d5 --- /dev/null +++ b/archivers/nwreckdum/files/patch-nwreckdu.c @@ -0,0 +1,90 @@ +--- nwreckdu.c.orig Mon Jun 8 17:47:02 1998 ++++ nwreckdu.c Fri Nov 3 02:30:05 2006 +@@ -27,7 +27,7 @@ + } dirrec; + + int asmpak(FILE *); +-int extrpak(FILE *); ++int extrpak(FILE *, int); + int write_rec(dirrec, FILE *); + int makepath(char *); + +@@ -37,6 +37,7 @@ + "\n" + " -c, --create create PACK instead of extracting\n" + " -d, --dir=DIR use DIR as the input/output directory\n" ++" -l, --list list files stored in PACK\n" + " -h, --help display this help\n" + " -p, --pak=FILE read FILE for PACK information\n" + "\n" +@@ -47,7 +48,7 @@ + + int main(int argc, char **argv) { + FILE *pakhand = NULL; +- int makepak = 0; ++ int makepak = 0, listpak = 0; + char *pakfile = NULL, *outdir = NULL; + const char defpakfile[] = "pak0.pak", + defoutdir[] = "pak0"; +@@ -55,6 +56,7 @@ + { 'p', "pak", OPT_STRING, &pakfile, 0 }, + { 'd', "dir", OPT_STRING, &outdir, 0 }, + { 'c', "create", OPT_FLAG, &makepak, 0 }, ++ { 'l', "list", OPT_FLAG, &listpak, 0 }, + { 'h', "help", OPT_FLAG, usage, OPT_CALLFUNC }, + { 0, NULL, OPT_END, 0, 0 } + }; +@@ -66,8 +68,9 @@ + outdir = (char *)defoutdir; + + printf("Using pak file: %s\n", pakfile); +- printf("Input/output directory: %s\n", outdir); +- printf("Operation: %s\n", (makepak?"create":"extract")); ++ if (!listpak) ++ printf("Input/output directory: %s\n", outdir); ++ printf("Operation: %s\n", (makepak?"create":listpak?"list":"extract")); + + if (makepak) + pakhand = fopen(pakfile, "wb"); +@@ -79,6 +82,8 @@ + return(-1); + } + ++ if (!listpak) { ++ + if (!makepak && (mkdir(outdir, 493 /*octal=755*/) == -1)) { + printf("Error making %s: %s\n", outdir, strerror(errno)); + fclose(pakhand); +@@ -89,12 +94,12 @@ + strerror(errno)); + fclose(pakhand); + return(-1); +- } ++ } } + + if (makepak) + asmpak(pakhand); + else +- extrpak(pakhand); ++ extrpak(pakhand, listpak); + + fclose(pakhand); + return(0); +@@ -209,7 +214,7 @@ + return(1); + } + +-int extrpak(FILE *in) { ++int extrpak(FILE *in, int listpak) { + dirrec *dir = NULL; + char signature[4]; + unsigned long dir_start = 0, num_ents = 0; +@@ -244,6 +249,8 @@ + for (i = 0; i < num_ents; i++) { + printf("%3i %8lu %s\n", i, dir[i].length, + dir[i].name); ++ if (listpak) ++ continue; + if (write_rec(dir[i], in)) + printf("Error writing record: %s\n", + strerror(errno)); |