Bug 9508
Summary: | %files -f breaks when using RPM shell variables in %setup -n | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | David D. Kilzer <ddkilzer> |
Component: | rpm | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED WORKSFORME | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 5.2 | ||
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: | 2000-02-22 10:56:04 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
David D. Kilzer
2000-02-17 01:35:10 UTC
%define FILE_LIST rpmfiles.mft Name: setup-files-bug Summary: Demonstrates %setup -n/%files -f bug. Version: 1.0 Release: 1 Source0: foo.txt Group: Regression/Test BuildRoot: /var/tmp/%{name}-buildroot Copyright: GPL Prefix: /usr %description Demonstrates %setup -n/%files -f bug. %prep %setup -c -n $RPM_PACKAGE_NAME -T %build %install mkdir -p $RPM_BUILD_ROOT cp -p %{SOURCE0} $RPM_BUILD_ROOT/ cd $RPM_BUILD_ROOT find . -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \ > $RPM_BUILD_DIR/$RPM_PACKAGE_NAME/%{FILE_LIST} %clean rm -rf $RPM_BUILD_ROOT %files -f %{FILE_LIST} %changelog * Wed Feb 16 2000 David Kilzer <ddkilzer> - Created spec file See also comment from oliver.nz on 02/07/00 22:01 in bug 9091. http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=9091 The problem is in %setup -c -n $RPM_PACKAGE_NAME -T The macro %setup does not run in a shell context, so the name is taken literally as '$RPM_PACKAGE_NAME'. Use %{name} instead, as that is the macro from which RPM_PACKAGE_NAME is set. Actually, %setup works fine (probably by accident) with -n $RPM_PACKAGE_NAME since the literal name is used later in a shell context. It is %files that gets tripped up later in the build process by doing this. It would be nice if this 'feature' were documented since it was a pain to track down, and it is not at all obvious to the casual SPEC file writer. "Works fine" only if you like literally '$RPM_PACKAGE_NAME' as a file name. A spec file is not a shell script, even though sections like %prep of the spec file are shell scriptlets written in shell. Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/222912269321e0a506452df54c37ac9664fc947f Merge pull request #9583 from rhcarvalho/issue9508-new-app-env Merged by openshift-bot |