Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310947 Details for
Bug 442132
Sabayon errors when saving profiles
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch based on upstream code
sabayon-recursive-zip_directory.patch (text/plain), 4.48 KB, created by
ritz
on 2008-07-03 18:35:38 UTC
(
hide
)
Description:
patch based on upstream code
Filename:
MIME Type:
Creator:
ritz
Created:
2008-07-03 18:35:38 UTC
Size:
4.48 KB
patch
obsolete
>diff -Naur sabayon-2.12.4/lib/sources/filessource.py sabayon-2.12.4.orig/lib/sources/filessource.py >--- sabayon-2.12.4/lib/sources/filessource.py 2008-05-31 10:35:49.000000000 +0530 >+++ sabayon-2.12.4.orig/lib/sources/filessource.py 2008-05-31 10:34:27.000000000 +0530 >@@ -137,10 +137,10 @@ > > def __apply_foreach (self, source, path): > attributes = self.storage.get_attributes (path) >+ mandatory = False > if attributes.has_key ("mandatory"): >- mandatory = bool (attributes ["mandatory"]) >- else: >- mandatory = False >+ if attributes["mandatory"].lower() == "true": >+ mandatory = True > > self.storage.extract (path, self.home_dir, mandatory) > >diff -Naur sabayon-2.12.4/lib/storage.py sabayon-2.12.4.orig/lib/storage.py >--- sabayon-2.12.4/lib/storage.py 2008-05-31 10:35:49.000000000 +0530 >+++ sabayon-2.12.4.orig/lib/storage.py 2008-05-31 10:28:08.000000000 +0530 >@@ -51,7 +51,7 @@ > > try: > dprint ("Making dir %s", os.path.join (dst_base, dst_name)) >- os.mkdir (os.path.join (dst_base, dst_name)) >+ os.makedirs (os.path.join (dst_base, dst_name)) > except OSError, err: > if err.errno != errno.EEXIST: > raise err >@@ -591,14 +591,32 @@ > save_zip.writestr ("metadata", self.metadata.serialize (format = 1)) > > def zip_directory (save_zip, dir, name): >+ zip_filelist = save_zip.namelist() >+ homedir = util.get_home_dir() >+ > for f in os.listdir (dir): > path = os.path.join (dir, f) > if os.path.isdir (path): >- zip_directory (save_zip, >- path, >- os.path.join (name, f)) >+ # We need to stop if we are recursing inside a ignored >+ # directory. >+ if util.should_ignore_dir (homedir, >+ DIRECTORIES_TO_IGNORE, os.path.join(homedir, name, f)): >+ dprint ("Not going inside %s as it is an ignored directory.", path) >+ else: >+ zip_directory (save_zip, >+ path, >+ os.path.join (name, f)) > elif os.path.isfile (path): >- save_zip.write (path, os.path.join (name, f)) >+ # Avoid putting in a duplicate file entry >+ # See bug #476761 >+ if os.path.join (name, f) in zip_filelist: >+ dprint ("Not adding %s to zipfile since it is already in the file", os.path.join (name, f)) >+ elif util.should_ignore_file (homedir, >+ DIRECTORIES_TO_IGNORE, FILES_TO_IGNORE, os.path.join(homedir, name, f)): >+ dprint ("Not adding %s to zipfile since it is a ignored file", os.path.join (name, f)) >+ else: >+ zip_filelist.append(os.path.join(name, f)) >+ save_zip.write (path, os.path.join (name, f)) > > def zip_foreach (path, is_directory, data): > (save_zip, temp_path) = data >--- sabayon-2.12.4.orig/lib/util.py 2006-07-28 00:38:45.000000000 +0530 >+++ sabayon-2.12.4/lib/util.py 2008-05-31 10:54:56.000000000 +0530 >@@ -19,6 +19,7 @@ > import os > import os.path > import sys >+import fnmatch > import pwd > import gettext > import locale >@@ -367,4 +368,28 @@ > for k in _mod.keys(): > print " %s=%s" % (k, _mod[k]) > >+def should_ignore_dir (base_dir, ignore_dir_list, dir): >+ dir = os.path.normpath (dir) > >+ for ignore_dir in ignore_dir_list: >+ ignore_path = os.path.normpath (os.path.join (base_dir, ignore_dir)) >+ >+ if fnmatch.fnmatch (dir, ignore_path): >+ return True >+ >+ parent = os.path.dirname (dir) >+ if parent != dir: >+ return should_ignore_dir (base_dir, ignore_dir_list, parent) >+ else: >+ return False >+ >+def should_ignore_file (base_dir, ignore_dir_list, ignore_file_list, file): >+ file = os.path.normpath (file) >+ >+ for ignore_file in ignore_file_list: >+ ignore_path = os.path.normpath (os.path.join (base_dir, ignore_file)) >+ >+ if fnmatch.fnmatch (file, ignore_path): >+ return True >+ >+ return should_ignore_dir (base_dir, ignore_dir_list, os.path.dirname (file))
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 442132
: 310947