Source-Changes-HG archive

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

[src/netbsd-1-5]: src/distrib/utils/sysinst/arch/i386 Pullup 1.48 [fvdl]:



details:   https://anonhg.NetBSD.org/src/rev/fb1803976557
branches:  netbsd-1-5
changeset: 490207:fb1803976557
user:      tv <tv%NetBSD.org@localhost>
date:      Mon Nov 13 19:56:14 2000 +0000

description:
Pullup 1.48 [fvdl]:
Handle existing /emul symlink better when it points to nothing; same
with /emul/aout. Prevents unexpected sudden exits because during
aout lib move in upgrade.

diffstat:

 distrib/utils/sysinst/arch/i386/md.c |  21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 4824cc7bbc09 -r fb1803976557 distrib/utils/sysinst/arch/i386/md.c
--- a/distrib/utils/sysinst/arch/i386/md.c      Mon Nov 13 19:54:25 2000 +0000
+++ b/distrib/utils/sysinst/arch/i386/md.c      Mon Nov 13 19:56:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.36.4.5 2000/11/09 22:47:34 tv Exp $ */
+/*     $NetBSD: md.c,v 1.36.4.6 2000/11/13 19:56:14 tv Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -787,7 +787,7 @@
 static int
 move_aout_libs()
 {
-       int n;
+       int n, backedup = 0;
        char prefix[MAXPATHLEN], src[MAXPATHLEN];
        struct stat st;
 
@@ -807,6 +807,11 @@
         */
        if (target_realpath("/emul", prefix) == NULL || stat(prefix, &st) < 0) {
                strcpy(prefix, target_expand("/emul"));
+               if (lstat(prefix, &st) == 0) {
+                       run_prog(0, NULL, "mv -f %s %s", prefix,
+                           target_expand("/emul.old"));
+                       backedup = 1;
+               }
                if (scripting)
                        fprintf(script, "mkdir %s\n", prefix);
                mkdir(prefix, 0755);
@@ -821,8 +826,11 @@
         * move it out of the way.
         */
        strcpy(src, concat_paths(prefix, "aout"));
-       run_prog(0, NULL, "mv -f %s %s", src,
-           concat_paths(prefix, "aout.old"));
+       if (lstat(src, &st) == 0) {
+               run_prog(0, NULL, "mv -f %s %s", src,
+                   concat_paths(prefix, "aout.old"));
+               backedup = 1;
+       }
 
        /*
         * We have created /emul if needed. Since no previous /emul/aout
@@ -869,5 +877,10 @@
        strcpy(src, target_expand("/usr/X11R6/lib"));
        handle_aout_x_libs(src, concat_paths(prefix, "usr/X11R6/lib"));
 
+       if (backedup) {
+               msg_display(MSG_emulbackup);
+               process_menu(MENU_ok);
+       }
+
        return n;
 }



Home | Main Index | Thread Index | Old Index