[PATCH] set all cmds keys in parseArgs

Dennis Gregorovic <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
Attach is a patch that moves the initialization of some cmds keys from
the main method to the parseArgs method.  This makes it a lot easier to
use the genpkgmetadata.MetaDataGenerator class without needing main as
an entry point.  Plus, I think it just makes more sense for this action
to be in parseArgs.

Cheers
-- Dennis

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
default-args.patch (text/x-patch, 1.3 KB)
Index: genpkgmetadata.py
===================================================================
RCS file: /cvsroot/metadata/cvs-root/generate/genpkgmetadata.py,v
retrieving revision 1.47
diff -u -r1.47 genpkgmetadata.py
--- genpkgmetadata.py   8 Dec 2005 19:25:39 -0000   1.47
+++ genpkgmetadata.py   12 Jan 2006 19:49:25 -0000
@@ -416,2 +416,2 @@
         errorprint(_('Options Error: %s') % e)
         usage()

+    #setup some defaults
+    cmds['primaryfile'] = 'primary.xml.gz'
+    cmds['filelistsfile'] = 'filelists.xml.gz'
+    cmds['otherfile'] = 'other.xml.gz'
+    cmds['repomdfile'] = 'repomd.xml'
+    cmds['tempdir'] = '.repodata'
+    cmds['finaldir'] = 'repodata'
+    cmds['olddir'] = '.olddata'

     return cmds, directories

@@ -450,12 +458,3 @@
             errorprint(_('Error: cannot open/write to cache dir %s' % a))
             usage()
         cmds['cachdir'] = a
-
-    #setup some defaults
-    cmds['primaryfile'] = 'primary.xml.gz'
-    cmds['filelistsfile'] = 'filelists.xml.gz'
-    cmds['otherfile'] = 'other.xml.gz'
-    cmds['repomdfile'] = 'repomd.xml'
-    cmds['tempdir'] = '.repodata'
-    cmds['finaldir'] = 'repodata'
-    cmds['olddir'] = '.olddata'

     # start the sanity/stupidity checks
     if not os.path.exists(os.path.join(cmds['basedir'], directory)):
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.