Minor patch for createrepo (to allow .deb indexing)

"Javier Palacios" <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
Hello,

I'm working on a version of createrepo/yum able to work with debian packages.
The first change required is to search for .deb files instead of .rpm
extensions.
The patch I submit just replaces the explicit '.rpm' strings with a
variable so there is a single point to modify if we search for diffent
extensions.

Javier Palacios

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
pkgfile_extension.patch (text/x-patch, 1.8 KB)
diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index 22b7c85..7cc0e85 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -99,7 +99,7 @@ class MetaDataGenerator:
 
     def checkTimeStamps(self, directory):
         if self.cmds['checkts']:
-            files = self.getFileList(self.cmds['basedir'], directory, '.rpm')
+            files = self.getFileList(self.cmds['basedir'], directory, self.cmds['pkgext'])
             files = self.trimRpms(files)
             for f in files:
                 fn = os.path.join(self.cmds['basedir'], directory, f)
@@ -138,7 +138,7 @@ class MetaDataGenerator:
             #and scan the old repo
             self.oldData = readMetadata.MetadataIndex(self.cmds['outputdir'],
                                                       basefile, flfile, otherfile, opts)
-        files = self.getFileList(self.cmds['basedir'], directory, '.rpm')
+        files = self.getFileList(self.cmds['basedir'], directory, self.cmds['pkgext'])
         files = self.trimRpms(files)
         self.pkgcount = len(files)
         self.openMetadataDocs()
@@ -346,7 +346,7 @@ class SplitMetaDataGenerator(MetaDataGenerator):
             return
         filematrix = {}
         for mydir in directories:
-            filematrix[mydir] = self.getFileList(self.cmds['basedir'], mydir, '.rpm')
+            filematrix[mydir] = self.getFileList(self.cmds['basedir'], mydir, self.cmds['pkgext'])
             self.trimRpms(filematrix[mydir])
             self.pkgcount += len(filematrix[mydir])
 
@@ -414,6 +414,7 @@ def parseArgs(args):
     cmds['file-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']
     cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
     cmds['skip-symlinks'] = False
+    cmds['pkgext'] = '.rpm'
 
     try:
         gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CS', ['help', 'exclude=',
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.