From 9c7e45dc2315ab1e5f058a6ac0ea06bd7dffcbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Tue, 9 Aug 2011 21:00:04 +0000 Subject: [PATCH] build: Delay build dep check when building remote specs Build deps depend on the build types that will be used. So it must be delayed until the build types are determined. The code was also checking build deps twice (the second one in build stage) if a remote spec is used. BUG:FIXED:18907 --- pisi/operations/build.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 597191e7..9a21e8fc 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -207,7 +207,12 @@ class Builder: self.set_spec_file(specuri) if specuri.is_remote_file(): - self.specdir = self.fetch_files() + self.specdiruri = os.path.dirname(self.specuri.get_uri()) + pkgname = os.path.basename(self.specdiruri) + self.destdir = util.join_path(ctx.config.tmp_dir(), pkgname) + self.specdir = self.destdir + + self.fetch_translationsfile() else: self.specdir = os.path.dirname(self.specuri.get_uri()) @@ -323,13 +328,17 @@ class Builder: ctx.ui.status(_("Building source package: %s") % self.spec.source.name) + self.check_build_dependencies() + + if self.specuri.is_remote_file(): + self.fetch_files() + self.compile_comar_script() # check if all patch files exists, if there are missing no need # to unpack! self.check_patches() - self.check_build_dependencies() self.fetch_component() self.fetch_source_archives() @@ -414,20 +423,11 @@ class Builder: os.environ["CCACHE_DIR"] = "/root/.ccache" def fetch_files(self): - self.specdiruri = os.path.dirname(self.specuri.get_uri()) - pkgname = os.path.basename(self.specdiruri) - self.destdir = util.join_path(ctx.config.tmp_dir(), pkgname) - #self.location = os.path.dirname(self.url.uri) - self.fetch_actionsfile() - self.check_build_dependencies() - self.fetch_translationsfile() self.fetch_patches() self.fetch_comarfiles() self.fetch_additionalFiles() - return self.destdir - def fetch_pspecfile(self): pspecuri = util.join_path(self.specdiruri, ctx.const.pspec_file) self.download(pspecuri, self.destdir) @@ -1255,6 +1255,10 @@ order = {"none": 0, def __buildState_fetch(pb): # fetch is the first state to run. + + if pb.specuri.is_remote_file(): + pb.fetch_files() + pb.check_patches() pb.fetch_source_archives() @@ -1303,8 +1307,6 @@ def build_until(pspec, state): else: pb = Builder.from_name(pspec) - pb.compile_comar_script() - if state == "fetch": __buildState_fetch(pb) return @@ -1312,6 +1314,8 @@ def build_until(pspec, state): # from now on build dependencies are needed pb.check_build_dependencies() + pb.compile_comar_script() + if state == "package": __buildState_buildpackages(pb) return