[Rpm-metadata] 2 commits - createrepo/yumbased.py genpkgmetadata.py

Seth Vidal skvidal at linux.duke.edu
Mon Jan 7 16:22:50 UTC 2008


 createrepo/yumbased.py |   71 -------------------------------------------------
 genpkgmetadata.py      |    9 +-----
 2 files changed, 2 insertions(+), 78 deletions(-)

New commits:
commit 2e231b2841c9bbe7c2c7efd20b408c4774532a6e
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Jan 7 11:21:23 2008 -0500

    - clean out old classes from yumbased.py
    - clean out debug prints from genpkgmetadata.py

diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
index ec6db90..e371eb1 100644
--- a/createrepo/yumbased.py
+++ b/createrepo/yumbased.py
@@ -304,75 +304,4 @@ class CreateRepoPackage(YumLocalPackage):
        
         
            
-class YumCreateRepo(object):
-    def __init__(self):
-        self.ts = initReadOnlyTransaction()
-        self.pkglist = []
-        self.conf = CreateRepoConfig()
-        
-    def add_package(self, rpmfile):
-        # take a file
-        # check it to make sure it:
-        # exists and is an rpm
-        # can be opened
-        # whatever else
-        if not os.path.exists(rpmfile):
-            return False
-
-        self.pkglist.append(rpmfile)
-        return True
-                      
-            
-    def read_in_package(self, rpmfile):
-        # XXX fixme try/excepts here
-        po = CreateRepoPackage(self.ts, rpmfile)
-        return po
-
-    def dump_metadata(self, pkglist=None):
-        if pkglist is None:
-            pkglist = self.pkglist
-            
-        primary = open('primary-test.xml', 'w')
-        primary.write("""<?xml version="1.0" encoding="UTF-8"?>
-<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="%d">""" % len(pkglist))
-        
-        filelists = open('filelists-test.xml', 'w')
-        filelists.write("""<?xml version="1.0" encoding="UTF-8"?>
-<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="%s">""" % len(pkglist))
-
-        other = open('other-test.xml', 'w')
-        other.write("""<?xml version="1.0" encoding="UTF-8"?>
-<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="%s">""" % len(pkglist))
 
-                        
-        for pkg in pkglist:
-            po = self.read_in_package(pkg)
-            primary.write(po.do_primary_xml_dump())
-            filelists.write(po.do_filelists_xml_dump())
-            other.write(po.do_other_xml_dump())
-       
-        
-        primary.write("\n</metadata>\n")
-        primary.close()
-        filelists.write("\n</filelists>\n")
-        filelists.close()
-        other.write("\n</otherdata>\n")
-        other.close()
-
-
-def main(args):
-   ycr = YumCreateRepo()
-   # parseargs get the path for the output and opts
-   #
-   # determine package lists
-   
-   # make metadata
-   
-   for pkg in args:
-       ycr.add_package(pkg)
-   ycr.dump_metadata()
-       
-if __name__ == "__main__":
-    main(sys.argv[1:])
-    
-       
diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index edb99cf..bd71a4c 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -89,9 +89,7 @@ def parseArgs(args, conf):
         setattr(conf, opt.dest, getattr(opts, opt.dest))
     
     directory = directories[0]
-    print directory
     directory = os.path.normpath(directory)
-    print directory
     if conf.split:
         pass
     elif os.path.isabs(directory):
@@ -100,9 +98,7 @@ def parseArgs(args, conf):
     else:
         conf.basedir = os.path.realpath(conf.basedir)
 
-    print directory
-    print conf.basedir    
-    
+   
     if not opts.outputdir:
         conf.outputdir = os.path.join(conf.basedir, directory)
     if conf.groupfile:
commit d6b48dd179c64539cdd7c06f37faa19027fc4c02
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Jan 7 11:15:30 2008 -0500

    make the version stuff make sense

diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index 6b3bd7f..edb99cf 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -32,7 +32,6 @@ import createrepo.utils
 
 from createrepo.utils import _gzipOpen, errorprint, _, checkAndMakeDir
 
-__version__ = '0.9'
 
 def parseArgs(args, conf):
     """
@@ -40,7 +39,7 @@ def parseArgs(args, conf):
        Sanity check all the things being passed in.
     """
     
-    parser = OptionParser(version = "createrepo %s" % __version__)
+    parser = OptionParser(version = "createrepo %s" % createrepo.__version__)
     # query options
     parser.add_option("-q", "--quiet", default=False, action="store_true",
                       help="output nothing except for serious errors")



More information about the Rpm-metadata mailing list