pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/parchive Here are a couple of patches I submitted...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7ad1adb62c8d
branches:  trunk
changeset: 460248:7ad1adb62c8d
user:      fredb <fredb%pkgsrc.org@localhost>
date:      Mon Aug 25 20:23:06 2003 +0000

description:
Here are a couple of patches I submitted to the Sourceforge project
in June of this year, but for which I got no response.

1) Sourceforge PR #72673: Get the program name for the usage statement
   in the most portable fashion possible, using argv.

2) Sourceforge PR #762825, which is a rework of PR #504855, by Adam
   Lewandowski. Add a "table of contents" command, included a "+v"
   option to dump absolutely all of the information in the par file.

Bump ${PKGREVISION}.

I think it's safe to say that this is the final release. The current
"par2", for version 2 parity files, is now backwards compatible with
the version 1 parity files that this program generates. It does not,
however, seem to have the cool "table of contents" feature.

diffstat:

 misc/parchive/Makefile         |   3 +-
 misc/parchive/distinfo         |   8 ++-
 misc/parchive/patches/patch-aa |  16 +++---
 misc/parchive/patches/patch-ab |  67 ++++++++++++++++++++++-------
 misc/parchive/patches/patch-ac |  12 +++++
 misc/parchive/patches/patch-ad |  95 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 174 insertions(+), 27 deletions(-)

diffs (270 lines):

diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/Makefile
--- a/misc/parchive/Makefile    Mon Aug 25 19:35:28 2003 +0000
+++ b/misc/parchive/Makefile    Mon Aug 25 20:23:06 2003 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.4 2003/07/21 17:01:25 martti Exp $
+# $NetBSD: Makefile,v 1.5 2003/08/25 20:23:06 fredb Exp $
 #
 
 DISTNAME=      par-v1.1
 PKGNAME=       parchive-1.1
+PKGREVISION=   1
 WRKSRC=                ${WRKDIR}/par-cmdline
 CATEGORIES=    misc archivers
 MASTER_SITES=  http://telia.dl.sourceforge.net/parchive/
diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/distinfo
--- a/misc/parchive/distinfo    Mon Aug 25 19:35:28 2003 +0000
+++ b/misc/parchive/distinfo    Mon Aug 25 20:23:06 2003 +0000
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.2 2002/01/04 21:40:58 fredb Exp $
+$NetBSD: distinfo,v 1.3 2003/08/25 20:23:07 fredb Exp $
 
 SHA1 (par-v1.1.tar.gz) = acba4cdfb8a89b1542cd9ba6494d0d3461e609a1
 Size (par-v1.1.tar.gz) = 40959 bytes
-SHA1 (patch-aa) = 847b137de8cc0ff250d1e0346fcc80fa67021135
-SHA1 (patch-ab) = fb1b68cc6e3ae4186f78d229bb237d7a62c6bff6
+SHA1 (patch-aa) = ca6ac3dfc740e02b1831b47852616e90e331b8ac
+SHA1 (patch-ab) = a6ee18373febeaf9cf1dbda0cd0ca76b383788c0
+SHA1 (patch-ac) = ec4675bbfa9a0808e665d7aa2c22c3f96ae43ea1
+SHA1 (patch-ad) = 6d8738eabb517a59f4057bcf2d385d25f39c20e2
diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/patches/patch-aa
--- a/misc/parchive/patches/patch-aa    Mon Aug 25 19:35:28 2003 +0000
+++ b/misc/parchive/patches/patch-aa    Mon Aug 25 20:23:06 2003 +0000
@@ -1,15 +1,17 @@
-$NetBSD: patch-aa,v 1.2 2002/01/04 21:40:59 fredb Exp $
+$NetBSD: patch-aa,v 1.3 2003/08/25 20:23:08 fredb Exp $
 
 --- Makefile.orig      Sat Nov 17 10:39:52 2001
 +++ Makefile
-@@ -1,8 +1,8 @@
+@@ -1,8 +1,10 @@
+ 
+ CFLAGS=-g -W -Wall -Wno-unused -O2
  
--CFLAGS=-g -W -Wall -Wno-unused -O2
-+CFLAGS=-g -W -Wall -Wno-unused -O2 -DKNOW_NAME
- 
- par: backend.o checkpar.o makepar.o rwpar.o rs.o md5.o fileops.o main.o readoldpar.o interface.o ui_text.o
+-par: backend.o checkpar.o makepar.o rwpar.o rs.o md5.o fileops.o main.o readoldpar.o interface.o ui_text.o
 -      $(CC) -o $@ $^
