Bug 21450 - find-requires breaks on makefiles
Summary: find-requires breaks on makefiles
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2000-11-28 22:30 UTC by Need Real Name
Modified: 2005-10-31 22:00 UTC (History)
0 users

Clone Of:
Last Closed: 2001-02-21 19:08:59 UTC

Attachments (Terms of Use)

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
 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
 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

Note You need to log in before you can comment on or make changes to this bug.