update to 0.3.2
authorSeth Vidal <skvidal@linux.duke.edu>
Fri, 16 Apr 2004 05:10:34 +0000 (05:10 +0000)
committerSeth Vidal <skvidal@linux.duke.edu>
Fri, 16 Apr 2004 05:10:34 +0000 (05:10 +0000)
added -p or --pretty flag to make it pretty-print the xml output
not pretty printing the output makes the import a lot faster and the data
smaller

Makefile
createrepo.spec
genpkgmetadata.py

index b94e4433ed7cd3af4008b0bbad598ad4640b8058..b5f81913558c9290d65da2ed6fdcdf28562ab06c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 PACKAGE = createrepo
-VERSION = 0.3.1
+VERSION = 0.3.2
 SHELL = /bin/sh
 top_srcdir = .
 srcdir = .
index 77e04fc33ec8bc016175ad4586b88aae24203170..c829126b3bfd4e50ca6c69007babf4926f1570c5 100644 (file)
@@ -1,6 +1,6 @@
 Summary: Creates a common metadata repository
 Name: createrepo
-Version: 0.3.1
+Version: 0.3.2
 Release: 1
 License: GPL
 Group: System Environment/Base
@@ -33,6 +33,9 @@ rpm packages
 %{_bindir}/%{name}
 
 %changelog
+* Fri Apr 16 2004 Seth Vidal <skvidal@phy.duke.edu>
+- 0.3.2 - small addition of -p flag
+
 * Sun Jan 18 2004 Seth Vidal <skvidal@phy.duke.edu>
 - I'm an idiot
 
index 76aa93d0ad796892f0544c17fc7d11de0920ce5a..27ee3933a610383eb9f0f2f93a9739afbb5991a4 100755 (executable)
@@ -54,7 +54,7 @@ def usage():
      -s, --checksum = md5 or sha - select type of checksum to use (default: md5)
      -h, --help = show this help
      -V, --version = output version
-
+     -p, --pretty = output xml files in pretty format.
     """) % os.path.basename(sys.argv[0])
     
 
@@ -159,13 +159,14 @@ def parseArgs(args):
     cmds['baseurl'] = None
     cmds['groupfile'] = None
     cmds['sumtype'] = 'md5'
-
+    cmds['pretty'] = 0
 
     try:
-        gopts, argsleft = getopt.getopt(args, 'hqVvg:s:x:u:', ['help', 'exclude', 
+        gopts, argsleft = getopt.getopt(args, 'phqVvg:s:x:u:', ['help', 'exclude', 
                                                               'quiet', 'verbose', 
                                                               'baseurl=', 'groupfile=',
-                                                              'checksum=', 'version'])
+                                                              'checksum=', 'version',
+                                                              'pretty'])
     except getopt.error, e:
         errorprint(_('Options Error: %s.') % e)
         usage()
@@ -196,6 +197,8 @@ def parseArgs(args):
                     
             elif arg in ['-x', '--exclude']:
                 cmds['excludes'].append(a)
+            elif arg in ['-p', '--pretty']:
+                cmds['pretty'] = 1
             elif arg in ['-s', '--checksum']:
                 if a not in ['md5', 'sha']:
                     errorprint(_('Error: checksums are: md5 or sha.'))
@@ -275,7 +278,7 @@ def doPkgMetadata(cmds, ts):
                 errorprint(_('\nAn error occurred creating primary metadata: %s') % e)
                 continue
             else:
-                output = node.serialize(None, 1)
+                output = node.serialize(None, cmds['pretty'])
                 basefile.write(output)
                 basefile.write('\n')
                 node.unlinkNode()
@@ -288,7 +291,7 @@ def doPkgMetadata(cmds, ts):
                 errorprint(_('\nAn error occurred creating filelists: %s') % e)
                 continue
             else:
-                output = node.serialize(None, 1)
+                output = node.serialize(None, cmds['pretty'])
                 flfile.write(output)
                 flfile.write('\n')
                 node.unlinkNode()
@@ -301,7 +304,7 @@ def doPkgMetadata(cmds, ts):
                 errorprint(_('\nAn error occurred: %s') % e)
                 continue
             else:
-                output = node.serialize(None, 1)
+                output = node.serialize(None, cmds['pretty'])
                 otherfile.write(output)
                 otherfile.write('\n')
                 node.unlinkNode()