PDA

View Full Version : 5.0.1-1 upgrade buglet on RedHat



Eric Gauthier
2003-11-29, 07:06
I just upgraded to 5.0.1-1 on my RedHat box, and got the following error:

[root@music kits]# rpm --upgrade slimserver-5.0.1-1.noarch.rpm
sed: can't read /etc/sysconfig/slimserver.rpmnew: No such file or directory

I think it comes from the below snippet in slimserver.spec.build, which
appears to be trying to preserve an alternate prefix path for the slimserver
home directory on an upgrade. I am using the standard (/usr/local)
directory for the slimserver home, so I can't easily test the alternate path
of the code.

I don't know alot about RPMs, but is PREFIX a keyword or something? It is
not used with standard shell variable substitutions. Is it set by the RPM
infrastructure in the setup for each phase (%post in this case)? My PREFIX
should be set to /usr/local (default), so I don't see how it is getting into
the .rpmnew branch of the if statement, unless PREFIX is not set to
/usr/local/ correctly by RPM.

if [ `grep -c PREFIX /etc/sysconfig/slimserver` -gt 0 ]; then
DEST_FILE=/etc/sysconfig/slimserver
else
DEST_FILE=/etc/sysconfig/slimserver.rpmnew
fi
SLIMSERVER_PREFIX=`echo %{slimdir} | sed 's/\//\\\\\//g'`
sed "s/PREFIX/$SLIMSERVER_PREFIX/" $DEST_FILE > /tmp/slimserver.$$

-Eric

Jack Coates
2003-11-29, 08:14
On Sat, 2003-11-29 at 06:06, Eric Gauthier wrote:
> I just upgraded to 5.0.1-1 on my RedHat box, and got the following
> error:
>
> [root@music kits]# rpm --upgrade slimserver-5.0.1-1.noarch.rpm
> sed: can't read /etc/sysconfig/slimserver.rpmnew: No such file or
> directory

As it says on the download page, you should rpm -e SliMP3 before
installing slimserver.

>
> I think it comes from the below snippet in
> slimserver.spec.build, which appears to be trying to preserve an
> alternate prefix path for the slimserver home directory on an
> upgrade. I am using the standard (/usr/local) directory for the
> slimserver home, so I can't easily test the alternate path of the
> code.
>
> I don't know alot about RPMs, but is PREFIX a keyword or something?
> It is not used with standard shell variable substitutions. Is it set
> by the RPM infrastructure in the setup for each phase (%post in this
> case)? My PREFIX should be set to /usr/local (default), so I don't
> see how it is getting into the .rpmnew branch of the if statement,
> unless PREFIX is not set to /usr/local/ correctly by RPM.

This grep & sed is looking for the word PREFIX and replacing it with
SLIMSERVER_PREFIX -- it's editing a config file if it exists and
changing variable names.

--
Jack at Monkeynoodle Dot Org: It's A Scientific Venture...

"It doesn't matter if it's good, it only matters if it rocks!"
-- Rock Your Socks By Tenacious D