Bug 21450

Summary: find-requires breaks on makefiles
Product: [Retired] Red Hat Linux Reporter: Need Real Name <jared>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: low    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-21 19:08:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2000-11-28 22:30:08 UTC
I built an RPM and tried to install it but got the error message

"error: failed dependancies
     all: is needed by pkg"

Upon investigation, I discovered that a makefile was included in the RPM
with "all" as the target on the first line.  The makefile also had execute
permissions set.  The output from "file makefile" is "make commands text",
so it was being treated as a script in find-requires.

Anyway, here is a patch if you want it, compared against RedHat 6.2.  The
problem was still there on 7 though.


--- find-requires.old  Wed Mar  1 15:24:58 2000
+++ find-requires       Tue Nov 28 17:23:20 2000
@@ -22,7 +22,9 @@

 for f in $scriptlist; do
     if [ -x $f ]; then
-       head -1 $f | sed -e 's/^\#\![   ]*//' | cut -d" " -f1
+       if `head -1 $f | grep '^\#\!' > /dev/null`; then
+           head -1 $f | sed -e 's/^\#\![       ]*//' | cut -d" " -f1
+       fi
     fi
 done | sort -u

Comment 1 Bill Nottingham 2000-11-29 21:17:31 UTC
Why are your Makefiles marked executable?
(They won't get picked up by find-requires if they aren't...)

Comment 2 Need Real Name 2000-11-29 21:56:08 UTC
It is there with exec permissions because we copy a whole directory, and then we
do a global chmod on the contents.  Essentially we are to lazy to specify the
files individually.

Just because we are careless in that regard doesn't mean that the script
shouldn't do the right thing however.

This patch is better and much less annoying.

--- find-requires.old  Wed Mar  1 15:24:58 2000
+++ find-requires       Wed Nov 29 09:31:37 2000
@@ -22,7 +22,7 @@

 for f in $scriptlist; do
     if [ -x $f ]; then
-       head -1 $f | sed -e 's/^\#\![   ]*//' | cut -d" " -f1
+        head -1 $f | grep '^\#\!' | sed -e 's/^\#\![   ]*//' | cut -d" " -f1
     fi
 done | sort -u


Comment 3 Jeff Johnson 2001-02-21 19:08:55 UTC
Changing component.

Comment 4 Jeff Johnson 2001-05-24 13:37:27 UTC
This isn't important enogh to fix in rpm.

However, if you wish to configure your own find-requires, then do
	mkdir -p /etc/rpm
	cp /usr/lib/rpm/find-requires /etc/rpm/find-requires
	<... apply your patch ...>
	echo "%_find_requires /etc/rpm/find-requires" >> /etc/rpm/macros