Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/sysinst cleanup_dist():



details:   https://anonhg.NetBSD.org/src/rev/4e491bc2df62
branches:  trunk
changeset: 543238:4e491bc2df62
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Feb 20 12:02:56 2003 +0000

description:
cleanup_dist():
- filenames in obsolete sets start with "./" not "/" (i changed that a
  while ago, and forgot to update this)
- only call target_prefix() once, not for each filename parsed...
- look for obsolete lists in /etc/obsolete/%s instead of /dist/%s_obsolete

diffstat:

 distrib/utils/sysinst/util.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r f09c8654f0c3 -r 4e491bc2df62 distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Thu Feb 20 12:02:31 2003 +0000
+++ b/distrib/utils/sysinst/util.c      Thu Feb 20 12:02:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.85 2003/02/20 11:03:34 grant Exp $  */
+/*     $NetBSD: util.c,v 1.86 2003/02/20 12:02:56 lukem Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -556,7 +556,7 @@
 
 /*
  * Do pre-extract cleanup for set 'name':
- * open a file named '/dist/<name>_obsolete file', which contain a list of
+ * open a file named '/etc/obsolete/<name>', which contain a list of
  * files to kill from the target. For each file, test if it is present on
  * the target. Then display the list of files which will be removed,
  * ask user for confirmation, and process.
@@ -576,6 +576,7 @@
 {
        char file_path[MAXPATHLEN];
        char file_name[MAXPATHLEN];
+       char *file_prefix;
        FILE *list_file;
        struct filelist *head = NULL;
        struct filelist *current;
@@ -584,7 +585,7 @@
        int retval = 1;
        int needok = 0;
 
-       snprintf(file_path, MAXPATHLEN, "/dist/%s_obsolete", name);
+       snprintf(file_path, MAXPATHLEN, "/etc/obsolete/%s", name);
        list_file = fopen(file_path, "r");
        if (list_file == NULL) {
                saved_errno = errno;
@@ -597,14 +598,12 @@
                process_menu(MENU_ok);
                return 0;
        }
+       file_prefix = target_prefix();
        while (fgets(file_name, MAXPATHLEN, list_file)) {
-               /* ignore lines that don't begin with '/' */
-               if (file_name[0] != '/')
-                       continue;
                /* Remove trailing \n if any */
                if (file_name[strlen(file_name)-1] == '\n')
                        file_name[strlen(file_name)-1] = '\0';
-               snprintf(file_path, MAXPATHLEN, "%s%s", target_prefix(),
+               snprintf(file_path, MAXPATHLEN, "%s/%s", file_prefix,
                    file_name);
                if (lstat(file_path, &st) != 0) {
                        saved_errno = errno;



Home | Main Index | Thread Index | Old Index