From b723879025a4a8b28d5dfc0305290cf70df4d216 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 16 Aug 2003 09:09:09 +0000 Subject: [PATCH] * dump_setup.cc (package_find): Don't stop searching on missing file list. (package_list): Ditto. * dump_setup.cc: (package_list): Make output terse unless verbose requested. Fix formatting. (package_find): Ditto. --- winsup/utils/ChangeLog | 12 ++++++++++++ winsup/utils/dump_setup.cc | 30 +++++++++++++++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 88b848c86..f15024d26 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,15 @@ +2003-08-16 David Rothenberger + + * dump_setup.cc (package_find): Don't stop searching on missing + file list. + (package_list): Ditto. + +2003-08-16 Igor Pechtchanski + + * dump_setup.cc: (package_list): Make output terse unless + verbose requested. Fix formatting. + (package_find): Ditto. + 2003-08-15 Corinna Vinschen * cygcheck.cc (main): Fix some formatting and help text printing. diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc index 6fa7809e5..a4031889f 100644 --- a/winsup/utils/dump_setup.cc +++ b/winsup/utils/dump_setup.cc @@ -411,21 +411,22 @@ package_list (int verbose, char **argv) { FILE *fp = open_package_list (packages[i].name); if (!fp) - { - if (verbose) - printf ("Can't open file list /etc/setup/%s.lst.gz for package %s\n", - packages[i].name, packages[i].name); - return; - } + { + if (verbose) + printf ("Can't open file list /etc/setup/%s.lst.gz for package %s\n", + packages[i].name, packages[i].name); + continue; + } - printf ("Package: %s-%s\n", packages[i].name, packages[i].ver); + if (verbose) + printf ("Package: %s-%s\n", packages[i].name, packages[i].ver); char buf[MAX_PATH + 1]; while (fgets (buf, MAX_PATH, fp)) { char *lastchar = strchr(buf, '\n'); if (lastchar[-1] != '/') - printf (" /%s", buf); + printf ("%s/%s", (verbose?" ":""), buf); } fclose (fp); @@ -450,12 +451,7 @@ package_find (int verbose, char **argv) { FILE *fp = open_package_list (packages[i].name); if (!fp) - { - if (verbose) - printf ("Can't open file list /etc/setup/%s.lst.gz for package %s\n", - packages[i].name, packages[i].name); - return; - } + continue; char buf[MAX_PATH + 2]; buf[0] = '/'; @@ -479,7 +475,11 @@ package_find (int verbose, char **argv) if (!a && is_alias) a = match_argv (argv, filename + 4); if (a > 0) - printf ("%s-%s\n", packages[i].name, packages[i].ver); + { + if (verbose) + printf ("%s: found in package ", filename); + printf ("%s-%s\n", packages[i].name, packages[i].ver); + } } }