RE: Is it possible to refer to the files in the spec's pre script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks James.

I am not clear about this solution. Let me clarify my problem

I have created a package ABC-1.1-0.rpm.

This package has some bugs, and So i create a new patch rpm
ABC-1.1-0patch1.rpm.

The new ABC-1.1-0patch1.rpm package contains only those files that are
corrected out of "N" files in ABC-1.1-0.rpm.   These may be some java class
files or other files not really config files.

So before I install ABC-1.1-0patch1.rpm, I want to take the backup of all
those files that are contained ABC-1.1-0patch1.rpm, which are part of the
ABC-1.1-0.rpm as of this time.

So is there any way to do so.
I think if I have to use rpm -Uvh will erase old package and install new, in
my case will only install a few files not all the files.


Thanks
Sateesh



-----Original Message-----
From: James Olin Oden [mailto:joden@xxxxxxxxxxxxx]
Sent: Wednesday, September 01, 2004 6:32 PM
To: sahegde@xxxxxxxxx; RPM Package Manager
Subject: Re: Is it possible to refer to the files in the spec's pre
script


> Hi
> I have a requirement that, if  my RPM package is overwriting a file(any
> file, not only config) from another package, take the backup of that file.
> Basically I want to do something like the following in the %pre section
>
> %files -p $location/files.txt
> %pre
> tar -cf /opt/changedfiles.tar  %{files}
>
> But this is not working as it is.
On Tue, 31 Aug 2004, Sateesh wrote:
Would be better to scan the files payload of all the rpms that your are
going to install/upgrade and then see if they overwrite any files.  Those
files backup.  That said, if your requirements are loose enough that you
only need to backup all the files that are owned by each rpm being
upgraded, then in that case throw --repackage on the command line (or
better yet configure rpm to repackage all erasures, by adding the
following to your /etc/rpm/macros file (create it if it does not exist):

	#
	# If non-zero, all erasures will be automagically repackaged.
	# We want all erasures to be repackaged.
	%_repackage_all_erasures        1

If you take the time before you started the upgrade then you can do:

	rpm -Uvh --rollback "$TBeforeUpgrade"

to roll this back, or you can re-install the repackaged package
but you have to throw the --nodigest switch:

	rpm -Uvh --nodigest --oldpackage repackaged.rpm

Cheers...james


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux