[PATCH] Makefile.common: bodhi update target

Luke Macken lmacken at redhat.com
Mon Nov 12 18:01:32 UTC 2007


Attached is a patch to add an 'update' target to our common Makefile.
When executed in a branch supported by bodhi (F-{7,8}), it will drop
you into a template and then submit your update to bodhi.

Comments/suggestions welcome,

luke
-------------- next part --------------
--- Makefile.common	30 Oct 2007 18:33:33 -0000	1.80
+++ Makefile.common	12 Nov 2007 17:57:00 -0000
@@ -129,6 +129,7 @@ WGET	?= $(shell if test -f /usr/bin/wget
 CLIENT	?= $(if $(CURL),$(CURL),$(if $(WGET),$(WGET)))
 PLAGUE_CLIENT ?= $(shell which plague-client 2>/dev/null)
 BUILD_CLIENT ?= $(shell which koji 2>/dev/null)
+BODHI_CLIENT ?= $(shell which bodhi 2>/dev/null)
 
 # RPM with all the overrides in place; you can override this in your
 # .cvspkgsrc also, to use a default rpm setup
@@ -424,6 +425,17 @@ else
 build: plague
 endif
 
+bodhi: build-check $(COMMON_DIR)/branches
+	@if [ ! -x "$(BODHI_CLIENT)" ]; then echo "Must have bodhi-client installed"; exit 1; fi
+	@echo -e "# [ $(NAME)-$(VERSION)-$(RELEASE) ]\n# To abort this update, delete any uncommented lines before saving this file\n# type=[S|B|E] (S=security, B=bugfix, E=enhancement)\n# request=[T|S] (T=testing, S=stable)\n# bug=123,456\n# all other text will be considered to be part of the update notes\ntype=B" > bodhi.template
+	@if [ -z "$$EDITOR" ]; then vi bodhi.template; else $$EDITOR bodhi.template; fi
+	@$(BODHI_CLIENT) --new --release $(subst -,,$(BRANCH)) --file bodhi.template $(NAME)-$(VERSION)-$(RELEASE)
+	@rm -f bodhi.template
+
+ifneq (, $(filter F-8 F-7, $(BRANCH)))
+update: bodhi
+endif
+
 cvsurl:
 	@echo '$(CVS_URL)'
 


More information about the fedora-devel-list mailing list