From: Andrew Gaffney Date: Tue, 11 Mar 2008 02:59:15 +0000 (+0000) Subject: Apply additional patches from bug 207862 for CONTENTS generation X-Git-Tag: CATALYST_2_0_6_916~125 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=408ea4cf60cab7fbbac4f30accaa036c4754141f;p=catalyst.git Apply additional patches from bug 207862 for CONTENTS generation git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1369 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index dfab932b..90aa1a1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 11 Mar 2008; Andrew Gaffney + modules/catalyst_support.py, modules/generic_stage_target.py, + modules/grp_target.py: + Apply additional patches from bug 207862 for CONTENTS generation + 10 Mar 2008; Andrew Gaffney targets/grp/grp-chroot.sh: Call setup_myemergeopts after changing clst_FETCH diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 2861a64f..4c0769d6 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -74,10 +74,14 @@ def generate_contents(file,contents_function="auto",verbose=False): _ = 'tar-tvj' elif file.endswith('.tar'): _ = 'tar-tv' - - contents_function = _ - _ = contents_map[contents_function] - return _[0](file,_[1],verbose) + + if _ == 'auto': + warn('File %r has unknown type for automatic detection.' % (file, )) + return None + else: + contents_function = _ + _ = contents_map[contents_function] + return _[0](file,_[1],verbose) except: raise CatalystError,\ "Error generating contents, is appropriate utility (%s) installed on your system?" \ diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 7aefc350..3ec261eb 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1648,7 +1648,8 @@ class generic_stage_target(generic_target): for j in array: contents=generate_contents(file,contents_function=j,\ verbose=self.settings.has_key("VERBOSE")) - myf.write(contents) + if contents: + myf.write(contents) myf.close() def gen_digest_file(self,file): diff --git a/modules/grp_target.py b/modules/grp_target.py index ebaee604..b077d9c8 100644 --- a/modules/grp_target.py +++ b/modules/grp_target.py @@ -100,7 +100,7 @@ class grp_target(generic_stage_target): files=[filename for filename in files if filename[0] != '.'] for i in files: if os.path.isfile(normpath(destdir+"/"+i)): - self.gen_contents_file(normpath(destdir+"/"+i)) + #self.gen_contents_file(normpath(destdir+"/"+i)) self.gen_digest_file(normpath(destdir+"/"+i)) def set_action_sequence(self):