Skip to content

Commit

Permalink
Package builder: fix incremental build
Browse files Browse the repository at this point in the history
It should remove all subpackage rpms from the stage folder and not
only main rpm.
Otherwise packagebuilder might use, for instance, rpm-libs-4.14 from the
stage and rpm-4.13 from the publishrpms - known issue in package builder.

Extra:
- added `make print-upward-deps pkg=<spec file name>` target

Change-Id: I3f100ba7139ffd09d2d1cdd5158d127f3e26ec9a
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5896
Tested-by: gerrit-photon <[email protected]>
Reviewed-by: Srivatsa S. Bhat <[email protected]>
Reviewed-by: Alexey Makhalov <[email protected]>
  • Loading branch information
Alexey Makhalov committed Oct 11, 2018
1 parent 01c924d commit 0f58805
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ who-needs:
@cd $(PHOTON_SPECDEPS_DIR) && \
$(PHOTON_SPECDEPS) -s $(PHOTON_SPECS_DIR) -i who-needs -p $(pkg)

print-upward-deps:
@cd $(PHOTON_SPECDEPS_DIR) && \
$(PHOTON_SPECDEPS) -s $(PHOTON_SPECS_DIR) -i print-upward-deps -p $(pkg)

# Input args: BASE_COMMIT= (optional)
#
# This target removes staged RPMS that can be affected by change(s) and should
Expand Down
2 changes: 1 addition & 1 deletion support/package-builder/SpecData.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def process(self, inputType, inputValue, displayOption, outputFile=None):
return self.displayDependencies(displayOption, inputType, outputFile, mapDependencies, parent)
else:
return self.displayDependencies(displayOption, inputType, inputValue, mapDependencies, parent)
elif inputType == "remove-upward-deps":
elif inputType == "get-upward-deps":
depList = []
for specFile in inputValue.split(":"):
if specFile in SPECS.getData().mapSpecFileNameToSpecObj:
Expand Down
12 changes: 8 additions & 4 deletions support/package-builder/SpecDeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ def main():
specDeps = SpecDependencyGenerator()

if options.input_type == "remove-upward-deps":
whoNeedsList = specDeps.process(options.input_type, options.pkg, options.display_option)
whoNeedsList = specDeps.process("get-upward-deps", options.pkg, options.display_option)
print ("Removing upward dependencies: " + str(whoNeedsList))
for pkg in whoNeedsList:
package, version = StringUtils.splitPackageNameAndVersion(pkg)
release = SPECS.getData().getRelease(package, version)
buildarch=SPECS.getData().getBuildArch(package, version)
rpmFile = "stage/RPMS/" + buildarch + "/" +package + "-" + version + "-" + release + ".*" + buildarch+".rpm"
cmdUtils.runCommandInShell2("rm -f "+rpmFile)
for p in SPECS.getData().getPackages(package,version):
buildarch=SPECS.getData().getBuildArch(p, version)
rpmFile = "stage/RPMS/" + buildarch + "/" + p + "-" + version + "-" + release + ".*" + buildarch+".rpm"
cmdUtils.runCommandInShell2("rm -f "+rpmFile)
elif options.input_type == "print-upward-deps":
whoNeedsList = specDeps.process("get-upward-deps", options.pkg, options.display_option)
print ("Upward dependencies: " + str(whoNeedsList))
# To display/print package dependencies on console
elif (options.input_type == "pkg" or
options.input_type == "who-needs"):
Expand Down

0 comments on commit 0f58805

Please sign in to comment.