* Allow nrelease/Makefile to build the local installer in usr.sbin
[dragonfly.git] / usr.sbin / installer / dfuibe_installer / fn_install.c.patch
1 $DragonFly: src/usr.sbin/installer/dfuibe_installer/Attic/fn_install.c.patch,v 1.1 2008/03/25 22:55:38 dave Exp $
2
3 --- fn_install.c.orig   Sun Feb  6 22:46:20 2005
4 +++ fn_install.c        Tue Apr 18 12:43:48 2006
5 @@ -34,7 +34,7 @@
6  /*
7   * fn_install.c
8   * Installer Function : Install OS Files.
9 - * $Id: fn_install.c,v 1.71 2005/02/07 06:46:20 cpressey Exp $
10 + * $Id: fn_install.c,v 1.74 2006/04/18 19:43:48 joerg Exp $
11   */
12  
13  #include <libgen.h>
14 @@ -212,7 +231,7 @@
15          */
16  
17         for (i = 0; cp_src[i] != NULL && cp_src[i][0] != '\0'; i++) {
18 -               char *src, *dest, *dn;
19 +               char *src, *dest, *dn, *tmp_dest;
20  
21                 dest = cp_src[i];
22  
23 @@ -229,14 +248,15 @@
24                 /*
25                  * Create intermediate directories, if needed.
26                  */
27 -               dn = dirname(dest);
28 +               tmp_dest = aura_strdup(dest);
29 +               dn = dirname(tmp_dest);
30                 if (is_dir("%s%s", a->os_root, &dn[1]) &&
31                     !is_dir("%smnt%s", a->os_root, dn)) {
32                         command_add(cmds, "%s%s -p %smnt%s",
33                             a->os_root, cmd_name(a, "MKDIR"),
34                             a->os_root, dn);
35                 }
36 -               aura_free(dn, "directory name");
37 +               aura_free(tmp_dest, "directory name");
38  
39                 /*
40                  * If a directory by the same name but with the suffix
41 @@ -260,7 +280,6 @@
42                             a->os_root, src,
43                             a->os_root, dest);
44                         command_set_log_mode(cmd, COMMAND_LOG_QUIET);
45 -                       aura_free(src, "source directory name");
46                 }
47         }
48  
49 @@ -388,7 +407,7 @@
50          * This allows the resulting file tree to be customized.
51          */
52         for (i = 0; cp_src[i] != NULL && cp_src[i][0] != '\0'; i++) {
53 -               char *src, *dest, *dn;
54 +               char *src, *dest, *dn, *tmp_dest;
55  
56                 src = cp_src[i];
57                 dest = cp_src[i];
58 @@ -397,14 +416,15 @@
59                  * Get the directory that the desired thing to
60                  * copy resides in.
61                  */
62 -               dn = dirname(dest);
63 +               tmp_dest = aura_strdup(dest);
64 +               dn = dirname(tmp_dest);
65  
66                 /*
67                  * If this dir doesn't exist in PRISTINE_DIR
68                  * on the install media, just skip it.
69                  */
70                 if (!is_dir("%s%s%s", a->os_root, PRISTINE_DIR, dn)) {
71 -                       aura_free(dn, _("directory name"));
72 +                       aura_free(tmp_dest, _("directory name"));
73                         continue;
74                 }
75  
76 @@ -416,7 +436,7 @@
77                             a->os_root, cmd_name(a, "MKDIR"),
78                             a->os_root, dn);
79                 }
80 -               aura_free(dn, "directory name");
81 +               aura_free(tmp_dest, "directory name");
82  
83                 /*
84                  * Cpdup the chosen file or directory onto the HDD.