diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-07-06 01:39:11 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-07-06 01:39:11 +0000 |
commit | efa11abac78f71e0d119dada150d2ef8c9f593a3 (patch) | |
tree | e1af70cb1098576735d41227ad85afe3110b8a8b /mdk-stage1 | |
parent | d1f94511dfd3d2aae60c93d46182b0d4ff453950 (diff) | |
download | drakx-efa11abac78f71e0d119dada150d2ef8c9f593a3.tar drakx-efa11abac78f71e0d119dada150d2ef8c9f593a3.tar.gz drakx-efa11abac78f71e0d119dada150d2ef8c9f593a3.tar.bz2 drakx-efa11abac78f71e0d119dada150d2ef8c9f593a3.tar.xz drakx-efa11abac78f71e0d119dada150d2ef8c9f593a3.zip |
doing basename is dumb (is blino too?), really make the symlink relative
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/config-stage1.h | 6 | ||||
-rw-r--r-- | mdk-stage1/directory.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h index a24c0cf0c..464fb38a5 100644 --- a/mdk-stage1/config-stage1.h +++ b/mdk-stage1/config-stage1.h @@ -35,7 +35,8 @@ #ifdef MANDRAKE_MOVE #define MEM_LIMIT_MOVE 120 #define DISTRIB_NAME "Mandrakemove" -#define IMAGE_LOCATION SLASH_LOCATION "/cdrom" +#define IMAGE_LOCATION_DIR SLASH_LOCATION +#define IMAGE_LOCATION IMAGE_LOCATION_DIR "cdrom" #define IMAGE_LOCATION_REAL SLASH_LOCATION "/image" #define RAW_LOCATION_REL "/cdrom" #define STAGE2_LOCATION_REL "/image" @@ -46,7 +47,8 @@ #else #define DISTRIB_NAME "Mandrakelinux" -#define IMAGE_LOCATION SLASH_LOCATION "/tmp/image" +#define IMAGE_LOCATION_DIR SLASH_LOCATION "/tmp/" +#define IMAGE_LOCATION IMAGE_LOCATION_DIR "image" #define IMAGE_LOCATION_REAL "/tmp/image" #define STAGE2_LOCATION_REL "/tmp/stage2" #endif diff --git a/mdk-stage1/directory.c b/mdk-stage1/directory.c index 30f3b29a5..f71cf8ad4 100644 --- a/mdk-stage1/directory.c +++ b/mdk-stage1/directory.c @@ -137,8 +137,9 @@ enum return_type try_with_directory(char *directory, char *method_live, char *me add_to_env("ISOPATH", location_full); add_to_env("METHOD", method_iso); } else { - log_message("assuming %s is a mirror tree", location_full); - symlink(basename(location_full), IMAGE_LOCATION); + int offset = strncmp(location_full, IMAGE_LOCATION_DIR, sizeof(IMAGE_LOCATION_DIR) - 1) == 0 ? sizeof(IMAGE_LOCATION_DIR) - 1 : 0; + log_message("assuming %s is a mirror tree", location_full + offset); + symlink(location_full + offset, IMAGE_LOCATION); add_to_env("METHOD", method_live); } #ifndef MANDRAKE_MOVE |