diff --git a/pisi/build.py b/pisi/build.py index 20b7f468..998e1d76 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -860,23 +860,27 @@ def build(pspec): return pb.build() order = {"none": 0, - "unpack": 1, - "setupaction": 2, - "buildaction": 3, - "installaction": 4, - "buildpackages": 5} + "fetch": 1, + "unpack": 2, + "setupaction": 3, + "buildaction": 4, + "installaction": 5, + "buildpackages": 6} -def __buildState_unpack(pb): - # unpack is the first state to run. +def __buildState_fetch(pb): + # fetch is the first state to run. pb.patch_exists() pb.fetch_source_archive() + +def __buildState_unpack(pb, last): + if order[last] < order["fetch"]: + __buildState_fetch(pb) pb.unpack_source_archive() pb.apply_patches() def __buildState_setupaction(pb, last): - if order[last] < order["unpack"]: - __buildState_unpack(pb) + __buildState_unpack(pb, last) pb.run_setup_action() def __buildState_buildaction(pb, last): @@ -910,8 +914,12 @@ def build_until(pspec, state): if not last: last = "none" + if state == "fetch": + __buildState_fetch(pb) + return + if state == "unpack": - __buildState_unpack(pb) + __buildState_unpack(pb, last) return if state == "setup": diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 260fff5b..5fc1175f 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -367,7 +367,7 @@ unpack, setup, build, install, package. name = ("build", "bi") - steps = ('unpack', 'setup', 'build', 'install', 'package') + steps = ('fetch', 'unpack', 'setup', 'build', 'install', 'package') package_formats = ('1.0', '1.1')