pkgsrc/misc/parchive/patches/patch-ad
fredb 0e8103604d 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.
2003-08-25 20:23:06 +00:00

95 lines
2.1 KiB
Text

$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));
}
/*\