revisor/base.py  |   23 +++++++++++++++++++++--
 revisor/pungi.py |    2 +-
 2 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 83fd9c279ad23d4c4874a59392edee60a6f06c08
Merge: 06f423f... b5c3028...
Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org>
Date:   Sun Nov 8 12:13:07 2009 +0100

    Merge branch 'master' of ssh://git.fedorahosted.org/git/revisor



commit 06f423fd70875ac837e78a7b285b35637286d8f8
Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org>
Date:   Sun Nov 8 12:12:00 2009 +0100

    Fix os.access()

diff --git a/revisor/pungi.py b/revisor/pungi.py
index 1ebb6bb..8490200 100644
--- a/revisor/pungi.py
+++ b/revisor/pungi.py
@@ -506,7 +506,7 @@ cost=500
 
         createrepo.append('--outputdir')
         if int(self.cfg.mediatypes[discdir]["discs"]) == 1:
-            if os.access('%s-%s-disc1' % (self.topdir,discdir)):
+            if os.access('%s-%s-disc1' % (self.topdir,discdir), os.R_OK):
                 shutil.rmtree('%s-%s-disc1' % (self.topdir,discdir))
             os.makedirs('%s-%s-disc1' % (self.topdir,discdir))
         createrepo.append('%s-%s-disc1' % (self.topdir,discdir))


commit dc53063dde542e49a27505f20f4ee2f833396231
Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org>
Date:   Sun Nov 8 12:11:16 2009 +0100

    Fix adding users, adding groups
    Fix copy_dir

diff --git a/revisor/base.py b/revisor/base.py
index 980a8fd..ba4fc9e 100644
--- a/revisor/base.py
+++ b/revisor/base.py
@@ -1215,6 +1215,7 @@ class RevisorBase:
             self.log.debug(_("Size of the installation tree is %s MB") % 
str(int(calc_size_str) / 1024 / 1024))
 
             override_retval = ""
+
             # So, what would the number of discs be?
             for num in self.cfg.mediatypes["index"].keys():
                 mediatype = self.cfg.mediatypes["index"][num]
@@ -1731,7 +1732,7 @@ class RevisorBase:
                 raise IOError, e
 
         if self.cfg.lm_user_configuration:
-            useradd = ['useradd']
+            useradd = ['/usr/sbin/useradd']
             if len(self.cfg.lm_user_comment) > 0:
                 useradd.extend(['-c', self.cfg.lm_user_comment])
             useradd.append(self.cfg.lm_user_name)
@@ -1743,7 +1744,7 @@ class RevisorBase:
                 f.close()
 
             if self.cfg.lm_user_wheel:
-                self.run_command(["gpasswd", "-a", self.cfg.lm_user_name, 
"wheel"], preexec_fn=liveImage._instroot)
+                self.run_command(["/usr/bin/gpasswd", "-a", 
self.cfg.lm_user_name, "wheel"], preexec_fn=liveImage._instroot)
 
                 if self.cfg.lm_wheel_sudo_no_passwd:
                     self.run_command(["sed", "-i", "-e", 
"'s/^#\s*%wheel.*NOPASSWD/%wheel ALL=(ALL) NOPASSWD: ALL/g'", "/etc/sudoers"], 
preexec_fn=liveImage._instroot)
@@ -1754,6 +1755,24 @@ class RevisorBase:
             print "Launching shell. Exit to continue."
             print "----------------------------------"
             liveImage.launch_shell()
+
+        if self.cfg.copy_dir:
+            self.log.info(_("Copying copy_dir %s to install_root %s") % 
(self.cfg.copy_dir,liveImage._instroot))
+            # So what is the destination directory?
+            src_dir = self.cfg.copy_dir
+            dst_dir = "%s/%s"
+
+            for root, dirs, files in os.walk(src_dir):
+                real_dst = dst_dir % (liveImage._instroot, 
root.replace(src_dir,''))
+
+                if not os.access(real_dst, os.R_OK):
+                    self.log.debug(_("Creating %s") % real_dst)
+                    os.makedirs(real_dst)
+
+                for file in files:
+                    self.log.debug(_("Copying %s to %s") % 
(os.path.join(root,file), os.path.join(real_dst,file)))
+                    shutil.copyfile(os.path.join(root,file), 
os.path.join(real_dst,file))
+
         liveImage.unmount()
         
liveImage.package(destdir=os.path.join(self.cfg.destination_directory,"live"))
 


_______________________________________________
revisor-devel mailing list
revisor-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/revisor-devel

Reply via email to