On Mi Juli 11 2007, Dennis Gilmore wrote: > Rather than have a check for koji's existence in each target, i would > perfer a target to check for koji and have the makefile call that. Then if > the location to get information changes or we switch out koji and go to > something else we only need to update information in one place.
Yes, I thought of this, too. Here is a patch that adds also a target koji-check, that checks for koji and also depends on build-check and $(COMMON_DIR)/branches, which all other koji build targets have in common. Also I added it to the chain-build target because afaik only koji supports chain-building. Do you maybe know a way to unify the redundant koji commandlines? This is something that may be improved, imho, but I do not know, whether or not there is an elegant way to do this with make. @$(BUILD_CLIENT) build $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' @$(BUILD_CLIENT) build --scratch $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' @$(BUILD_CLIENT) build --scratch --arch-override=$* $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' Is there are reason why all the targets should depend on "$(COMMON_DIR)/branches"? Maybe this can be dropped completely. Also imho the variable BUILD_CLIENT should be renamed to KOJI_CLIENT, I can provide a patch for this, too. Regards, Till
Index: Makefile.common =================================================================== RCS file: /cvs/pkgs/common/Makefile.common,v retrieving revision 1.72 diff -u -r1.72 Makefile.common --- Makefile.common 7 Jul 2007 15:11:29 -0000 1.72 +++ Makefile.common 11 Jul 2007 15:53:08 -0000 @@ -154,7 +154,7 @@ PREP_ARCHES = $(addprefix prep-,$(ARCHES)) ## list all our bogus targets -.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build cvsurl chain-build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local +.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build cvsurl chain-build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local scratch-build scratch-build-% koji-check # The TARGETS define is meant for local module targets that should be # made in addition to the SOURCEFILES whenever needed @@ -399,8 +399,10 @@ @if [ ! -x "$(PLAGUE_CLIENT)" ]; then echo "Must have plague-client installed - see http://fedoraproject.org/wiki/Extras/BuildSystemClientSetup"; exit 1; fi $(PLAGUE_CLIENT) build $(NAME) $(TAG) $(TARGET) -koji: build-check $(COMMON_DIR)/branches +koji-check: build-check $(COMMON_DIR)/branches @if [ ! -x "$(BUILD_CLIENT)" ]; then echo "Must have koji installed - see http://fedoraproject.org/wiki/BuildSystemClientSetup"; exit 1; fi + +koji: koji-check @$(BUILD_CLIENT) build $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' ifneq (, $(filter devel F-7 OLPC-2, $(BRANCH))) @@ -409,10 +411,17 @@ build: plague endif +scratch-build: koji-check + @$(BUILD_CLIENT) build --scratch $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' + +scratch-build-%: koji-check + @$(BUILD_CLIENT) build --scratch --arch-override=$* $(BUILD_FLAGS) $(TARGET) '$(CVS_URL)' + + cvsurl: @echo '$(CVS_URL)' -chain-build: build-check +chain-build: koji-check @if [ -z "$(CHAIN)" ]; then \ echo "Missing CHAIN variable, please specify the order of packages to" ; \ echo "chain build. For example: make chain-build CHAIN='foo bar'" ; \ @@ -530,6 +539,10 @@ @echo " in a group must build successfully and populate the repository before" @echo " the next group will begin building." @echo " If no groups are defined, packages will be built sequentially." + @echo " scratch-build Request scratch build of \"$(TAG)\" for $(TARGET)" + @echo " scratch-build-<archs> Request scratch build of \"$(TAG)\" for $(TARGET) and archs <archs>" + @echo " examples: make scratch-build-i386,ppc64" + @echo " make scratch-build-x86_64" @echo " mockbuild Local test build using mock" @echo " verrel Echo \"$(NAME)-$(VERSION)-$(RELEASE)\"" @echo " new Diff against last tag"
-- Fedora-buildsys-list mailing list Fedora-buildsys-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-buildsys-list