RFE: Makefile.common patch to error out when no spec is present

Karsten Hopp karsten at redhat.com
Mon Apr 27 14:15:27 UTC 2009


Am 24.04.2009 23:54, schrieb Kevin Fenzi:
> Greetings.
>
> I know some of you have run into this situation:
>
> If you have a package where there is no *.spec file present and you try
> to run any of the fedora cvs Makefile.common targets, nothing happens
> and the command just hangs.
>
> Turns out it's doing a grep of the spec file to figure out if the
> package is noarch or not. When there is no spec file the grep hangs.
>
> Here's a very hacky patch that should at least error out in this case.
>
> Makefile hackers welcome to provide a better one.
>
> kevin
> --
> Index: Makefile.common
> ===================================================================
> RCS file: /cvs/extras/common/Makefile.common,v
> retrieving revision 1.127
> diff -u -r1.127 Makefile.common
> --- Makefile.common	15 Apr 2009 04:57:41 -0000	1.127
> +++ Makefile.common	24 Apr 2009 21:15:03 -0000
> @@ -35,6 +35,9 @@
>
>   BUILD_FLAGS ?= $(KOJI_FLAGS)
>
> +ifndef $(SPECFILE)
> +SPECFILE = "NO_SPEC_FILE_FOUND"
> +endif
>   LOCALARCH := $(if $(shell grep -i '^BuildArch:.*noarch' $(SPECFILE)), noarch, $(shell uname -m))
>
>   ## a base directory where we'll put as much temporary working stuff as we can
>


Looks like this is the week of Makefile.common patches, I have another one:


 >cvs diff -u Makefile.common
Index: Makefile.common
===================================================================
RCS file: /cvs/extras/devel/common/Makefile.common,v
retrieving revision 1.127
diff -u -r1.127 Makefile.common
--- Makefile.common     15 Apr 2009 04:57:41 -0000      1.127
+++ Makefile.common     27 Apr 2009 14:14:00 -0000
@@ -26,6 +26,10 @@
  #BRANCH:=$(shell cvs rlog rpms/$(NAME)/F-11/$(SPECFILE) >/dev/null 2>&1 && echo "F-12" || echo "devel")
  #endif
  BRANCHINFO = $(shell grep ^$(BRANCH): $(COMMON_DIR)/branches | cut -d: --output-delimiter=" " -f2-)
+ifeq (,$(BRANCHINFO))
+BRANCH:=$(shell pwd | awk -F '/' '{ print $$(NF-1) }' )
+BRANCHINFO = $(shell grep ^$(BRANCH): $(COMMON_DIR)/branches | cut -d: --output-delimiter=" " -f2-)
+endif
  TARGET := $(word 1, $(BRANCHINFO))
  DIST = $(word 2, $(BRANCHINFO))
  DISTVAR = $(word 3, $(BRANCHINFO))



This should fix builds from a single-distribution CVS tree which you can check out p.e. with 'cvs co F-11'.
This broke one year ago with Makefile.common cvs release 1.95 as those changes didn't consider the different
directory layout for the single-distribution CVS tree (p.e. it is .../vim/F-11 for the complete checkout but
.../F-11/vim when you check out just one single distribution)


    Karsten




More information about the fedora-devel-list mailing list