From: Chris Gianelloni Date: Fri, 2 Dec 2005 20:09:03 +0000 (+0000) Subject: So I was just kidding on that last commit. This one is 2.0_rc4. X-Git-Tag: CATALYST_2_0_6_916~563 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1dbd3f35ecf5ccc35c6ee8cd9adafd66067625eb;p=catalyst.git So I was just kidding on that last commit. This one is 2.0_rc4. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@931 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index e6e86f3a..7263a2cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.418 2005/12/02 19:37:01 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.419 2005/12/02 20:09:03 wolf31o2 Exp $ + + 02 Dec 2005; Chris Gianelloni + modules/catalyst_lock.py, 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/netboot_target.py, + modules/stage1_target.py, modules/stage4_target.py, + modules/tinderbox_target.py: + So I was just kidding on that last commit. This one is 2.0_rc4. 02 Dec 2005; Chris Gianelloni catalyst, modules/catalyst_lock.py, modules/catalyst_support.py, diff --git a/modules/catalyst_lock.py b/modules/catalyst_lock.py index 63418315..ff8eaa02 100755 --- a/modules/catalyst_lock.py +++ b/modules/catalyst_lock.py @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_lock.py,v 1.5 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_lock.py,v 1.6 2005/12/02 20:09:03 wolf31o2 Exp $ import os import fcntl import errno @@ -11,8 +11,8 @@ import time from catalyst_support import * def writemsg(mystr): - sys.stderr.write(mystr) - sys.stderr.flush() + sys.stderr.write(mystr) + sys.stderr.flush() #def normpath(mypath): #newpath = os.path.normpath(mypath) @@ -30,8 +30,8 @@ class LockDir: self.clean_my_hardlocks() self.delete_lock_from_path_list() if self.islocked(): - self.fcntl_unlock() - def __init__(self,lockdir): + self.fcntl_unlock() + def __init__(self,lockdir): self.locked=False self.myfd=None self.set_gid(250) diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 321236fb..4ab2efbb 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.61 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.62 2005/12/02 20:09:03 wolf31o2 Exp $ import sys,string,os,types,re,signal,traceback,md5,sha,time selinux_capable = False @@ -56,12 +56,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: + hexStr = string.hexdigits + r = '' + for ch in str: i = ord(ch) r = r + hexStr[(i >> 4) & 0xF] + hexStr[i & 0xF] - return r + return r # hexify() # A function to calculate the md5 sum of a file @@ -188,7 +188,7 @@ def warn(msg): def find_binary(myc): - """look through the environmental path for an executable file named whatever myc is""" + """look through the environmental path for an executable file named whatever myc is""" # this sucks. badly. p=os.getenv("PATH") if p == None: diff --git a/modules/embedded_target.py b/modules/embedded_target.py index 98cab485..a088aadf 100644 --- a/modules/embedded_target.py +++ b/modules/embedded_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/embedded_target.py,v 1.17 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/embedded_target.py,v 1.18 2005/12/02 20:09:03 wolf31o2 Exp $ """ This class works like a 'stage3'. A stage2 tarball is unpacked, but instead @@ -19,7 +19,7 @@ from stat import * class embedded_target(generic_stage_target): - def __init__(self,spec,addlargs): + 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"]) @@ -50,5 +50,5 @@ class embedded_target(generic_stage_target): self.settings["destpath"]=normpath(self.settings["chroot_path"]+self.settings["root_path"]) def register(foo): - foo.update({"embedded":embedded_target}) - return foo + foo.update({"embedded":embedded_target}) + return foo diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 43533688..a751077e 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.86 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.87 2005/12/02 20:09:03 wolf31o2 Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -90,7 +90,7 @@ class generic_stage_target(generic_target): msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/") # call arch constructor, pass our settings - try: + try: self.arch=self.subarchmap[self.settings["subarch"]](self.settings) except: print "Invalid subarch: "+self.settings["subarch"] @@ -190,7 +190,7 @@ class generic_stage_target(generic_target): def override_chost(self): if os.environ.has_key("CHOST"): - self.settings["CHOST"] = os.environ["CHOST"] + self.settings["CHOST"] = os.environ["CHOST"] if self.settings.has_key("chost"): self.settings["CHOST"]=list_to_string(self.settings["chost"]) if self.makeconf.has_key("CHOST"): diff --git a/modules/grp_target.py b/modules/grp_target.py index 48639daf..fce16500 100644 --- a/modules/grp_target.py +++ b/modules/grp_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/grp_target.py,v 1.20 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/grp_target.py,v 1.21 2005/12/02 20:09:03 wolf31o2 Exp $ """ The builder class for GRP (Gentoo Reference Platform) builds. @@ -24,8 +24,8 @@ class grp_target(generic_stage_target): addlargs["grp"]=[addlargs["grp"]] if addlargs.has_key("grp/use"): - if type(addlargs["grp/use"])==types.StringType: - addlargs["grp/use"]=[addlargs["grp/use"]] + if type(addlargs["grp/use"])==types.StringType: + addlargs["grp/use"]=[addlargs["grp/use"]] for x in addlargs["grp"]: self.required_values.append("grp/"+x+"/packages") @@ -33,7 +33,7 @@ class grp_target(generic_stage_target): generic_stage_target.__init__(self,spec,addlargs) - def set_target_path(self): + 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"): diff --git a/modules/livecd_stage1_target.py b/modules/livecd_stage1_target.py index 3076abc0..56261193 100644 --- a/modules/livecd_stage1_target.py +++ b/modules/livecd_stage1_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.22 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.23 2005/12/02 20:09:03 wolf31o2 Exp $ """ Builder class for LiveCD stage1. @@ -23,7 +23,7 @@ class livecd_stage1_target(generic_stage_target): "config_profile_link","setup_confdir","portage_overlay",\ "bind","chroot_setup","setup_environment","build_packages",\ "unbind", "clean","clear_autoresume"] - def set_target_path(self): + 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"): @@ -45,8 +45,8 @@ class livecd_stage1_target(generic_stage_target): self.settings["spec_prefix"]="livecd" def set_use(self): - generic_stage_target.set_use(self) - self.settings["use"].append("livecd") + generic_stage_target.set_use(self) + self.settings["use"].append("livecd") def set_packages(self): generic_stage_target.set_packages(self) diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 9f4f9b8e..069deb9d 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.53 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.54 2005/12/02 20:09:03 wolf31o2 Exp $ """ Builder class for a LiveCD stage2 build. @@ -29,7 +29,7 @@ class livecd_stage2_target(generic_stage_target): generic_stage_target.__init__(self,spec,addlargs) if not self.settings.has_key("livecd/type"): - self.settings["livecd/type"] = "generic-livecd" + self.settings["livecd/type"] = "generic-livecd" file_locate(self.settings, ["cdtar","controller_file"]) @@ -71,7 +71,7 @@ class livecd_stage2_target(generic_stage_target): for x in self.settings["livecd/modblacklist"]: myf.write("\n"+x) myf.close() - def unpack(self): + def unpack(self): unpack=True clst_unpack_md5sum=read_from_clst(self.settings["autoresume_path"]+"unpack") diff --git a/modules/netboot_target.py b/modules/netboot_target.py index d6f72d85..673b37f7 100644 --- a/modules/netboot_target.py +++ b/modules/netboot_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/netboot_target.py,v 1.8 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/netboot_target.py,v 1.9 2005/12/02 20:09:03 wolf31o2 Exp $ """ Builder class for a netboot build. @@ -53,7 +53,7 @@ class netboot_target(generic_stage_target): self.settings[envvar] = "-Os -pipe" -# def set_root_path(self): +# def set_root_path(self): # # ROOT= variable for emerges # self.settings["root_path"]="/tmp/image" diff --git a/modules/stage1_target.py b/modules/stage1_target.py index f8f226ce..b3a1f420 100644 --- a/modules/stage1_target.py +++ b/modules/stage1_target.py @@ -1,57 +1,38 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.14 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.15 2005/12/02 20:09:03 wolf31o2 Exp $ """ -Builder class for a stage1 installation tarball build. +Builder class for a stage2 installation tarball build. """ from catalyst_support import * from generic_stage_target import * -class stage1_target(generic_stage_target): +class stage2_target(generic_stage_target): def __init__(self,spec,addlargs): self.required_values=[] self.valid_values=[] generic_stage_target.__init__(self,spec,addlargs) - - def set_stage_path(self): - self.settings["stage_path"]=normpath(self.settings["chroot_path"]+self.settings["root_path"]) - print "stage1 stage path is "+self.settings["stage_path"] def set_root_path(self): # ROOT= variable for emerges - self.settings["root_path"]=normpath("/tmp/stage1root") - print "stage1 root path is "+self.settings["root_path"] - def set_dest_path(self): - self.settings["destpath"]=normpath(self.settings["chroot_path"]+self.settings["root_path"]) - def set_cleanables(self): - generic_stage_target.set_cleanables(self) - self.settings["cleanables"].extend(["/usr/share/gettext","/usr/lib/python2.2/test", "/usr/lib/python2.2/encodings","/usr/lib/python2.2/email", "/usr/lib/python2.2/lib-tk","/usr/share/zoneinfo"]) - - def override_chost(self): - if os.environ.has_key("CHOST"): - self.settings["CHOST"] = os.environ["CHOST"] - if self.settings.has_key("chost"): - self.settings["CHOST"]=list_to_string(self.settings["chost"]) - - def override_cflags(self): - if os.environ.has_key("CFLAGS"): - self.settings["CFLAGS"] = os.environ["CFLAGS"] - if self.settings.has_key("cflags"): - self.settings["CFLAGS"]=list_to_string(self.settings["cflags"]) - - def override_cxxflags(self): - if os.environ.has_key("CXXFLAGS"): - self.settings["CXXFLAGS"] = os.environ["CXXFLAGS"] - if self.settings.has_key("cxxflags"): - self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"]) - - def override_ldflags(self): - if os.environ.has_key("LDFLAGS"): - self.settings["LDFLAGS"] = os.environ["LDFLAGS"] - if self.settings.has_key("ldflags"): - self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"]) + self.settings["root_path"]=normpath("/tmp/stage1root") + + def set_source_path(self): + self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/"+self.settings["root_path"]+"/") + + # reset the root path so the preclean doesnt fail + generic_stage_target.set_root_path(self) + + if os.path.isdir(self.settings["source_path"]): + print "\nUsing seed-stage from "+self.settings["source_path"] + print "Delete this folder if you wish to use a seed stage tarball instead\n" + else: + self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2") + if os.path.isfile(self.settings["source_path"]): + if os.path.exists(self.settings["source_path"]): + self.settings["source_path_md5sum"]=calc_md5(self.settings["source_path"]) def register(foo): - foo.update({"stage1":stage1_target}) + foo.update({"stage2":stage2_target}) return foo diff --git a/modules/stage4_target.py b/modules/stage4_target.py index 0f844533..50561dfa 100644 --- a/modules/stage4_target.py +++ b/modules/stage4_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.11 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.12 2005/12/02 20:09:03 wolf31o2 Exp $ """ Builder class for LiveCD stage1. @@ -19,10 +19,10 @@ class stage4_target(generic_stage_target): generic_stage_target.__init__(self,spec,addlargs) 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: + self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"])) + else: generic_stage_target.set_pkgcache_path(self) def set_cleanables(self): @@ -39,3 +39,4 @@ class stage4_target(generic_stage_target): def register(foo): foo.update({"stage4":stage4_target}) return foo + diff --git a/modules/tinderbox_target.py b/modules/tinderbox_target.py index c380c345..1636c8f9 100644 --- a/modules/tinderbox_target.py +++ b/modules/tinderbox_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/tinderbox_target.py,v 1.16 2005/12/02 19:37:02 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/tinderbox_target.py,v 1.17 2005/12/02 20:09:03 wolf31o2 Exp $ """ builder class for the tinderbox target @@ -21,14 +21,14 @@ class tinderbox_target(generic_stage_target): # example call: "grp.sh run xmms vim sys-apps/gleep" try: if os.path.exists(self.settings["controller_file"]): - cmd("/bin/bash "+self.settings["controller_file"]+" run "+\ + cmd("/bin/bash "+self.settings["controller_file"]+" run "+\ list_bashify(self.settings["tinderbox/packages"]),"run script failed.") except CatalystError: self.unbind() raise CatalystError,"Tinderbox aborting due to error." - def set_pkgcache_path(self): + 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"]))