[TriLUG] Updating via RPM
Janyne Kizer
janyne_kizer at ncsu.edu
Thu Mar 6 15:17:13 EST 2003
Jeremy Portzer wrote:
>
> On Thu, 2003-03-06 at 14:45, Janyne Kizer wrote:
> > I created the RPM a few weeks back. It contains about a dozen files.
> > One of the files needs to be updated. I updated the source and when I
> > do rpm -Uvh rpmname, the file is not updated. If I remove the old
> > version and then do rpm -ivh rpmname the file *is* updated.
>
> I assume that you did increment the release number of the RPM, right?
Yes.
>
> > Yes, there is a post section. It pretty much just sets the file
> > permissons to ensure that they are correct:
> >
> > %post
> > chown sa /home/sa/*
> > mkdir /home/sa/Desktop
> > chown sa /home/sa/Desktop
> > chmod 444 /home/sa/Desktop
>
> You should be able to include the directories and their permissions
> within the %files section of the RPM itself, but still there shouldn't
> be a big problem with that. (I could see that the "mkdir" part might
> give an error if the /home/sa/Desktop already exists -- but the script
> should continue anyway.)
>
> > rpm -qa does show that the RPM was installed, however, using the -U
> > option one the one file that was suppsed to change is not, in fact,
> > changed.
> >
> > I used --force as part of the troubleshooting process because I wanted
> > to see under what circumstances the RPM worked as expected and under
> > what circumstances if failed to work as expected.
>
> Well I suppose that's an okay use of --force ... :-) Sorry for my
> soapbox comments.
>
> > It works as expected
> > if:
> >
> > No previous version installed:
> > rpm -ivh rpmname
> >
> > Previous version installed:
> >
> > rpm -ivh rpmname --force
> >
> > rpm -e rpmname
> > rpm -ivh rpmname
> >
> > It does not work as expected in the following case:
> >
> > rpm -Uvh rpmname
>
> This definitely seems odd.
>
> Is the file in question marked with %config or other special macro, or
> is it just a "normal" file?
It's just a regular file...
>
> Is there any way you could post the .spec files in question?
Here it is. I'm sure that I did something silly.
---
Summary: A file that sets up the SA Menu.
Name: sa_menu_update
Version: 1.0
Release: 2
Copyright: GPL
Vendor: Extension Information Technology (EIT)
Source: production_sa_menu.tar.gz
Group: Applications/System
Packager: Janyne Kizer <janyne_kizer at ncsu.edu>
%description
verbage about the RPM
%prep
# backup the old files first
mkdir /tmp/sa_menu
mv /home/sa/* /tmp/sa_menu
cd /tmp
tar uf sa_menu.tar sa_menu
mv sa_menu.tar /home/ets
rm -rf /tmp/sa_menu
%setup -c production_sa_menu
%post
chown sa /home/sa/*
mkdir /home/sa/Desktop
chown sa /home/sa/Desktop
chmod 444 /home/sa/Desktop
%install
mv Backup.pl /home/sa
mv ch_pass.pl /home/sa
mv logoff_user.pl /home/sa
mv no_no.pl /home/sa
mv powerdown.pl /home/sa
mv printmenu.pl /home/sa
mv README_SAMenu.txt /home/sa
mv sa_kill.pl /home/sa
mv SAMenu.pl /home/sa
mv who2.sh /home/sa
mv who_short.sh /home/sa
mv SAMenu.desktop /home/sa/.kde/Autostart
%postun
cp /home/ets/sa_menu.tar /tmp
cd /tmp
tar xf sa_menu.tar
mv /tmp/sa_menu/* /home/sa
rm -rf /tmp/sa_menu
%files
/home/sa/Backup.pl
/home/sa/ch_pass.pl
/home/sa/logoff_user.pl
/home/sa/no_no.pl
/home/sa/powerdown.pl
/home/sa/printmenu.pl
/home/sa/README_SAMenu.txt
/home/sa/sa_kill.pl
/home/sa/SAMenu.pl
/home/sa/who2.sh
/home/sa/who_short.sh
/home/sa/.kde/Autostart/SAMenu.desktop
>
> If no one here answers your question, you could also consider posting to
> rpm-list at redhat.com (see
> https://listman.redhat.com/mailman/listinfo/rpm-list )
>
> Hope this helps,
> Jeremy
>
> (been playing with RPM way too much lately, can you tell?)
>
> _______________________________________________
> TriLUG mailing list
> http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
> http://www.trilug.org/~lovelace/faq/TriLUG-faq.html
--
Janyne Kizer
Systems Programmer Administrator
NC State University, College of Agriculture & Life Sciences
Extension Information Technology
More information about the TriLUG
mailing list