Allow source file globbing.

This commit is contained in:
Jeffrey Townsend
2015-12-01 00:59:34 +00:00
parent 2c1c316bfa
commit 04df114aff

View File

@@ -209,6 +209,16 @@ class OnlPackage(object):
p = filename
else:
p = os.path.join(self.dir, filename)
# Globs that result in a single file are allowed:
g = glob.glob(p)
if len(g) is 0:
raise OnlPackageError("'%s' did not match any files." % p)
elif len(g) > 1:
raise OnlPackageError("'%s' matched too many files %s" % (p, g))
else:
p = g[0]
logger.debug("package file: %s" % p)
return p
@@ -572,6 +582,7 @@ class OnlPackageGroup(object):
for p in self.packages:
products.append(p.build(dir_=dir_))
return products
def clean(self, dir_=None):