Bug 733531 - nfs-utils scriptlets contains paths from rpm srcdir (/builddir/build/SOURCES)
Summary: nfs-utils scriptlets contains paths from rpm srcdir (/builddir/build/SOURCES)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nfs-utils
Version: 16
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-25 22:26 UTC by Mattias Ellert
Modified: 2011-09-09 17:12 UTC (History)
3 users (show)

Fixed In Version: nfs-utils-1.2.4-8.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-09 17:12:28 UTC


Attachments (Terms of Use)

Description Mattias Ellert 2011-08-25 22:26:56 UTC
Description of problem:

preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ]; then
	# Package removal, not upgrade
	for service in /builddir/build/SOURCES/nfs-lock.service /builddir/build/SOURCES/nfs-secure.service /builddir/build/SOURCES/nfs-secure-server.service /builddir/build/SOURCES/nfs-server.service /builddir/build/SOURCES/nfs-idmap.service /builddir/build/SOURCES/var-lib-nfs-rpc_pipefs.mount /builddir/build/SOURCES/proc-fs-nfsd.mount ; do
    	/bin/systemctl disable $service >/dev/null 2>&1 || :
    	/bin/systemctl stop $service >/dev/null 2>&1 || :
	done
    /usr/sbin/userdel rpcuser 2>/dev/null || :
    /usr/sbin/groupdel rpcuser 2>/dev/null || :
    /usr/sbin/userdel nfsnobody 2>/dev/null || :
    /usr/sbin/groupdel nfsnobody 2>/dev/null || :
    rm -rf /var/lib/nfs/statd
    rm -rf /var/lib/nfs/v4recovery
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
	# Package upgrade, not uninstall
	for service in /builddir/build/SOURCES/nfs-lock.service /builddir/build/SOURCES/nfs-secure.service /builddir/build/SOURCES/nfs-secure-server.service /builddir/build/SOURCES/nfs-server.service /builddir/build/SOURCES/nfs-idmap.service /builddir/build/SOURCES/var-lib-nfs-rpc_pipefs.mount /builddir/build/SOURCES/proc-fs-nfsd.mount ; do
		echo "try-restart $service service"
    	/bin/systemctl try-restart $service >/dev/null 2>&1 || :
	done
fi
/bin/systemctl --system daemon-reload >/dev/null 2>&1 || :


Version-Release number of selected component (if applicable):
nfs-utils-1.2.4-7.fc16.x86_64

How reproducible:
Always

Comment 1 Steve Dickson 2011-08-26 14:35:22 UTC
Here is how those source files are defined in the spec file.

Source11: nfs-lock.service
Source12: nfs-secure.service
Source13: nfs-secure-server.service
Source14: nfs-server.service
Source15: nfs-idmap.service
Source16: var-lib-nfs-rpc_pipefs.mount
Source17: proc-fs-nfsd.mount

Source50: nfs-lock.preconfig
Source51: nfs-server.preconfig
Source52: nfs-server.postconfig

How should they be defined??

Comment 2 Mattias Ellert 2011-08-28 02:27:30 UTC
(In reply to comment #1)
> Here is how those source files are defined in the spec file.
> 
> Source11: nfs-lock.service
> Source12: nfs-secure.service
> Source13: nfs-secure-server.service
> Source14: nfs-server.service
> Source15: nfs-idmap.service
> Source16: var-lib-nfs-rpc_pipefs.mount
> Source17: proc-fs-nfsd.mount
> 
> Source50: nfs-lock.preconfig
> Source51: nfs-server.preconfig
> Source52: nfs-server.postconfig
> 
> How should they be defined??

This is all fine, but...

In the specfile your scriptlets say:

for service in %{nfs_services} ; do

and nfs_services is defined as:

%define nfs_services %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} ...

The SOURCEX macros expands to the absolute path of the source file in the rpm src directoty, i.e. normally ~/rpmbuild/SOURCES/... for a local build and /builddir/build/SOURCES/... for a koji build.

This is what you want for the %install section

for service in %{nfs_services} ; do
         install -m 644 $service $RPM_BUILD_ROOT/lib/systemd/system
done

But in the scriptlets using the full path of the file in the source directory is not the right thing. Here something like

for service in %(sed 's!\S*/!!g' <<< '%{nfs_services}') ; do

would be better.

Comment 3 Steve Dickson 2011-08-30 13:46:27 UTC
Ok... I see the problem... 

Question, How do I get that verbosity that shows the paths as
have in Comment 0?

Comment 4 Mattias Ellert 2011-08-30 14:33:57 UTC
(In reply to comment #3)
> Ok... I see the problem... 
> 
> Question, How do I get that verbosity that shows the paths as
> have in Comment 0?

For the scripts used by the RPM package:

rpm -q --scripts -p nfs-utils-1.2.4-7.fc16.x86_64.rpm

For the scripts used by the installed package

rpm -q --scripts nfs-utils

Comment 5 Fedora Update System 2011-08-30 21:23:24 UTC
nfs-utils-1.2.4-8.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/nfs-utils-1.2.4-8.fc16

Comment 6 Fedora Update System 2011-08-31 21:44:57 UTC
Package nfs-utils-1.2.4-8.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing nfs-utils-1.2.4-8.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/nfs-utils-1.2.4-8.fc16
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-09-09 17:12:11 UTC
nfs-utils-1.2.4-8.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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