New option 'list' produces output that can be used for the packages .list file.

Will be used be bb dpkg
1_00_stable_10817
Glenn L McGrath 2001-02-12 11:16:26 +00:00
parent bc9afadecd
commit 821fbf0f42
2 changed files with 26 additions and 10 deletions

View File

@ -42,11 +42,12 @@ extern int tar_unzip_init(int tarFd);
extern int readTarFile(int tarFd, int extractFlag, int listFlag, extern int readTarFile(int tarFd, int extractFlag, int listFlag,
int tostdoutFlag, int verboseFlag, char** extractList, char** excludeList); int tostdoutFlag, int verboseFlag, char** extractList, char** excludeList);
const int dpkg_deb_contents = 1; static const int dpkg_deb_contents = 1;
const int dpkg_deb_control = 2; static const int dpkg_deb_control = 2;
// const int dpkg_deb_info = 4; // const int dpkg_deb_info = 4;
const int dpkg_deb_extract = 8; static const int dpkg_deb_extract = 8;
const int dpkg_deb_verbose_extract = 16; static const int dpkg_deb_verbose_extract = 16;
static const int dpkg_deb_list = 32;
extern int deb_extract(int optflags, const char *dir_name, const char *deb_filename) extern int deb_extract(int optflags, const char *dir_name, const char *deb_filename)
{ {
@ -65,6 +66,10 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
verbose_flag = TRUE; verbose_flag = TRUE;
list_flag = TRUE; list_flag = TRUE;
} }
if (dpkg_deb_list == (dpkg_deb_list & optflags)) {
strcpy(ar_filename, "data.tar.gz");
list_flag = TRUE;
}
if (dpkg_deb_control == (dpkg_deb_control & optflags)) { if (dpkg_deb_control == (dpkg_deb_control & optflags)) {
strcpy(ar_filename, "control.tar.gz"); strcpy(ar_filename, "control.tar.gz");
extract_flag = TRUE; extract_flag = TRUE;
@ -114,7 +119,7 @@ extern int dpkg_deb_main(int argc, char **argv)
int opt = 0; int opt = 0;
int optflag = 0; int optflag = 0;
while ((opt = getopt(argc, argv, "cexX")) != -1) { while ((opt = getopt(argc, argv, "cexXl")) != -1) {
switch (opt) { switch (opt) {
case 'c': case 'c':
optflag |= dpkg_deb_contents; optflag |= dpkg_deb_contents;
@ -128,6 +133,9 @@ extern int dpkg_deb_main(int argc, char **argv)
case 'x': case 'x':
optflag |= dpkg_deb_extract; optflag |= dpkg_deb_extract;
break; break;
case 'l':
optflag |= dpkg_deb_list;
break;
/* case 'I': /* case 'I':
optflag |= dpkg_deb_info; optflag |= dpkg_deb_info;
break; break;

View File

@ -42,11 +42,12 @@ extern int tar_unzip_init(int tarFd);
extern int readTarFile(int tarFd, int extractFlag, int listFlag, extern int readTarFile(int tarFd, int extractFlag, int listFlag,
int tostdoutFlag, int verboseFlag, char** extractList, char** excludeList); int tostdoutFlag, int verboseFlag, char** extractList, char** excludeList);
const int dpkg_deb_contents = 1; static const int dpkg_deb_contents = 1;
const int dpkg_deb_control = 2; static const int dpkg_deb_control = 2;
// const int dpkg_deb_info = 4; // const int dpkg_deb_info = 4;
const int dpkg_deb_extract = 8; static const int dpkg_deb_extract = 8;
const int dpkg_deb_verbose_extract = 16; static const int dpkg_deb_verbose_extract = 16;
static const int dpkg_deb_list = 32;
extern int deb_extract(int optflags, const char *dir_name, const char *deb_filename) extern int deb_extract(int optflags, const char *dir_name, const char *deb_filename)
{ {
@ -65,6 +66,10 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
verbose_flag = TRUE; verbose_flag = TRUE;
list_flag = TRUE; list_flag = TRUE;
} }
if (dpkg_deb_list == (dpkg_deb_list & optflags)) {
strcpy(ar_filename, "data.tar.gz");
list_flag = TRUE;
}
if (dpkg_deb_control == (dpkg_deb_control & optflags)) { if (dpkg_deb_control == (dpkg_deb_control & optflags)) {
strcpy(ar_filename, "control.tar.gz"); strcpy(ar_filename, "control.tar.gz");
extract_flag = TRUE; extract_flag = TRUE;
@ -114,7 +119,7 @@ extern int dpkg_deb_main(int argc, char **argv)
int opt = 0; int opt = 0;
int optflag = 0; int optflag = 0;
while ((opt = getopt(argc, argv, "cexX")) != -1) { while ((opt = getopt(argc, argv, "cexXl")) != -1) {
switch (opt) { switch (opt) {
case 'c': case 'c':
optflag |= dpkg_deb_contents; optflag |= dpkg_deb_contents;
@ -128,6 +133,9 @@ extern int dpkg_deb_main(int argc, char **argv)
case 'x': case 'x':
optflag |= dpkg_deb_extract; optflag |= dpkg_deb_extract;
break; break;
case 'l':
optflag |= dpkg_deb_list;
break;
/* case 'I': /* case 'I':
optflag |= dpkg_deb_info; optflag |= dpkg_deb_info;
break; break;