Package: keyanalyze
Version: 0.0.200204-1
Severity: wishlist

Hi,

here's a patch that disables the 2-char prefix subdirectories. I'm
running keyanalyze on a small keyring where the subdirectories are
quite redundant.

Could you apply that patch to the Debian package?

Thanks, Christoph


diff -u keyanalyze-0.0.200204/debian/changelog 
keyanalyze-0.0.200204/debian/changelog
--- keyanalyze-0.0.200204/debian/changelog
+++ keyanalyze-0.0.200204/debian/changelog
@@ -1,3 +1,9 @@
+keyanalyze (0.0.200204-1.1) unstable; urgency=low
+
+  * Option -1 enables flat directory structure (useful for small keyrings).
+
+ -- Christoph Berg <[EMAIL PROTECTED]>  Sat, 14 May 2005 17:57:09 +0200
+
 keyanalyze (0.0.200204-1) unstable; urgency=low
 
   * Initial release (Closes: #238140)
diff -u keyanalyze-0.0.200204/keyanalyze.1 keyanalyze-0.0.200204/keyanalyze.1
--- keyanalyze-0.0.200204/keyanalyze.1
+++ keyanalyze-0.0.200204/keyanalyze.1
@@ -12,7 +12,7 @@
 keyanalyze \- Web of Trust analysis
 
 .SH SYNTAX
-\fBkeyanalyze\fP [ \fB\-i\fP \fIinfile\fP ] [ \fB\-o\fP \fIoutdir\fP ]
+\fBkeyanalyze\fP [ \fB\-i\fP \fIinfile\fP ] [ \fB\-o\fP \fIoutdir\fP ] [ 
\fB\-1\fP ]
 
 .SH DESCRIPTION
 \fIkeyanalyze\fP analyses the web of trust within a group of keys.  It
@@ -28,6 +28,11 @@
 .BI \-o " outdir"
 Put the results in \fIoutdir\fP instead of \fBoutput/\fP.  The directory
 will be created if it does not already exist.
+.TP
+.BI \-1
+Per default, \fBkeyanalyze\fP writes the output into subdirectories named after
+the first two characters of the key ID. This options disables this; useful for
+small keyrings.
 
 .SH AUTHORS
 M. Drew Streib <[EMAIL PROTECTED]>,
diff -u keyanalyze-0.0.200204/keyanalyze.c keyanalyze-0.0.200204/keyanalyze.c
--- keyanalyze-0.0.200204/keyanalyze.c
+++ keyanalyze-0.0.200204/keyanalyze.c
@@ -13,6 +13,7 @@
 /* some configurables */
 static char *infile = "preprocess.keys";
 static char *outdir = "output/";
+static int outsubdirs = 1; /* create output/12/12345678 or output/12345678 */
 #define MAXKEYS        160000 /* MUST be > `grep p preprocess.keys | wc` */
 #define MINSETSIZE     10 /* minimum set size we care about for strong sets */
 #define MAXHOPS                30 /* max hop count we care about for report */
@@ -235,10 +236,11 @@
        /* first the directory */
        buf[0] = '\0';
        strcat(buf, outdir);
-       strncat(buf,idchr,2);
-       mkdir(buf,(mode_t)493);
-
-       strcat(buf,"/");
+       if (outsubdirs) {
+               strncat(buf,idchr,2);
+               mkdir(buf,(mode_t)493);
+               strcat(buf,"/");
+       }
        strcat(buf,idchr);
        return fopen(buf,"w");
 }
@@ -291,7 +293,7 @@
        int outdirlen;
 
        while (1) {
-               int option = getopt(argc, argv, "i:o:");
+               int option = getopt(argc, argv, "i:o:1");
                if (option == -1)
                        break;
                switch (option) {
@@ -308,6 +310,9 @@
                                outdir[outdirlen + 1] = '\0';
                        }
                        break;
+               case '1':
+                       outsubdirs = 0;
+                       break;
                }
        }
 


-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.8-11-amd64-k8
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages keyanalyze depends on:
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an

-- no debconf information

Christoph
-- 
[EMAIL PROTECTED] | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to