2 commits - createrepo/__init__.py

[email protected] Mon, 26 Nov 2012 13:33:53 +0000 (UTC)
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
--===============1144562191479657599==
Content-Type: text/plain

 createrepo/__init__.py |   23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

New commits:
commit 73400ac4a9717bcedb73902c7a510f3282e1a47b
Author: Zdeněk Pavlas <[email protected]>
Date:   Mon Nov 26 14:30:20 2012 +0100

    also fix os.isdir(), kill broken SplitMetadataGenerator.getFileList

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index ef51b14..b3a3c06 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -307,14 +307,13 @@ class MetaDataGenerator:
 
         def extension_visitor(filelist, dirname, names):
             for fn in names:
+                fn = os.path.join(dirname, fn)
                 if os.path.isdir(fn):
                     continue
-                if self.conf.skip_symlinks and os.path.islink(os.path.join(dirname, fn)):
+                if self.conf.skip_symlinks and os.path.islink(fn):
                     continue
                 elif fn[-extlen:].lower() == '%s' % (ext):
-                    relativepath = dirname.replace(startdir, "", 1)
-                    relativepath = relativepath.lstrip("/")
-                    filelist.append(os.path.join(relativepath, fn))
+                    filelist.append(fn[len(startdir):])
 
         filelist = []
         startdir = directory + '/'
@@ -1263,24 +1262,6 @@ class SplitMetaDataGenerator(MetaDataGenerator):
         (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)
         return urlparse.urlunsplit((scheme, netloc, path, query, str(fragment)))
 
-    def getFileList(self, directory, ext):
-
-        extlen = len(ext)
-
-        def extension_visitor(arg, dirname, names):
-            for fn in names:
-                if os.path.isdir(fn):
-                    continue
-                elif fn[-extlen:].lower() == '%s' % (ext):
-                    reldir = os.path.basename(dirname)
-                    if reldir == os.path.basename(directory):
-                        reldir = ""
-                    arg.append(os.path.join(reldir, fn))
-
-        rpmlist = []
-        os.path.walk(directory, extension_visitor, rpmlist)
-        return rpmlist
-
     def doPkgMetadata(self):
         """all the heavy lifting for the package metadata"""
         if len(self.conf.directories) == 1:
commit 7d15b5722db547ef6d61736641e4e47f255b34b0
Author: Tomas Mlcoch <[email protected]>
Date:   Tue Jun 5 15:12:48 2012 +0200

    Fix --skip-symlinks

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 167d384..ef51b14 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -309,7 +309,7 @@ class MetaDataGenerator:
             for fn in names:
                 if os.path.isdir(fn):
                     continue
-                if self.conf.skip_symlinks and os.path.islink(fn):
+                if self.conf.skip_symlinks and os.path.islink(os.path.join(dirname, fn)):
                     continue
                 elif fn[-extlen:].lower() == '%s' % (ext):
                     relativepath = dirname.replace(startdir, "", 1)

--===============1144562191479657599==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Rpm-metadata mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/rpm-metadata

--===============1144562191479657599==--