On Fri, May 04, 2007 at 11:37:41AM -0400, Jeremy Katz wrote: > > For all who use private branches, the following patch may be helpful. I added > > it to RH's Makefile.common recently, being inspired by `make zstreams'. > > This seems okay, but can you also add appropriate documentation to the > help target? Sorry, new patch: diff -u -r1.54 Makefile.common --- Makefile.common 4 May 2007 15:39:29 -0000 1.54 +++ Makefile.common 4 May 2007 17:40:26 -0000 @@ -459,6 +459,7 @@ @echo " patch SUFFIX=<suff> Create and add a gendiff patch file" @echo " rediff SUFFIX=<suff> Recreates a gendiff patch file, retaining comments" @echo " unused-patches Print list of patches not referenced by name in specfile" + @echo " privates Checkout \"private-<name>-branch\" branches into ../$(BRANCH)-<name>" @echo " gimmespec Print the name of the specfile" gimmespec: @@ -467,6 +468,28 @@ unused-patches: @for f in *.patch; do if [ -e $$f ]; then grep -q $$f $(SPECFILE) || echo $$f; fi; done +privates: $(SPECFILE) + @for P_BRANCH in $$(cvs -f log -h $(SPECFILE) | awk '/private-.*-branch/ { print substr($$1, 0, length($$1) - 1) }'); do \ + P_DIR=$${P_BRANCH%-branch}; \ + P_DIR=$${P_DIR#private-}; \ + P_DIR=$(BRANCH)-$${P_DIR}; \ + pushd .. > /dev/null; \ + if [ -d $$P_DIR ]; then \ + cd $$P_DIR; \ + if [ ! -f CVS/Tag ] || [ $$(cat CVS/Tag) != "T$$P_BRANCH" ]; then \ + echo "$$P_DIR exists but is not on branch $$P_BRANCH"; \ + exit 1; \ + else \ + echo "Updating $$P_DIR..."; \ + cvs up; \ + fi; \ + else \ + echo "Checking out $$P_BRANCH into $$P_DIR..."; \ + cvs co -r $$P_BRANCH -d $$P_DIR rpms/$(NAME)/$(BRANCH); \ + fi; \ + popd > /dev/null; \ + done + ##################### EXPERIMENTAL ########################## # this stuff is very experimental in nature and should not be # relied upon until these targets are moved above this line -- TJ. (Brno, CZ), BaseOS, Red Hat -- Fedora-maintainers mailing list Fedora-maintainers@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-maintainers -- Fedora-maintainers-readonly mailing list Fedora-maintainers-readonly@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-maintainers-readonly