summaryrefslogtreecommitdiffstats
path: root/createprestorepo/genprestometadata.py
diff options
context:
space:
mode:
authorJonathan Dieter <jdieter@gmail.com>2007-04-03 16:26:09 +0300
committerJonathan Dieter <jdieter@gmail.com>2007-04-03 16:26:09 +0300
commitbdfb4037667c6af7d0537f9bc36b33d55d86e059 (patch)
tree7a437ab002f05fe3a6cb8421a4137757fd01df2c /createprestorepo/genprestometadata.py
parent20a630be934db6374ace720e473beb1ec05e31fc (diff)
downloadpresto-bdfb4037667c6af7d0537f9bc36b33d55d86e059.zip
presto-bdfb4037667c6af7d0537f9bc36b33d55d86e059.tar.gz
presto-bdfb4037667c6af7d0537f9bc36b33d55d86e059.tar.xz
Add Ahmed's patch to rebuild rpms in separate thread.
Complete rebuild of createprestorepo Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Diffstat (limited to 'createprestorepo/genprestometadata.py')
-rwxr-xr-x[-rw-r--r--]createprestorepo/genprestometadata.py37
1 files changed, 8 insertions, 29 deletions
diff --git a/createprestorepo/genprestometadata.py b/createprestorepo/genprestometadata.py
index 402af25..9d7a7a8 100644..100755
--- a/createprestorepo/genprestometadata.py
+++ b/createprestorepo/genprestometadata.py
@@ -62,6 +62,7 @@ class MetaDataGenerator:
self.cmds = cmds
self.ts = rpm.TransactionSet()
self.pkgcount = 0
+ self.newrpms = {}
self.files = []
def getFileList(self, basepath, path, ext, filelist):
@@ -87,7 +88,7 @@ class MetaDataGenerator:
filelist.append(os.path.join(relativepath, d))
else:
raise "basepath '%s' not found in path '%s'" % (basepath, totalpath)
-
+
return filelist
@@ -108,7 +109,7 @@ class MetaDataGenerator:
"""all the heavy lifting for the package metadata"""
# rpms we're going to be dealing with
- files = self.getFileList(self.cmds['basedir'], directory, '.dpm', [])
+ files = self.getFileList(self.cmds['basedir'], directory, '.drpm', [])
files = self.trimRpms(files)
self.pkgcount = len(files)
self.openMetadataDocs()
@@ -150,18 +151,10 @@ class MetaDataGenerator:
continue
else:
try:
- node = dumpMetadata.generateXML(self.prestodoc, self.prestoroot, self.formatns, mdobj, self.cmds['sumtype'])
+ dumpMetadata.generateXML(self.prestodoc, self.prestoroot, self.formatns, mdobj, self.cmds['sumtype'], self.newrpms)
except dumpMetadata.MDError, e:
errorprint(_('\nAn error occurred creating presto metadata: %s') % e)
continue
- else:
- output = node.serialize('UTF-8', self.cmds['pretty'])
- self.prestofile.write(output)
- self.prestofile.write('\n')
- node.unlinkNode()
- node.freeNode()
- del node
-
return current
@@ -172,7 +165,10 @@ class MetaDataGenerator:
# save them up to the tmp locations:
if not self.cmds['quiet']:
print _('Saving Presto metadata')
- self.prestofile.write('\n</metadata>')
+ output = self.prestoroot.serialize('UTF-8', self.cmds['pretty'])
+ output = output[output.find("\n")+1:]
+ self.prestofile.write(output)
+ self.prestofile.write("\n")
self.prestofile.close()
self.prestodoc.freeDoc()
@@ -357,16 +353,6 @@ def parseArgs(args):
directory = '.'
if not cmds['outputdir']:
cmds['outputdir'] = cmds['basedir']
- if cmds['groupfile']:
- a = cmds['groupfile']
- if cmds['split']:
- a = os.path.join(cmds['basedir'], directory, cmds['groupfile'])
- elif not os.path.isabs(a):
- a = os.path.join(cmds['basedir'], cmds['groupfile'])
- if not os.path.exists(a):
- errorprint(_('Error: groupfile %s cannot be found.' % a))
- usage()
- cmds['groupfile'] = a
if cmds['cachedir']:
a = cmds ['cachedir']
if not os.path.isabs(a):
@@ -467,13 +453,6 @@ def main(args):
errorprint(_('Error was %s') % e)
sys.exit(1)
- # Clean up any update metadata
- mdpath = os.path.join(cmds['basedir'], cmds['olddir'], cmds['update-info-dir'])
- if os.path.isdir(mdpath):
- for file in os.listdir(mdpath):
- os.remove(os.path.join(mdpath, file))
- os.rmdir(mdpath)
-
#XXX: fix to remove tree as we mung basedir
try: