Commit d66b87db authored by Bernhard Link's avatar Bernhard Link

add support for looking into lzma files in changestool

parent 9ffbea75
......@@ -2,6 +2,9 @@
* fix race condition causing external uncompressors sometimes
to catch a sigpipe if their output is closed before they receive
the signal to kill them.
* changestool now supports looking into lzma files
(and bz2 files even when not compiled against libbz2), if
external uncompressors are available.
2009-02-23
* log notifiers get variables REPREPRO_CAUSING_RULE and
......
......@@ -64,6 +64,14 @@ are not found in the directory of the .changes file.
.B \-\-create
Flag for the commands starting with \fBadd\fP to create the \fB.changes\fP
file if it does not yet exists.
.TP
.B \-\-unlzma \fIcommand\fP
External uncompressor used to uncompress lzma files to look
into .diff.lzma, .tar.lzma or .tar.lzma within .debs.
.TP
.B \-\-bunzip2 \fIcommand\fP
External uncompressor used to uncompress bz2 when compiled without
libbz2.
.SH COMMANDS
.TP
.BR verify
......
......@@ -39,6 +39,7 @@
#include "signature.h"
#include "debfile.h"
#include "sourceextraction.h"
#include "uncompression.h"
/* for compatibility with used code */
int verbose=0;
......@@ -2771,10 +2772,14 @@ static retvalue splitpath(struct strlist *list, const char *path) {
}
int main(int argc,char *argv[]) {
static int longoption = 0;
static const struct option longopts[] = {
{"help", no_argument, NULL, 'h'},
{"create", no_argument, NULL, 'C'},
{"searchpath", required_argument, NULL, 's'},
{"gunzip", required_argument, &longoption, 1},
{"bunzip2", required_argument, &longoption, 2},
{"unlzma", required_argument, &longoption, 3},
{NULL, 0, NULL, 0},
};
int c;
......@@ -2784,12 +2789,26 @@ int main(int argc,char *argv[]) {
struct strlist validkeys,keys;
struct strlist searchpath;
struct changes *changesdata IFSTUPIDCC(=NULL);
char *gunzip = NULL, *bunzip2 = NULL, *unlzma = NULL;
retvalue r;
strlist_init(&searchpath);
while( (c = getopt_long(argc,argv,"+hi:s:",longopts,NULL)) != -1 ) {
switch( c ) {
case '\0':
switch( longoption ) {
case 1:
gunzip = strdup(optarg);
break;
case 2:
bunzip2 = strdup(optarg);
break;
case 3:
unlzma = strdup(optarg);
break;
}
break;
case 'h':
about(true);
case 'C':
......@@ -2809,6 +2828,7 @@ int main(int argc,char *argv[]) {
about(false);
}
signature_init(false);
uncompressions_check(gunzip, bunzip2, unlzma);
changesfilename = argv[optind];
if( strcmp(changesfilename,"-") != 0 && !endswith(changesfilename,".changes") ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment