Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 43655 Details for
Bug 70663
Separate specific target logic out of the generic targets modules
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The second patch in this set that finishes cleaning specific target information in a generic target class ... fixes a bug found in the previous patch
catalyst_patch2a.patch (text/plain), 12.59 KB, created by
Eric Edgar (RETIRED)
on 2004-11-10 07:00:19 UTC
(
hide
)
Description:
The second patch in this set that finishes cleaning specific target information in a generic target class ... fixes a bug found in the previous patch
Filename:
MIME Type:
Creator:
Eric Edgar (RETIRED)
Created:
2004-11-10 07:00:19 UTC
Size:
12.59 KB
patch
obsolete
>diff -urN catalyst/catalyst catalyst.new/catalyst >--- catalyst/catalyst 2004-10-28 10:08:19.000000000 -0500 >+++ catalyst.new/catalyst 2004-11-10 08:03:05.417298117 -0600 >@@ -287,5 +287,5 @@ > try: > build_target(addlargs, targetmap) > except: >- print "!!! catalyst: could not complete build" >+ raise CatalystError,"could not complete build" > sys.exit(2) >Files catalyst/modules/builder.pyc and catalyst.new/modules/builder.pyc differ >diff -urN catalyst/modules/catalyst_support.py catalyst.new/modules/catalyst_support.py >--- catalyst/modules/catalyst_support.py 2004-10-28 10:08:19.000000000 -0500 >+++ catalyst.new/modules/catalyst_support.py 2004-11-10 08:10:11.269372555 -0600 >@@ -43,6 +43,9 @@ > if message: > print > print "!!! catalyst: "+message >+ >+ #Uncomment the line below if you need more detailed debugging messages >+ #raise > > def die(msg=None): > warn(msg) >Files catalyst/modules/catalyst_support.pyc and catalyst.new/modules/catalyst_support.pyc differ >diff -urN catalyst/modules/embedded_target.py catalyst.new/modules/embedded_target.py >--- catalyst/modules/embedded_target.py 2004-10-28 10:08:19.000000000 -0500 >+++ catalyst.new/modules/embedded_target.py 2004-11-09 19:59:02.000000000 -0600 >@@ -67,6 +67,15 @@ > self.unbind() > raise CatalystError, "embedded runscript aborting due to error." > >+ def set_action_sequence(self): >+ self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ "setup_environment","run_local","unbind","capture"] >+ >+ def set_use(self): >+ self.settings["use"]=self.settings["grp/use"] >+ def set_stage_path(self): >+ self.settings["stage_path"]=+self.settings["chroot_path"]+"/tmp/mergeroot" >+ print "embedded stage path is "+self.settings["stage_path"] > def register(foo): > foo.update({"embedded":embedded_target}) > return foo >diff -urN catalyst/modules/generic_stage_target.py catalyst.new/modules/generic_stage_target.py >--- catalyst/modules/generic_stage_target.py 2004-11-09 17:46:53.000000000 -0600 >+++ catalyst.new/modules/generic_stage_target.py 2004-11-10 08:02:00.191089362 -0600 >@@ -104,7 +104,10 @@ > self.set_target_path() > self.set_source_path() > self.set_chroot_path() >- >+ self.set_action_sequence() >+ self.set_use() >+ self.set_stage_path() >+ > # this next line checks to make sure that the specified variables exist on disk. > file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0) > >@@ -116,9 +119,7 @@ > self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage/distfiles" ] > self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\ > "/usr/portage/distfiles":self.settings["distdir"]} >- if self.settings["target"]=="grp": >- self.mounts.append("/tmp/grp") >- self.mountmap["/tmp/grp"]=self.settings["target_path"] >+ self.set_mounts() > > # configure any user specified options (either in catalyst.conf or on the cmdline) > if self.settings.has_key("PKGCACHE"): >@@ -158,6 +159,17 @@ > > def set_chroot_path(self): > self.settings["chroot_path"]=self.settings["storedir"]+"/tmp/"+self.settings["target_subpath"] >+ >+ def set_action_sequence(self): >+ #Default action sequence for run method >+ self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ "setup_environment","run_local","preclean","unbind","clean","capture"] >+ >+ def set_use(self): >+ pass >+ >+ def set_stage_path(self): >+ self.settings["stage_path"]=self.settings["chroot_path"] > > def mount_safety_check(self): > mypath=self.settings["chroot_path"] >@@ -193,7 +205,7 @@ > print "Setting up directories..." > self.mount_safety_check() > >- if not self.settings["target"] == "livecd-stage2": >+ if os.path.exists(self.settings["chroot_path"]): > cmd("rm -rf "+self.settings["chroot_path"],\ > "Could not remove existing directory: "+self.settings["chroot_path"]) > >@@ -295,36 +307,22 @@ > myf.write("# Please consult /etc/make.conf.example for a more detailed example\n") > myf.write('CFLAGS="'+self.settings["CFLAGS"]+'"\n') > myf.write('CHOST="'+self.settings["CHOST"]+'"\n') >- > # figure out what our USE vars are for building > myusevars=[] > if self.settings.has_key("HOSTUSE"): > myusevars.extend(self.settings["HOSTUSE"]) >- >- if self.settings["target"]=="grp": >- myusevars.append("bindist") >- myusevars.extend(self.settings["grp/use"]) >- myf.write('USE="'+string.join(myusevars)+'"\n') >- >- elif self.settings["target"]=="tinderbox": >- myusevars.extend(self.settings["tinderbox/use"]) >- myf.write('USE="'+string.join(myusevars)+'"\n') >- >- elif self.settings["target"]=="livecd-stage1": >- myusevars.extend(self.settings["livecd/use"]) >- myf.write('USE="'+string.join(myusevars)+'"\n') >- >- elif self.settings["target"]=="embedded": >- myusevars.extend(self.settings["embedded/use"]) >+ >+ if self.settings.has_key("use"): >+ myusevars.extend(self.settings["use"]) > myf.write('USE="'+string.join(myusevars)+'"\n') >- >+ > if self.settings.has_key("CXXFLAGS"): > myf.write('CXXFLAGS="'+self.settings["CXXFLAGS"]+'"\n') > > else: > myf.write('CXXFLAGS="${CFLAGS}"\n') > myf.close() >- >+ > def clean(self): > destpath=self.settings["chroot_path"] > >@@ -371,17 +369,8 @@ > > print "Creating stage tarball..." > >- if self.settings["target"]=="stage1": >- cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+\ >- "/tmp/stage1root .","Couldn't create stage tarball") >- >- elif self.settings["target"]=="embedded": >- cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+\ >- "/tmp/mergeroot .","Couldn't create stage tarball") >- >- else: >- cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["chroot_path"]+\ >- " .","Couldn't create stage tarball") >+ cmd("tar cjf "+self.settings["target_path"]+" -C "+self.settings["stage_path"]+\ >+ " .","Couldn't create stage tarball") > > def run_local(self): > try: >@@ -391,17 +380,8 @@ > except CatalystError: > self.unbind() > raise CatalystError,"Stage build aborting due to error." >- >- def run(self): >- self.dir_setup() >- self.unpack_and_bind() >- try: >- self.chroot_setup() >- >- except: >- self.unbind() >- raise >- >+ >+ def setup_environment(self): > # modify the current environment. This is an ugly hack that should be fixed. We need this > # to use the os.system() call since we can't specify our own environ: > for x in self.settings.keys(): >@@ -413,24 +393,15 @@ > os.environ[varname]=self.settings[x] > elif type(self.settings[x])==types.ListType: > os.environ[varname]=string.join(self.settings[x]) >- >- self.run_local() >- if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage1","livecd-stage2"]: >- self.preclean() >- >- if self.settings["target"] in ["livecd-stage2"]: >- self.unmerge() >- >- # unbind everything here so that we can clean() >- self.unbind() >- >- if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage1","livecd-stage2"]: >- # clean is for removing things after bind-mounts are >- # unmounted (general file removal and cleanup) >- self.clean() >- >- if self.settings["target"] in ["stage1","stage2","stage3","embedded"]: >- self.capture() >+ >+ def run(self): > >- if self.settings["target"] in ["livecd-stage2"]: >- self.cdroot_setup() >+ for x in self.settings["action_sequence"]: >+ print "Running action sequence: "+x >+ if x == 'chroot_setup': >+ try: >+ self.chroot_setup() >+ except: >+ self.unbind() >+ else: >+ apply(getattr(self,x)) >diff -urN catalyst/modules/grp_target.py catalyst.new/modules/grp_target.py >--- catalyst/modules/grp_target.py 2004-11-09 17:46:53.000000000 -0600 >+++ catalyst.new/modules/grp_target.py 2004-11-10 08:54:23.114298465 -0600 >@@ -45,6 +45,18 @@ > self.unbind() > raise CatalystError,"GRP build aborting due to error." > >+ def set_action_sequence(self): >+ self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ "setup_environment","run_local","unbind"] >+ >+ def set_use(self): >+ self.settings["use"]=self.settings["grp/use"] >+ self.settings["use"].append("bindlist") >+ >+ def set_mounts(self): >+ self.mounts.append("/tmp/grp") >+ self.mountmap["/tmp/grp"]=self.settings["target_path"] >+ > def register(foo): > foo.update({"grp":grp_target}) > return foo >diff -urN catalyst/modules/livecd_stage1_target.py catalyst.new/modules/livecd_stage1_target.py >--- catalyst/modules/livecd_stage1_target.py 2004-10-28 10:08:19.000000000 -0500 >+++ catalyst.new/modules/livecd_stage1_target.py 2004-11-09 18:52:41.000000000 -0600 >@@ -24,6 +24,13 @@ > except CatalystError: > self.unbind() > raise CatalystError,"LiveCD stage1 build aborting due to error." >+ def set_action_sequence(self): >+ #self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ # "setup_environment","run_local","preclean","unbind","clean"] >+ self.settings["action_sequence"]=["chroot_setup"] >+ >+ def set_use(self): >+ self.settings["use"]=self.settings["livecd/use"] > > def register(foo): > foo.update({"livecd-stage1":livecd_stage1_target}) >diff -urN catalyst/modules/livecd_stage2_target.py catalyst.new/modules/livecd_stage2_target.py >--- catalyst/modules/livecd_stage2_target.py 2004-11-09 17:46:53.000000000 -0600 >+++ catalyst.new/modules/livecd_stage2_target.py 2004-11-10 08:53:55.606427730 -0600 >@@ -91,11 +91,25 @@ > #self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"] > > def set_source_path(self): >- self.settings["source_path"]=self.settings["storedir"]+"/builds/"+self.settings["source_subpath"] >+ self.settings["source_path"]=self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"] > > def set_cdroot_path(self): > self.settings["cdroot_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"] > >+ def dir_setup(self): >+ print "Setting up directories..." >+ self.mount_safety_check() >+ >+ if not os.path.exists(self.settings["chroot_path"]+"/tmp"): >+ os.makedirs(self.settings["chroot_path"]+"/tmp") >+ >+ if not os.path.exists(self.settings["chroot_path"]): >+ os.makedirs(self.settings["chroot_path"]) >+ >+ if self.settings.has_key("PKGCACHE"): >+ if not os.path.exists(self.settings["pkgcache_path"]): >+ os.makedirs(self.settings["pkgcache_path"]) >+ > def unmerge(self): > if self.settings.has_key("AUTORESUME") \ > and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_unmerge"): >@@ -310,6 +324,10 @@ > if self.settings.has_key("livecd/root_overlay"): > cmd("rsync -a "+self.settings["livecd/root_overlay"]+"/* "+\ > self.settings["chroot_path"], "livecd/root_overlay copy failed.") >+ def set_action_sequence(self): >+ self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ "setup_environment","run_local","preclean","unmerge",\ >+ "unbind","clean","cdroot_setup"] > > def register(foo): > foo.update({"livecd-stage2":livecd_stage2_target}) >diff -urN catalyst/modules/netboot.py catalyst.new/modules/netboot.py >--- catalyst/modules/netboot.py 2004-11-09 17:46:53.000000000 -0600 >+++ catalyst.new/modules/netboot.py 2004-11-09 16:26:41.000000000 -0600 >@@ -142,6 +142,10 @@ > print "netboot: build finished !" > > >+ def set_action_sequence(self): >+ self.settings["action_sequence"]=["dir_setup","unpack_and_bind","chroot_setup",\ >+ "setup_environment","run_local","unbind"] >+ > def register(foo): > foo.update({"netboot":netboot_target}) > return foo >diff -urN catalyst/modules/stage1_target.py catalyst.new/modules/stage1_target.py >--- catalyst/modules/stage1_target.py 2004-10-28 10:08:19.000000000 -0500 >+++ catalyst.new/modules/stage1_target.py 2004-11-09 19:59:35.000000000 -0600 >@@ -14,6 +14,10 @@ > self.required_values=[] > self.valid_values=[] > generic_stage_target.__init__(self,spec,addlargs) >+ >+ def set_stage_path(self): >+ self.settings["stage_path"]=self.settings["chroot_path"]+"/tmp/stage1root" >+ print "stage1 stage path is "+self.settings["stage_path"] > > def register(foo): > foo.update({"stage1":stage1_target}) >diff -urN catalyst/modules/tinderbox_target.py catalyst.new/modules/tinderbox_target.py >--- catalyst/modules/tinderbox_target.py 2004-11-09 17:46:53.000000000 -0600 >+++ catalyst.new/modules/tinderbox_target.py 2004-11-09 18:46:13.000000000 -0600 >@@ -29,7 +29,8 @@ > > def set_target_path(self): > self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"] >- >+ def set_use(self): >+ self.settings["use"]=self.settings["tinderbox/use"] > def register(foo): > foo.update({"tinderbox":tinderbox_target}) > return foo
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 70663
:
43653
|
43654
|
43655
|
43662
|
43664
|
43729
|
47598
|
47624