This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 51193 - RFE: %_netsharedpath mechanism is naive, needs redesign
RFE: %_netsharedpath mechanism is naive, needs redesign
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
: FutureFeature
: 3229 4330 (view as bug list)
Depends On:
Blocks: 50670 51188 52742 52743 59494 61147 71665 71676 73321 91751 91752 132846 132847 142103
  Show dependency treegraph
 
Reported: 2001-08-08 08:24 EDT by Enrico Scholz
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-07 18:59:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2001-08-08 08:24:17 EDT
Some packages are modifying files in their scriptlets (e.g. anonftp, XFree86).
Because these files can be on shared partitions it would be nice to test if 
they are covered by %_netsharedpath or not.

In my rpms I am using a macro:

| %define __isDirectoryShared	rpm --eval '%%{_netsharedpath}' | perl -e '$_=$ARGV[0];$l=<STDIN>;chomp($l);foreach $p (split(/:/,$l)) {exit(0) if m!^$p!;}; exit(1)'

which can be used e.g. as:

| %post
| %__isDirectoryShared %{_infodir} || %{__install_info} %{_infodir}/my-doc


Well, the macro contains perl and rpmlint complains about dangerous commands in the 
%post scriptlet, but this could be solved by a C implementation and a popt-command
for rpm doing the "rpm --eval '%%{_netsharedpath}'".

It would be nice if the official rpm contains such a functionality...
Comment 1 Jeff Johnson 2001-08-08 09:17:14 EDT
Agreed %_netsharedpath is pretty feeble and complicated mechanism.

Rather than adding yet more complicated macro glop to do the right
thing, I suggest an alternative approach
	1) Classify all files, in this case, mark a file as an "info" file.
	2) Associate actions with each class, in this case, the install
	action is %{__install_info}
	3) Parameterize the actions with per-install-system configuration,
	in this case the (default) parameter is %{_infodir}/my-doc
	4) Enrich the transaction state machine to automagically
	perform actions for each file in a class.
	5) Make the transaction state machine sensitive to transaction
	context like %_netsharedpath
The end result would essentially factor most of the operations now done
in %post et al scriptlets out of packages, and into the installer (i.e. rpm)
context without the cumbersome artifacts like "rpm --eval" to reacquire
the transaction context.
Comment 2 Enrico Scholz 2001-08-08 09:30:31 EDT
How would a package fit into this scheme whose files can not be classified or
are used only by this package?

An example is anonftp:

| $ rpm -q --scripts anonftp
| ...
| preuninstall scriptlet (through /bin/sh):
| if [ $1 = 0 ]; then
|         rm -f /var/ftp/lib/* /var/ftp/bin/*
| fi

or XFree86

| $ rpm -q --scripts XFree86
| ...
| postinstall scriptlet (through /bin/sh):
| {
|   for dir in lbxproxy proxymngr rstart xserver ; do
|    [ ! -L /usr/X11R6/lib/X11/$dir -a ! -d /usr/X11R6/lib/X11/$dir ] && \
|      ln -snf ../../../../etc/X11/$dir /usr/X11R6/lib/X11/$dir || :

[see bug #51188 and bug #50670]


What is with packages which are executing special installation-programs in their
scriptlets (e.g. glibc, see bug #50667).
Comment 3 Jeff Johnson 2001-08-08 14:53:21 EDT
Yes, there will always be execeptions. I'm talking about 
regularizing the 20 or so common actions that constitute
the majority of %post et al scriptlets. The existing mechanism
will remain.
Comment 4 Jeff Johnson 2001-08-30 14:56:49 EDT
I'm gonna use this bug as a collection point
for redesigning netsharedpath functionality.
Comment 5 Jeff Johnson 2001-08-30 15:00:03 EDT
*** Bug 4330 has been marked as a duplicate of this bug. ***
Comment 6 Jeff Johnson 2001-08-30 15:01:03 EDT
*** Bug 3229 has been marked as a duplicate of this bug. ***
Comment 7 Mike A. Harris 2002-11-10 13:11:45 EST
One of these days....  I'm going to redo all the X rpm scripts from
scratch.  A lot of crap in there probably can go.
Comment 8 Jeff Johnson 2004-12-07 18:59:51 EST
OK, there's a bug pile on here and no suggestions for better
replacement for %_netsharedpath.

So my intent -- asking for suggestions for better ideas --
is not being served anymore.

AFAIAC, %_netsharedpath is the best known mechanism,
and better solutions are at odds with my "stable rpm"
prime directive.

Hence WONTFIX.
Comment 9 Enrico Scholz 2004-12-07 19:25:29 EST
hehe, it's a clever trick to change the initial summary/request of

| Add functionality to test if path is in %_netsharedpath

into

| RFE: %_netsharedpath mechanism is naive, needs redesign

and wait 3 years till everybody forgets this change. So, it is easier
to say WONTFIX...

But my mailarchive never forgets...



And to clearify things... I never said that %_netsharedpath is naive --
it is doing exactly this, for what it was designed (ok... not
exactly... there are other 3 year old bugs about misclassification of
parent-directories... but this is another issue and when we let pass
other 3 years, we can close this with WONTFIX also).

I just wanted a simple resp. standardized method to test in %scriptlets
whether a path is covered by %_netsharedpath.

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