def trimRpms(self, files):
badrpms = []
- for file in files:
+ for rpm_file in files:
for glob in self.conf.excludes:
- if fnmatch.fnmatch(file, glob):
- if file not in badrpms:
- badrpms.append(file)
- for file in badrpms:
- if file in files:
- files.remove(file)
+ if fnmatch.fnmatch(rpm_file, glob):
+ if rpm_file not in badrpms:
+ badrpms.append(rpm_file)
+ for rpm_file in badrpms:
+ if rpm_file in files:
+ files.remove(rpm_file)
return files
def _setup_old_metadata_lookup(self):
dbversion = '9'
rp = sqlitecachec.RepodataParserSqlite(repopath, repoid, None)
- for (file, ftype) in workfiles:
- complete_path = os.path.join(repopath, file)
+ for (rpm_file, ftype) in workfiles:
+ complete_path = os.path.join(repopath, rpm_file)
zfo = _gzipOpen(complete_path)
uncsum = misc.checksum(sumtype, zfo)
location.newProp('xml:base', self.conf.baseurl)
if self.conf.unique_md_filenames:
res_file = '%s-%s.xml.gz' % (csum, ftype)
- orig_file = os.path.join(repopath, file)
+ orig_file = os.path.join(repopath, rpm_file)
dest_file = os.path.join(repopath, res_file)
os.rename(orig_file, dest_file)
else:
- res_file = file
+ res_file = rpm_file
- file = res_file
+ rpm_file = res_file
- location.newProp('href', os.path.join(self.conf.finaldir, file))
+ location.newProp('href', os.path.join(self.conf.finaldir, rpm_file))
if not self.conf.quiet and self.conf.database: self.callback.log('Sqlite DBs complete')
raise MDError, "Error opening file"
return fdno
-def checkAndMakeDir(dir):
+def checkAndMakeDir(directory):
"""
- check out the dir and make it, if possible, return 1 if done, else return 0
+ check out the directory and make it, if possible, return 1 if done, else return 0
"""
- if os.path.exists(dir):
- if not os.path.isdir(dir):
- #errorprint(_('%s is not a dir') % dir)
+ if os.path.exists(directory):
+ if not os.path.isdir(directory):
+ #errorprint(_('%s is not a dir') % directory)
result = False
else:
- if not os.access(dir, os.W_OK):
- #errorprint(_('%s is not writable') % dir)
+ if not os.access(directory, os.W_OK):
+ #errorprint(_('%s is not writable') % directory)
result = False
else:
result = True
else:
try:
- os.mkdir(dir)
+ os.mkdir(directory)
except OSError, e:
- #errorprint(_('Error creating dir %s: %s') % (dir, e))
+ #errorprint(_('Error creating dir %s: %s') % (directory, e))
result = False
else:
result = True