self.baseurl = ''
self.groupfile = None
self.sumtype = 'sha'
- self.noepoch = False #???
+ self.noepoch = False # hmm - maybe a fixme?
self.pretty = False
- self.cachedir = None
+ self.cachedir = None #deprecated
self.basedir = os.getcwd()
- self.use_cache = False
self.checkts = False
self.split = False
self.update = False
self.conf.directories = [self.conf.directory]
if not self.conf.directory: # ensure we have both in the config object
self.conf.directory = self.conf.directories[0]
+
+ # the cachedir thing:
+ if self.conf.cachedir:
+ self.conf.update = True
# this does the dir setup we need done
self._parse_directory()
timestamp = os.path.getctime(filepath)
if timestamp > self.conf.mdtimestamp:
self.conf.mdtimestamp = timestamp
+ if self.conf.groupfile:
+ a = self.conf.groupfile
+ if self.conf.split:
+ a = os.path.join(self.package_dir, self.conf.groupfile)
+ elif not os.path.isabs(a):
+ a = os.path.join(self.package_dir, self.conf.groupfile)
+
+ if not os.path.exists(a):
+ raise MDError, _('Error: groupfile %s cannot be found.' % a)
+
+ self.conf.groupfile = a
+
def _os_path_walk(self, top, func, arg):
"""Directory tree walk with callback function.
parser.add_option("-p", "--pretty", default=False, action="store_true",
help="make sure all xml generated is formatted")
parser.add_option("-c", "--cachedir", default=None,
- help="set path to cache dir")
+ help="enables --update as cachedir is MUCH slower")
parser.add_option("-C", "--checkts", default=False, action="store_true",
help="check timestamps on files vs the metadata to see if we need to update")
parser.add_option("-d", "--database", default=False, action="store_true",
directory = directories[0]
conf.directory = directory
conf.directories = directories
-
- # FIXME - I think this is unnecessary
- if not opts.outputdir:
- conf.outputdir = os.path.join(conf.basedir, directory)
- if conf.groupfile:
- a = conf.groupfile
- if conf.split:
- a = os.path.join(conf.basedir, directory, conf.groupfile)
- elif not os.path.isabs(a):
- a = os.path.join(conf.basedir, directory, conf.groupfile)
- # FIXME, move this test most likely inside the class
- if not os.path.exists(a):
- errorprint(_('Error: groupfile %s cannot be found.' % a))
- usage()
- conf.groupfile = a
- # FIXME - move this one inside the class, too
+
if conf.cachedir:
- conf.cache = True
- a = conf.cachedir
- if not os.path.isabs(a):
- a = os.path.join(conf.outputdir ,a)
- if not checkAndMakeDir(a):
- errorprint(_('Error: cannot open/write to cache dir %s' % a))
- parser.print_usage()
- conf.cachedir = a
+ conf.update = True
+
if conf.pkglist:
lst = []
pfo.close()
conf.pkglist = lst
-
return conf