Added patch from Andrew Gaffney <agaffney@gentoo.org> to fix up some of the tab/space...
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 23 Jan 2007 17:08:22 +0000 (17:08 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 23 Jan 2007 17:08:22 +0000 (17:08 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1208 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/catalyst_support.py
modules/embedded_target.py
modules/generic_stage_target.py
modules/grp_target.py
modules/livecd_stage1_target.py
modules/livecd_stage2_target.py
modules/stage3_target.py
modules/tinderbox_target.py

index 1a042a4aa01a88033962e5c14b3155142ef6f716..d06bd3266e591acb34c4b9dbfba7d283b186525e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  23 Jan 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+  modules/catalyst_support.py, modules/embedded_target.py,
+  modules/generic_stage_target.py, modules/grp_target.py,
+  modules/livecd_stage1_target.py, modules/livecd_stage2_target.py,
+  modules/stage3_target.py, modules/tinderbox_target.py:
+  Added patch from Andrew Gaffney <agaffney@gentoo.org> to fix up some of the
+  tab/space nastiness. This is for bug #161915.
+
   23 Jan 2007; Chris Gianelloni <wolf31o2@gentoo.org>
   modules/generic_stage_target.py:
   Fixed new cbuild code with another patch from Mike Frysinger
index 50e6590358488ac18b9032e9dfaa54b5606025ba..aae718324906a155d1494b100dce0cc62612769b 100644 (file)
@@ -54,12 +54,12 @@ def cleanup(pids,block_exceptions=True):
 # a function to turn a string of non-printable characters into a string of
 # hex characters
 def hexify(str):
-    hexStr = string.hexdigits
-    r = ''
-    for ch in str:
-       i = ord(ch)
-       r = r + hexStr[(i >> 4) & 0xF] + hexStr[i & 0xF]
-    return r
+       hexStr = string.hexdigits
+       r = ''
+       for ch in str:
+               i = ord(ch)
+               r = r + hexStr[(i >> 4) & 0xF] + hexStr[i & 0xF]
+       return r
 # hexify()
 
 def generate_hash(file,hash_function="crc32",verbose=False):
index 15a0f0c64ac9eedc1f06b677bb37651104b414c6..2ab8cc5a243ece31226a296c1fd2d7e02b76f169 100644 (file)
@@ -16,32 +16,32 @@ from stat import *
 
 class embedded_target(generic_stage_target):
 
-    def __init__(self,spec,addlargs):
-        self.required_values=[]
-        self.valid_values=[]
-        self.valid_values.extend(["embedded/empty","embedded/rm","embedded/unmerge","embedded/fs-prepare","embedded/fs-finish","embedded/mergeroot","embedded/packages","embedded/fs-type","embedded/runscript","boot/kernel","embedded/linuxrc"])
-       self.valid_values.extend(["embedded/use"])
-        if addlargs.has_key("embedded/fs-type"):
-            self.valid_values.append("embedded/fs-ops")
-
-       generic_stage_target.__init__(self,spec,addlargs)
-       self.set_build_kernel_vars(addlargs)
-
-    def set_action_sequence(self):
-       self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
+       def __init__(self,spec,addlargs):
+               self.required_values=[]
+               self.valid_values=[]
+               self.valid_values.extend(["embedded/empty","embedded/rm","embedded/unmerge","embedded/fs-prepare","embedded/fs-finish","embedded/mergeroot","embedded/packages","embedded/fs-type","embedded/runscript","boot/kernel","embedded/linuxrc"])
+               self.valid_values.extend(["embedded/use"])
+               if addlargs.has_key("embedded/fs-type"):
+                       self.valid_values.append("embedded/fs-ops")
+
+               generic_stage_target.__init__(self,spec,addlargs)
+               self.set_build_kernel_vars(addlargs)
+
+       def set_action_sequence(self):
+               self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\
                                        "config_profile_link","setup_confdir",\
                                        "portage_overlay","bind","chroot_setup",\
                                        "setup_environment","build_kernel","build_packages",\
                                        "bootloader","root_overlay","fsscript","unmerge",\
                                        "unbind","remove","empty","clean","capture","clear_autoresume"]
 
-    def set_stage_path(self):
-        self.settings["stage_path"]=normpath(self.settings["chroot_path"]+"/tmp/mergeroot")
-       print "embedded stage path is "+self.settings["stage_path"]
+       def set_stage_path(self):
+               self.settings["stage_path"]=normpath(self.settings["chroot_path"]+"/tmp/mergeroot")
+               print "embedded stage path is "+self.settings["stage_path"]
 
-    def set_root_path(self):
-        self.settings["root_path"]=normpath("/tmp/mergeroot")
-       print "embedded root path is "+self.settings["root_path"]
+       def set_root_path(self):
+               self.settings["root_path"]=normpath("/tmp/mergeroot")
+               print "embedded root path is "+self.settings["root_path"]
 
 def register(foo):
        foo.update({"embedded":embedded_target})
index d70ee716ea84b01fd005c627535b20a1e9387328..b9cb3c3fdd58bd9fcc265b361a91788d5a5c131f 100644 (file)
@@ -266,8 +266,8 @@ class generic_stage_target(generic_target):
                        # first clean up any existing target stuff
                        if os.path.isfile(self.settings["target_path"]):
                                cmd("rm -f "+self.settings["target_path"], \
-                                       "Could not remove existing file: "+self.settings["target_path"],env=self.env)
-                               touch(self.settings["autoresume_path"]+"setup_target_path")
+                               "Could not remove existing file: "+self.settings["target_path"],env=self.env)
+                               touch(self.settings["autoresume_path"]+"setup_target_path")
                
                        if not os.path.exists(self.settings["storedir"]+"/builds/"):
                                os.makedirs(self.settings["storedir"]+"/builds/")
index 9cea0e47a631645fe3235b065b0127e2cd8df094..f2fb5470f7e4fe7c6e620445d814a11ff79a5f10 100644 (file)
@@ -32,18 +32,18 @@ class grp_target(generic_stage_target):
                generic_stage_target.__init__(self,spec,addlargs)
 
        def set_target_path(self):
-                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
-                if self.settings.has_key("AUTORESUME") \
-                        and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
-                                print "Resume point detected, skipping target path setup operation..."
-                else:
-                        # first clean up any existing target stuff
-                        #if os.path.isdir(self.settings["target_path"]):
-                                #cmd("rm -rf "+self.settings["target_path"],
-                                #"Could not remove existing directory: "+self.settings["target_path"],env=self.env)
-                        if not os.path.exists(self.settings["target_path"]):
-                                os.makedirs(self.settings["target_path"])
-                        
+               self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
+               if self.settings.has_key("AUTORESUME") \
+                       and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
+                       print "Resume point detected, skipping target path setup operation..."
+               else:
+                       # first clean up any existing target stuff
+                       #if os.path.isdir(self.settings["target_path"]):
+                               #cmd("rm -rf "+self.settings["target_path"],
+                               #"Could not remove existing directory: "+self.settings["target_path"],env=self.env)
+                       if not os.path.exists(self.settings["target_path"]):
+                               os.makedirs(self.settings["target_path"])
+
                        touch(self.settings["autoresume_path"]+"setup_target_path")
 
        def run_local(self):
index 46ccbd9b1ab41ad1fab0a29b2d0f2a9331c065c3..5e989d0b42f4509e78047f065592fa5d3ba1d6ae 100644 (file)
@@ -56,10 +56,10 @@ class livecd_stage1_target(generic_stage_target):
                self.settings[self.settings["spec_prefix"]+"/packages"].append("app-misc/livecd-tools")
 
        def set_pkgcache_path(self):
-           if self.settings.has_key("pkgcache_path"):
+               if self.settings.has_key("pkgcache_path"):
                        if type(self.settings["pkgcache_path"]) != types.StringType:
                                self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
-           else:
+               else:
                        generic_stage_target.set_pkgcache_path(self)
 
 def register(foo):
index dd4de7a0ebafcd0a287783397797bbd3b0c45f0d..9ce6334de8a4c3979b1f8ebf4bf8b7f9f95412ba 100644 (file)
@@ -71,59 +71,58 @@ class livecd_stage2_target(generic_stage_target):
                        myf.close()
        
        def unpack(self):
-                unpack=True
+               unpack=True
                display_msg=None
 
-                clst_unpack_hash=read_from_clst(self.settings["autoresume_path"]+"unpack")
-
-                if os.path.isdir(self.settings["source_path"]):
-                        unpack_cmd="rsync -a --delete "+self.settings["source_path"]+" "+self.settings["chroot_path"]
-                        display_msg="\nStarting rsync from "+self.settings["source_path"]+"\nto "+\
-                                self.settings["chroot_path"]+" (This may take some time) ...\n"
-                        error_msg="Rsync of "+self.settings["source_path"]+" to "+self.settings["chroot_path"]+" failed."
-                        invalid_snapshot=False
-
-                if self.settings.has_key("AUTORESUME"):
-                    if os.path.isdir(self.settings["source_path"]) and \
-                            os.path.exists(self.settings["autoresume_path"]+"unpack"):
-                                print "Resume point detected, skipping unpack operation..."
-                                unpack=False
-                    elif self.settings.has_key("source_path_hash"):
-                        if self.settings["source_path_hash"] != clst_unpack_hash:
-                                invalid_snapshot=True
-
-                if unpack:
-                        self.mount_safety_check()
-                        if invalid_snapshot:
-                                print "No Valid Resume point detected, cleaning up  ..."
-                                #os.remove(self.settings["autoresume_path"]+"dir_setup")
-                                self.clear_autoresume()
-                                self.clear_chroot()
-                                #self.dir_setup()
-
-                        if not os.path.exists(self.settings["chroot_path"]):
-                                os.makedirs(self.settings["chroot_path"])
-
-                        if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
-                                os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
-
-                        if self.settings.has_key("PKGCACHE"):
-                                if not os.path.exists(self.settings["pkgcache_path"]):
-                                        os.makedirs(self.settings["pkgcache_path"],0755)
+               clst_unpack_hash=read_from_clst(self.settings["autoresume_path"]+"unpack")
+
+               if os.path.isdir(self.settings["source_path"]):
+                       unpack_cmd="rsync -a --delete "+self.settings["source_path"]+" "+self.settings["chroot_path"]
+                       display_msg="\nStarting rsync from "+self.settings["source_path"]+"\nto "+\
+                               self.settings["chroot_path"]+" (This may take some time) ...\n"
+                       error_msg="Rsync of "+self.settings["source_path"]+" to "+self.settings["chroot_path"]+" failed."
+                       invalid_snapshot=False
+
+               if self.settings.has_key("AUTORESUME"):
+                       if os.path.isdir(self.settings["source_path"]) and \
+                               os.path.exists(self.settings["autoresume_path"]+"unpack"):
+                               print "Resume point detected, skipping unpack operation..."
+                               unpack=False
+                       elif self.settings.has_key("source_path_hash"):
+                               if self.settings["source_path_hash"] != clst_unpack_hash:
+                                       invalid_snapshot=True
+
+               if unpack:
+                       self.mount_safety_check()
+                       if invalid_snapshot:
+                               print "No Valid Resume point detected, cleaning up  ..."
+                               #os.remove(self.settings["autoresume_path"]+"dir_setup")
+                               self.clear_autoresume()
+                               self.clear_chroot()
+                               #self.dir_setup()
+
+                       if not os.path.exists(self.settings["chroot_path"]):
+                               os.makedirs(self.settings["chroot_path"])
+
+                       if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
+                               os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
+
+                       if self.settings.has_key("PKGCACHE"):
+                               if not os.path.exists(self.settings["pkgcache_path"]):
+                                       os.makedirs(self.settings["pkgcache_path"],0755)
 
                        if not display_msg:
                                raise CatalystError,"Could not find appropriate source. Please check the 'source_subpath' setting in the spec file."
 
-                        print display_msg
-                        cmd(unpack_cmd,error_msg,env=self.env)
-
-                        if self.settings.has_key("source_path_hash"):
-                                myf=open(self.settings["autoresume_path"]+"unpack","w")
-                                myf.write(self.settings["source_path_hash"])
-                                myf.close()
-                        else:
-                                touch(self.settings["autoresume_path"]+"unpack")
+                       print display_msg
+                       cmd(unpack_cmd,error_msg,env=self.env)
 
+                       if self.settings.has_key("source_path_hash"):
+                               myf=open(self.settings["autoresume_path"]+"unpack","w")
+                               myf.write(self.settings["source_path_hash"])
+                               myf.close()
+                       else:
+                               touch(self.settings["autoresume_path"]+"unpack")
 
        def set_action_sequence(self):
                self.settings["action_sequence"]=["unpack","unpack_snapshot",\
index cea2df9727a6e11620e1190d413694e07a94e342..41d0b318fae6300402b75e70d2fb10f40c0557b6 100644 (file)
@@ -12,13 +12,13 @@ class stage3_target(generic_stage_target):
                self.valid_values=[]
                generic_stage_target.__init__(self,spec,addlargs)
 
-        def set_portage_overlay(self):
-                       generic_stage_target.set_portage_overlay(self)
-                       if self.settings.has_key("portage_overlay"):
-                               print "\nWARNING !!!!!"
-                               print "\tUsing an overlay for earlier stages could cause build issues."
-                               print "\tIf you break it, you buy it. Don't complain to us about it."
-                               print "\tDont say we did not warn you\n"
+       def set_portage_overlay(self):
+               generic_stage_target.set_portage_overlay(self)
+               if self.settings.has_key("portage_overlay"):
+                       print "\nWARNING !!!!!"
+                       print "\tUsing an overlay for earlier stages could cause build issues."
+                       print "\tIf you break it, you buy it. Don't complain to us about it."
+                       print "\tDont say we did not warn you\n"
 
 def register(foo):
        foo.update({"stage3":stage3_target})
index 4824cc510663ea898de4ce3ca1f826da3782c785..a1a66151abdc69ffadd89ee50e56ad2d0f067aae 100644 (file)
@@ -26,21 +26,21 @@ class tinderbox_target(generic_stage_target):
                        raise CatalystError,"Tinderbox aborting due to error."
 
        def set_pkgcache_path(self):
-            if self.settings.has_key("pkgcache_path"):
-                if type(self.settings["pkgcache_path"]) != types.StringType:
-                    self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
-            else:
-                generic_stage_target.set_pkgcache_path(self)
+               if self.settings.has_key("pkgcache_path"):
+                       if type(self.settings["pkgcache_path"]) != types.StringType:
+                               self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
+                       else:
+                               generic_stage_target.set_pkgcache_path(self)
        
        def set_cleanables(self):
            self.settings["cleanables"]=["/etc/resolv.conf","/var/tmp/*","/root/*",\
                                        "/usr/portage"]
        def set_action_sequence(self):
-                #Default action sequence for run method
-                self.settings["action_sequence"]=["unpack","unpack_snapshot",\
-                                "config_profile_link","setup_confdir","bind","chroot_setup",\
-                                "setup_environment","run_local","preclean","unbind","clean",\
-                               "clear_autoresume"]
+               #Default action sequence for run method
+               self.settings["action_sequence"]=["unpack","unpack_snapshot",\
+                             "config_profile_link","setup_confdir","bind","chroot_setup",\
+                             "setup_environment","run_local","preclean","unbind","clean",\
+                             "clear_autoresume"]
        
 def register(foo):
        foo.update({"tinderbox":tinderbox_target})