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

Kevin Fenzi kevin at scrye.com
Fri Apr 24 21:54:48 UTC 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20090424/f4a2975e/attachment.sig>


More information about the fedora-devel-list mailing list