Apply additional patches from bug 207862 for CONTENTS generation
authorAndrew Gaffney <agaffney@gentoo.org>
Tue, 11 Mar 2008 02:59:15 +0000 (02:59 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Tue, 11 Mar 2008 02:59:15 +0000 (02:59 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1369 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/catalyst_support.py
modules/generic_stage_target.py
modules/grp_target.py

index dfab932b5c29e69d157f2235eceff9bfd82c2be3..90aa1a1a739371f140db1a63e33722d412a91ede 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  11 Mar 2008; Andrew Gaffney <agaffney@gentoo.org>
+  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 <agaffney@gentoo.org>
   targets/grp/grp-chroot.sh:
   Call setup_myemergeopts after changing clst_FETCH
index 2861a64fca1dbb4ea92b42181724c25c4acd296f..4c0769d62497e76385d10bcfb2b7a50bc9065d88 100644 (file)
@@ -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?" \
index 7aefc350242cb6cb1e5b2c5a4e6644bfd88517a7..3ec261ebcb4b86c725005521f1835bded463745a 100644 (file)
@@ -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):
index ebaee604148073c1a5148e7684a4dc4283b1bde1..b077d9c855b7f420df9dc1b0747d60b6b308f3ae 100644 (file)
@@ -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):