From d54105a1384f92ccc05b30982617ac1802f64331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Sat, 6 May 2006 21:47:48 +0000 Subject: [PATCH] * fix: set buildno in config, for build test * fix: look at output dir, not recursively (doesn't quite work yet, though) --- pisi/build.py | 19 ++++++++++++++----- tests/buildtests.py | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pisi/build.py b/pisi/build.py index bf6141e3..2de7b1c1 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -574,7 +574,7 @@ class Builder: # build no if ctx.config.options.ignore_build_no: - metadata.package.build = None # means, build no information n/a + metadata.package.build = None ctx.ui.warning(_('Build number is not available due to --ignore-build')) elif (not ctx.config.values.build.buildno): metadata.package.build = None @@ -602,10 +602,9 @@ class Builder: # we'll exclude collisions in get_file_hashes. Having a # collisions list is not wrong, we must just handle it :). - # sure -- exa collisions = check_path_collision(package, self.spec.packages) - # FIXME: material collisions after expanding globs must be - # reported as errors, and an exception must be raised + # FIXME: material collisions after expanding globs could be + # reported as errors d = {} def add_path(path): @@ -616,7 +615,7 @@ class Builder: and not package.name.endswith(ctx.const.static_name_suffix) \ and util.is_ar_file(fpath): # if this is an ar file, and this package is not a static package, - # don't include this file into the package. + # don't include this file into the package. continue frpath = util.removepathprefix(install_dir, fpath) # relative path ftype, permanent = get_file_type(frpath, package.files, install_dir) @@ -643,6 +642,7 @@ class Builder: found = [] def locate_package_names(files): for fn in files: + #print 'looking', fn if util.is_package_name(fn, package_name): old_package_fn = util.join_path(root, fn) try: @@ -662,6 +662,15 @@ class Builder: for root, dirs, files in os.walk(ctx.config.packages_dir()): locate_package_names(files) + outdir=ctx.get_option('output_dir') + if not outdir: + outdir = '.' + files = [join(outdir,entry) for entry in os.listdir(outdir) + if os.path.isfile(entry)] + #print os.listdir(outdir) + #print files + locate_package_names(files) + if not found: return (1, None) ctx.ui.warning(_('(no previous build found, setting build no to 1.)')) diff --git a/tests/buildtests.py b/tests/buildtests.py index b626e9eb..39032144 100644 --- a/tests/buildtests.py +++ b/tests/buildtests.py @@ -20,6 +20,7 @@ class BuildTestCase(testcase.TestCase): options = pisi.config.Options() options.ignore_build_no = False testcase.TestCase.setUp(self, options = options) + pisi.context.config.values.build.buildno = True def testBasicBuild(self): shutil.copy('tests/buildtests/a/actions.py-1', 'tests/buildtests/a/actions.py')