[PATCH] Copy the hosts tzdata (/etc/localtime) into the chroot

Jesse Keating jkeating at redhat.com
Fri Feb 6 01:56:48 UTC 2009


---
 py/mock/backend.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/py/mock/backend.py b/py/mock/backend.py
index 2bc63df..6c9bb6e 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -263,6 +263,13 @@ class Root(object):
         # create rpmbuild dir
         self._buildDirSetup()
 
+        # set up timezone to match host
+        localtimedir = self.makeChrootPath('etc')
+        localtimepath = self.makeChrootPath('etc', 'localtime')
+        if os.path.exists(resolvpath):
+            os.remove(resolvpath)
+        shutil.copy2('/etc/localtime', localtimedir)
+
         # done with init
         self._callHooks('postinit')
 
-- 
1.6.0.6




More information about the Fedora-buildsys-list mailing list