-+      $(CC) -o ${.TARGET} ${.ALLSRC}
++ALLSRCS= backend.o checkpar.o makepar.o rwpar.o rs.o md5.o fileops.o main.o readoldpar.o interface.o ui_text.o
++
++par: ${ALLSRCS}
++      $(CC) -o $@ ${ALLSRCS}
  
  clean:
        rm -f core par par.exe *.o
diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/patches/patch-ab
--- a/misc/parchive/patches/patch-ab    Mon Aug 25 19:35:28 2003 +0000
+++ b/misc/parchive/patches/patch-ab    Mon Aug 25 20:23:06 2003 +0000
@@ -1,17 +1,17 @@
-$NetBSD: patch-ab,v 1.1 2002/01/04 21:40:59 fredb Exp $
+$NetBSD: patch-ab,v 1.2 2003/08/25 20:23:08 fredb Exp $
 
 --- main.c.orig        Sat Nov 17 13:29:48 2001
 +++ main.c
-@@ -28,14 +28,20 @@
- int
- usage(void)
+@@ -21,6 +21,7 @@
+ #include "interface.h"
+ 
+ struct cmdline cmd;
++char* progname;
+ 
+ /*\
+ |*| Print usage
+@@ -30,12 +31,13 @@ usage(void)
  {
-+#ifdef KNOW_NAME
-+      extern char *__progname;
-+#else
-+      char progname[] = "par";
-+#endif
-+
        printf(
  "Usage:\n"
 -"   par c(heck)   [options] <par file>         : Check parity archive\n"
@@ -20,6 +20,7 @@
 +"   %s c(heck)   [options] <par file>         : Check parity archive\n"
 +"   %s r(ecover) [options] <par file>         : Restore missing volumes\n"
 +"   %s a(dd)     [options] <par file> [files] : Add files to parity archive\n"
++"   %s t(able)   [options] <par file>         : List contents of parity archive\n"
  " Advanced:\n"
 -"   par m(ix)     [options] : Try to restore from all parity files at once\n"
 -"   par i(nteractive) [<par files>] : Interactive mode (very bare-bones)\n"
@@ -28,18 +29,52 @@
  "\n"
  "Options: (Can be turned off with '+')\n"
  "    -m   : Move existing files out of the way\n"
-@@ -52,8 +58,12 @@
+@@ -52,8 +54,8 @@ usage(void)
  "    -v,+v: Increase or decrease verbosity\n"
  "    -h,-?: Display this help\n"
  "    --   : Always treat following arguments as files\n"
 -"\n"
 -      );
 +"\n",
-+#ifdef KNOW_NAME
-+      __progname, __progname, __progname, __progname, __progname);
-+#else
-+      progname, progname, progname, progname, progname);
-+#endif
++      progname, progname, progname, progname, progname, progname);
        return 0;
  }
  
+@@ -97,6 +99,8 @@ main(int argc, char *argv[])
+       if (check_sizes())
+               return -1;
+ 
++      progname = argv[0];
++
+       /*\ Some defaults \*/
+       memset(&cmd, 0, sizeof(cmd));
+       cmd.volumes = 10;
+@@ -207,6 +211,10 @@ main(int argc, char *argv[])
+                       case 'I':
+                               cmd.action = ACTION_TEXT_UI;
+                               break;
++                      case 't':
++                      case 'T':
++                              cmd.action = ACTION_CONTENTS;
++                              break;
+                       default:
+                               fprintf(stderr, "Unknown command: '%s'\n",
+                                               argv[1]);
+@@ -244,6 +252,17 @@ main(int argc, char *argv[])
+                       break;
+               case ACTION_TEXT_UI:
+                       par_load(unist(argv[1]));
++                      break;
++              case ACTION_CONTENTS:
++                      fprintf(stderr, "Reading %s\n", argv[1]);
++                      par = read_par_header(unist(argv[1]), 0, 0, 0);
++                      if (!par) {
++                              fail = 2;
++                              continue;
++                      }
++                      dump_par(par);
++                      free_par(par);
++                      par=0;
+                       break;
+               }
+       }
diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/parchive/patches/patch-ac    Mon Aug 25 20:23:06 2003 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ac,v 1.1 2003/08/25 20:23:08 fredb Exp $
+
+--- par.h.orig Sat Nov 17 14:08:19 2001
++++ par.h
+@@ -82,6 +82,7 @@ extern struct cmdline {
+ #define ACTION_ADD    11      /*\ Create a PAR archive ... \*/
+ #define ACTION_ADDING 12      /*\ ... and add files to it. \*/
+ #define ACTION_TEXT_UI        20      /*\ Interactive text interface \*/
++#define ACTION_CONTENTS       21      /*\ List contents of PAR file \*/
+ 
+ #define PAR_MAGIC (*((i64 *)"PAR\0\0\0\0\0"))
+ #define IS_PAR(x) (((x).magic) == PAR_MAGIC)
diff -r f3bb1f79c058 -r 7ad1adb62c8d misc/parchive/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/parchive/patches/patch-ad    Mon Aug 25 20:23:06 2003 +0000
@@ -0,0 +1,95 @@
+$NetBSD: patch-ad,v 1.1 2003/08/25 20:23:08 fredb Exp $
+
+--- rwpar.c.orig       Sat Nov 17 14:20:09 2001
++++ rwpar.c
+@@ -165,6 +165,9 @@ static void
+ dump_file(pfile_t *file)
+ {
+       fprintf(stderr,
++              "    filename: %s\n",
++              stuni(file->filename));
++      fprintf(stderr,
+               "    status: 0x%llx\n"
+               "    file size: %lld\n"
+               "    hash: %s\n",
+@@ -172,11 +175,8 @@ dump_file(pfile_t *file)
+               file->file_size,
+               stmd5(file->hash));
+       fprintf(stderr,
+-              "    16k hash: %s\n",
+-              stmd5(file->hash_16k));
+-      fprintf(stderr,
+-              "    filename: %s\n",
+-              stuni(file->filename));
++              "    16k hash: %s\n\n",
++                      stmd5(file->hash_16k));
+ }
+ 
+ void
+@@ -184,38 +184,43 @@ dump_par(par_t *par)
+ {
+       pfile_t *p;
+ 
+-      fprintf(stderr,  "PAR file dump:\n"
+-              "  filename: %s\n"
+-              "  version: 0x%04x\n"
+-              "  client: 0x%04x\n"
+-              "  control hash: %s\n",
++      fprintf(stderr,  "\nPAR file dump:\n\n"
++              "    filename: %s\n"
++              "    version: 0x%04x\n"
++              "    client: 0x%04x\n"
++              "    control hash: %s\n"
++              "    set hash: %s\n"
++              "    volume number: %lld\n"
++              "    number of files: %lld\n",
+               stuni(par->filename),
+               par->version,
+               par->client,
+-              stmd5(par->control_hash));
+-      fprintf(stderr,
+-              "  set hash: %s\n",
+-              stmd5(par->set_hash));
+-      fprintf(stderr,
+-              "  volume number: %lld\n"
+-              "  number of files: %lld\n"
+-              "  file list: 0x%llx\n"
+-              "  file list size: 0x%llx\n"
+-              "  data: 0x%llx\n"
+-              "  data size: 0x%llx\n",
++              stmd5(par->control_hash),
++              stmd5(par->set_hash),
+               par->vol_number,
+-              par->num_files,
+-              par->file_list,
+-              par->file_list_size,
+-              par->data,
+-              par->data_size);
++              par->num_files);
++      if (cmd.loglevel > 0)
++              fprintf(stderr,
++                      "    file list: 0x%llx\n"
++                      "    file list size: 0x%llx\n"
++                      "    data: 0x%llx\n"
++                      "    data size: 0x%llx\n",
++                      par->file_list,
++                      par->file_list_size,
++                      par->data,
++                      par->data_size);
+       if (!par->vol_number)
+               fprintf(stderr,
+-                      "  comment: %s\n",
++                      "    comment: %s\n",
+                       stuni(par->comment));
+       fprintf(stderr, "\nFiles:\n\n");
+       for (p = par->files; p; p = p->next)
+-              dump_file(p);
++              if (cmd.loglevel > 0)
++                      dump_file(p);
++              else
++                      fprintf(stderr,
++                              "    %s\n",
++                              stuni(p->filename));
+ }
+ 
+ /*\



Home | Main Index | Thread Index | Old Index