Dear Fedoreans,
Having followed the debate over whether to flag init scripts as %config files, I thought that there's a feature of another package manager that I liked: when a config file has changed, it asks you if you want to keep your local copy or if you want to install the package's version. RPM is non-interactive, so it's not supposed to do this. But I thought this could be implemented in a yum plugin.
I've written a plugin which does just this: http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/merge-conf.py http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.0...
Add the --merge-conf command line option to your yum update, and it will ask you what to do with those .rpm{save,new} files as the packages are installed. You'll be able to diff the files, choose your version, or spawn a shell to check further.
If you think you could be interested in this feature, please have a look. If you think it's a useful plugin and it's decently written (it's my first yum plugin), I'll submit it to the yum list.
Cheers,
Aurélien
On Sun, Mar 11, 2007 at 06:05:46PM +0100, Aurelien Bompard wrote:
Dear Fedoreans,
Having followed the debate over whether to flag init scripts as %config files, I thought that there's a feature of another package manager that I liked: when a config file has changed, it asks you if you want to keep your local copy or if you want to install the package's version. RPM is non-interactive, so it's not supposed to do this. But I thought this could be implemented in a yum plugin.
I've written a plugin which does just this: http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/merge-conf.py http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.0...
Add the --merge-conf command line option to your yum update, and it will ask you what to do with those .rpm{save,new} files as the packages are installed. You'll be able to diff the files, choose your version, or spawn a shell to check further.
If you think you could be interested in this feature, please have a look. If you think it's a useful plugin and it's decently written (it's my first yum plugin), I'll submit it to the yum list.
Nice work, Aurélien. I had been toying around with the idea of throwing together something similar.
I haven't had time to look into it further, but With this plugin enabled, `yum update` ends with a 'Package Header Not Available' message:
Running Transaction Updating : python-sqlalchemy ######################### [1/2] Cleanup : python-sqlalchemy ######################### [2/2]
Package Header Not Available
luke
Luke Macken wrote:
Nice work, Aurélien. I had been toying around with the idea of throwing together something similar.
Thanks :) Hope some people will find it useful
I haven't had time to look into it further, but With this plugin enabled, `yum update` ends with a 'Package Header Not Available' message
It this RawHide ? I did not try it on a rawhide system, I hear yum can do without the rpm headers there ? That would explain the error.
I have a RawHide machine at work, I'll have a look tomorrow.
Thanks for your feedback !
Aurélien
On Mon, 2007-03-12 at 20:26 +0100, Aurelien Bompard wrote:
Luke Macken wrote:
Nice work, Aurélien. I had been toying around with the idea of throwing together something similar.
Thanks :) Hope some people will find it useful
I haven't had time to look into it further, but With this plugin enabled, `yum update` ends with a 'Package Header Not Available' message
It this RawHide ? I did not try it on a rawhide system, I hear yum can do without the rpm headers there ? That would explain the error.
I have a RawHide machine at work, I'll have a look tomorrow.
Thanks for your feedback !
yum 3.1.4 will run just fine on fc6.
-sv
On Mon, Mar 12, 2007 at 08:26:56PM +0100, Aurelien Bompard wrote:
Luke Macken wrote:
Nice work, Aurélien. I had been toying around with the idea of throwing together something similar.
Thanks :) Hope some people will find it useful
I haven't had time to look into it further, but With this plugin enabled, `yum update` ends with a 'Package Header Not Available' message
It this RawHide ? I did not try it on a rawhide system, I hear yum can do without the rpm headers there ? That would explain the error.
I have a RawHide machine at work, I'll have a look tomorrow.
Thanks for your feedback !
Nope, this is FC6 running yum-3.0.4-1.fc6
luke
Aurelien Bompard wrote:
Dear Fedoreans,
Having followed the debate over whether to flag init scripts as %config files, I thought that there's a feature of another package manager that I liked: when a config file has changed, it asks you if you want to keep your local copy or if you want to install the package's version. RPM is non-interactive, so it's not supposed to do this. But I thought this could be implemented in a yum plugin.
I've written a plugin which does just this: http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/merge-conf.py
http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.0...
Add the --merge-conf command line option to your yum update, and it will ask you what to do with those .rpm{save,new} files as the packages are installed. You'll be able to diff the files, choose your version, or spawn a shell to check further.
If you think you could be interested in this feature, please have a look. If you think it's a useful plugin and it's decently written (it's my first yum plugin), I'll submit it to the yum list.
This sounds great! I haven't looked at the code yet. Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
Neal Becker wrote:
This sounds great! I haven't looked at the code yet.
It's pretty trivial, you'll see
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed. The plugin just looks for .rpmsave/.rpmnew files (depending if it's a %config or a %config(noreplace))
Aurélien
On Tue, Mar 13, 2007 at 07:52:42AM +0100, Aurelien Bompard wrote:
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed. The plugin just looks for .rpmsave/.rpmnew files (depending if it's a %config or a %config(noreplace))
Unfortunately rpm creates on multiarch .rpmnew files for configs which differ only in modification time (see #128622).
It would be nice to have an additional check implemented in the plugin to workaround the bug.
Miroslav Lichvar wrote:
On Tue, Mar 13, 2007 at 07:52:42AM +0100, Aurelien Bompard wrote:
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed. The plugin just looks for .rpmsave/.rpmnew files (depending if it's a %config or a %config(noreplace))
Unfortunately rpm creates on multiarch .rpmnew files for configs which differ only in modification time (see #128622).
It would be nice to have an additional check implemented in the plugin to workaround the bug.
Yes, that's what I meant. Please, please.
Neal Becker wrote:
It would be nice to have an additional check implemented in the plugin to workaround the bug.
Yes, that's what I meant. Please, please.
That's trivial to do, I've added it. I also made a few fixes, the plugin should now work on FC6's yum and RawHide's yum too. I've updated the plugin itself only, the RPM is not updated. Just copy it to /usr/lib/yum-plugins http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/merge-conf.py Please tell me what you think of it, what I should change, and what I should add.
Thanks for your feedback
Aurélien
Aurelien Bompard wrote:
Neal Becker wrote:
It would be nice to have an additional check implemented in the plugin to workaround the bug.
Yes, that's what I meant. Please, please.
That's trivial to do, I've added it. I also made a few fixes, the plugin should now work on FC6's yum and RawHide's yum too. I've updated the plugin itself only, the RPM is not updated. Just copy it to /usr/lib/yum-plugins http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/merge-conf.py Please tell me what you think of it, what I should change, and what I should add.
Now, I don't speak python fluently, but as far as I can tell, the script will simply continue after the "diff" is run? Would it be more intuitive if it would ask again if it should keep or replace after the diff is shown?
Rgds.
Ola Thoresen
Ola Thoresen wrote:
Now, I don't speak python fluently, but as far as I can tell, the script will simply continue after the "diff" is run? Would it be more intuitive if it would ask again if it should keep or replace after the diff is shown?
That's what it's supposed to do. Just try it, you'll see. I've updated the packages too, so just install http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.0...
Aurélien
Darn, wrong link. It's : http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.1... for the fixed version.
Aurélien
Aurelien Bompard wrote:
Darn, wrong link. It's : http://gauret.free.fr/fichiers/rpms/fedora/yum-merge-conf/yum-merge-conf-1.1... for the fixed version.
Is there any quick way to test this plugin?
Rahul
Rahul Sundaram wrote:
Is there any quick way to test this plugin?
Yes, just install this rpm (it's two files, the plugin and the ini file, no scriptlets) Then, you'll have to trigger the .rpm{save,new}-creating behavior by installing an old version of an rpm which has %config files, modifying one of them, and upgrading to a newer version using "yum --merge-conf update thepackage" RPM should create an .rpm{save,orig} file, which should be picked up by the plugins, and then you'll see what happens.
I've been using it for a few days now, it seems to work fine for me. I'm very interested by any feedback.
Thanks Aurélien
Miroslav Lichvar wrote:
It would be nice to have an additional check implemented in the plugin to workaround the bug.
Like a checksum? That would be nice.
At 7:52 AM +0100 3/13/07, Aurelien Bompard wrote:
Neal Becker wrote:
This sounds great! I haven't looked at the code yet.
It's pretty trivial, you'll see
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed.
One would think so, but no, not always. Vim's rpm is one offender (retyped):
# ls /etc/vimrc* /etc/vimrc /etc/vimrc.rpmnew # diff /etc/vimrc* #
The plugin just looks for .rpmsave/.rpmnew files (depending if it's a %config or a %config(noreplace))
Hopefully it will be able to detect and merge such files. They're certainly the easiest and safest to merge. ;-)
Tony Nelson wrote:
At 7:52 AM +0100 3/13/07, Aurelien Bompard wrote:
Neal Becker wrote:
This sounds great! I haven't looked at the code yet.
It's pretty trivial, you'll see
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed.
One would think so, but no, not always. Vim's rpm is one offender (retyped):
# ls /etc/vimrc* /etc/vimrc /etc/vimrc.rpmnew # diff /etc/vimrc*
timestamp, owner, permissions?
-- Rex
At 10:57 AM -0500 3/13/07, Rex Dieter wrote:
Tony Nelson wrote:
At 7:52 AM +0100 3/13/07, Aurelien Bompard wrote:
Neal Becker wrote:
This sounds great! I haven't looked at the code yet.
It's pretty trivial, you'll see
Will it also ignore cases when the new config hasn't actually changed, and silently remove the redundant copy? That would be really great.
If RPM created a copy, it means something has changed.
One would think so, but no, not always. Vim's rpm is one offender (retyped):
# ls /etc/vimrc* /etc/vimrc /etc/vimrc.rpmnew # diff /etc/vimrc*
timestamp, owner, permissions?
(retyped):
# ll /etc/vimrc* -rw-r--r-- 1 root root 1473 Nov 15 21:59 /etc/vimrc -rw-r--r-- 1 root root 1473 Mar 9 2006 /etc/vimrc.rpmnew #
OK, so maybe it's not still doing it there. But this one looks more promising (I hope):
# ll /etc/profile.d/krb* -rwxr-xr-x 1 root root 218 Jan 9 15:03 /etc/profile.d/krb5.csh -rwxr-xr-x 1 root root 218 Jan 9 15:03 /etc/profile.d/krb5.csh.rpmnew -rwxr-xr-x 1 root root 229 Jan 9 15:03 /etc/profile.d/krb5.sh -rwxr-xr-x 1 root root 229 Jan 9 15:03 /etc/profile.d/krb5.sh.rpmnew # diff /etc/profile.d/krb*.csh* # diff /etc/profile.d/krb*.sh* #