Re: [master] Remove /etc/localtime before trying to copy into it (#533240).

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

 



Ack.

On 12/03/2009 10:19 AM, Ales Kozumplik wrote:
If the file is already linked with the source the raised inspection kills
anaconda. This happens in some unclear livecd situations but in general nothing
prevents the user or any software he runs on the livecd from arranging this
manually.

Tested when the file doesn't exist beforehand (the common scenario) and when the
file links to its later origin already (the bug scenario).
---
  packages.py |    7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/packages.py b/packages.py
index 87028a8..0a4951d 100644
--- a/packages.py
+++ b/packages.py
@@ -197,11 +197,16 @@ def setupTimezone(anaconda):

      os.environ["TZ"] = anaconda.id.timezone.tz
      tzfile = "/usr/share/zoneinfo/" + anaconda.id.timezone.tz
+    tzlocalfile = "/etc/localtime"
      if not os.access(tzfile, os.R_OK):
          log.error("unable to set timezone")
      else:
          try:
-            shutil.copyfile(tzfile, "/etc/localtime")
+            os.remove(tzlocalfile)
+        except OSError:
+            pass
+        try:
+            shutil.copyfile(tzfile, tzlocalfile)
          except OSError as e:
              log.error("Error copying timezone (from %s): %s" %(tzfile, e.strerror))


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux