Re: Could not stat file localtime
Sun, May 27, 2001 at 01:52:47PM +0100 wrote:
> During install on hppa I see two error dialogs:
>
> Could not stat file /target/usr/share/zoneinfo/localtime.
> Could not stat file localtime.
>
> They appear to be due to my libc6-2.2.1 containing:
>
> lrwxrwxrwx root/root 0 2001-04-25 22:05:07 ./usr/share/zoneinfo/localtime -> /etc/localtime
>
> After install I have:
>
> lrwxrwxrwx 1 root root 33 May 22 13:22 /etc/localtime -> /usr/share/zoneinfo/Europe/London
>
> but before selecting my timezone during install I guess /etc/localtime
> doesn't exist, resulting in the errors.
Close. If that was the case I was going to call this a libc bug since installing
a dangling symlink is sloppy. However, it looks like boot-floppies is at fault.
At this point in the installation there is a /target/etc/localtime :
lrwxrwxrwx 1 root root 23 May 27 16:39 /target/etc/localtime -> /usr/share/zoneinfo/UTC
But not an /etc/localtime. Since tzconfig isn't being run chrooted the symlink:
lrwxrwxrwx root/root 0 2001-04-25 22:05:07 ./usr/share/zoneinfo/localtime -> /etc/localtime
is broken.
>
> The code generating the errors is round lines 238 and 265 in
> boot-floppies/utilites/tzconfig.c.
>
Thanks.
> Seems either that code should ignore 'localtime' when parsing the zoneinfo
> directory contents, or libc6 should not include the localtime link. Could
> be an hppa libc6 problem, but I think some other arch reported it here
> a couple of days ago also.
Yes this appears to be a bug we all get to enjoy, but not for long. I think
your first solution is the best. We're compiling a list of timezones for the
user to pick, 'localtime' doesn't make sense in that context. The following is
what I just committed.
David
Index: tzconfig.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/tzconfig.c,v
retrieving revision 1.18
diff -u -w -r1.18 tzconfig.c
--- tzconfig.c 2000/08/13 13:18:38 1.18
+++ tzconfig.c 2001/05/28 00:23:05
@@ -234,6 +234,7 @@
strncat(path + strlen(dir), "/", 1);
strcat(path + strlen(dir) + 1, current->d_name);
+ if (!strstr (path, "localtime")) {
if (stat(path, &buffer) == -1) {
sprintf(error, _("Could not stat file %s."), path);
problemBox(error, _("Timezone Config Error"));
@@ -244,6 +245,7 @@
}
else if (S_ISREG(buffer.st_mode))
nfile++;
+ }
free(path);
}
@@ -261,6 +263,7 @@
strncat(path + strlen(dir), "/", 1);
strcat(path + strlen(dir) + 1, tmp_name);
+ if (!strstr (path, "localtime")) {
if (stat(path, &buffer) == -1) {
sprintf(error, _("Could not stat file %s."), tmp_name);
problemBox(error, _("Timezone Config Error"));
@@ -271,6 +274,7 @@
}
else if (S_ISREG(buffer.st_mode))
files->data[(files->nelem)++] = tmp_name;
+ }
}
free(path);
}
Reply to: