all=~/deb/gits/pkg-exppsy/neurodebian/future/blends/*
~/deb/gits/*/debian/blends
~/deb/gits/pkg-exppsy/*/debian/blends
+ # Python regular expression on which files to skip
+ # Default is listed below
+ #skip=.*[~#]$
Format of debian/blends
__author__ = 'Yaroslav Halchenko'
__prog__ = os.path.basename(sys.argv[0])
-__version__ = '0.0.5'
+__version__ = '0.0.6'
__copyright__ = 'Copyright (c) 2010 Yaroslav Halchenko'
__license__ = 'GPL'
print "Subject: %s\n\n%s" % (subject, body)
+def is_template(p):
+ """Helper to return true if pkg definition looks like a template
+ and should not be processed
+ """
+ # We might want to skip some which define a skeleton
+ # (no source/homepage/etc although fields are there)
+ for f in ['vcs-browser', 'pkg-url', 'pkg-description',
+ 'published-Title', 'pkg-name', 'homepage',
+ 'author']:
+ if f in p and p[f] != "":
+ return False
+ return True
+
+
def main():
p = OptionParser(
options.wnpp_mode = 'ITP'
# Load configuration
- config = ConfigParser()
+ config = ConfigParser(defaults={'skip': '.*[~#]$'})
config.read(options.config_file)
if options.all_mode:
if not len(infiles):
infiles = [join(options.topdir or './', 'debian/blends')] # default one
+ skip_re = re.compile(config.get('paths', 'skip', None))
+
for blends_file in infiles:
verbose(1, "Processing %s" % blends_file)
if not exists(blends_file):
error("Cannot find a file %s. Either provide a file or specify top "
"debian directory with -d." % blends_file, 1)
-
+ if skip_re.match(blends_file):
+ verbose(2, "W: Skipped since matches paths.skip regexp")
+ continue
pkgs = parse_debian_blends(blends_file)
if options.topdir is None:
if dirname(blends_file).endswith('/debian'):
topdir = options.topdir
expand_pkgs(pkgs, topdir=topdir)
+
+ pkgs = [p for p in pkgs if not is_template(p)]
+ if not len(pkgs):
+ verbose(2, "W: Skipping since seems to contain templates only")
+ continue
if options.wnpp_mode is not None:
print_wnpp(pkgs, config, options.wnpp_mode)
else: