You are not logged in.

#1 2008-08-15 18:38:05

RAH
Member
Registered: 2008-06-20
Posts: 205

Dealing With .pacnew Files

Hello,

What is the best way of dealing with .pacnew files?  I believe there is some package which merges changes for you automatically?  Pacman is great but dealing with .pacnew files can be a hassle.

Thanks.

Offline

#2 2008-08-15 18:39:54

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Dealing With .pacnew Files

I would use vimdiff:

vimdiff /etc/pacman.conf /etc/pacman.conf.pacnew

Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#3 2008-08-15 18:42:38

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

vimdiff needs installed right?  Also can it be done with nano?

Offline

#4 2008-08-15 18:55:45

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: Dealing With .pacnew Files

I think there is a program "pacdiffviewer" that comes with yaourt (best addition to pacman ever big_smile).  Also, I think there is a "pacdiff" script that comes in pacman-contrib.  I believe either of those may work with .pacnew files.  Although I haven't had any .pacnew files recently to see what happens.


Nai haryuvalyë melwa rë

Offline

#5 2008-08-15 19:00:05

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

How do I install any of these?  I can't find vimdiff in the default repositories.  I've heard a lot about yaourt - so it's an addon not a replacement for pacman?

Offline

#6 2008-08-15 19:06:44

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Dealing With .pacnew Files

I like pacdiff from pacman-contrib, but it uses vimdiff (at least by default). I use vim and vimdiff all the time though tongue
I guess many advanced editors can have an equivalent feature by one way or another, I just don't know them.

And yaourt is a pacman wrapper, written in bash.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2008-08-15 19:10:27

giddygiddyBA
Member
From: Montreal
Registered: 2004-12-30
Posts: 66

Re: Dealing With .pacnew Files

just use the -d option

vim -d file1 file2

works exactly like vimdiff

Offline

#8 2008-08-15 19:12:00

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: Dealing With .pacnew Files

Yaourt I believe is a wrapper for pacman.  It has its own config file in /etc (don't remember what and not at my machine right now to check) that tells it what program to use.  It defaults to pacman.  You can also tell it to use pacman-color, which is pacman that has been patched with extra color output.  So yaourt is just a wrapper for pacman.  http://archlinux.fr/yaourt-en/

You can get yaourt by building in AUR or by adding archlinux.fr repos (easier than AUR).  Instructions for adding that on the site i just mentioned.  I like to use yaourt because it integrates AUR with everything.

pacdiffviewer comes with yaourt.  pacdiff is in the pacman-contrib package which is in the community repo.


Nai haryuvalyë melwa rë

Offline

#9 2008-08-15 19:18:10

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: Dealing With .pacnew Files

In yaourt-git, you can find a new feature for automerging of .pacnew files. Just add "AutoSaveBackupFile yes" in /etc/yaourtrc to use it later with yaourt -C.

Offline

#10 2008-08-15 20:44:50

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Dealing With .pacnew Files

RAH wrote:

vimdiff needs installed right?  Also can it be done with nano?

Just for your information, vimdiff comes with vim wink
I don't know about nano, unfortunately.


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#11 2008-08-15 21:33:37

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

wain wrote:

In yaourt-git, you can find a new feature for automerging of .pacnew files. Just add "AutoSaveBackupFile yes" in /etc/yaourtrc to use it later with yaourt -C.

This sounds just like what I'd want.  Does yaourt-git come with yaourt?

Offline

#12 2008-08-15 23:18:21

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: Dealing With .pacnew Files

RAH wrote:
wain wrote:

In yaourt-git, you can find a new feature for automerging of .pacnew files. Just add "AutoSaveBackupFile yes" in /etc/yaourtrc to use it later with yaourt -C.

This sounds just like what I'd want.  Does yaourt-git come with yaourt?

yaourt-git is the developement version of yaourt. You can install it with:

pacman -U http://projects.archlinux.fr/~wain/yaourt-git-20080816_0112-1-i686.pkg.tar.gz

Offline

#13 2008-08-15 23:26:25

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

wain wrote:
RAH wrote:
wain wrote:

In yaourt-git, you can find a new feature for automerging of .pacnew files. Just add "AutoSaveBackupFile yes" in /etc/yaourtrc to use it later with yaourt -C.

This sounds just like what I'd want.  Does yaourt-git come with yaourt?

yaourt-git is the developement version of yaourt. You can install it with:

pacman -U http://projects.archlinux.fr/~wain/yaourt-git-20080816_0112-1-i686.pkg.tar.gz

Done.  So how do I go about using this rather than the usual pacman -Syu?  Also can I get it to sort out my existing .pacnew files?  Thanks.

Offline

#14 2008-08-16 00:00:27

toorima
Member
Registered: 2007-11-06
Posts: 12

Re: Dealing With .pacnew Files

meld is another tool to merge .pacnew files, its in the extra repo
http://meld.sourceforge.net/

Offline

#15 2008-08-16 02:23:30

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: Dealing With .pacnew Files

The flags for yaourt are exactly the same as for pacman.  So to update everything, "yaourt -Syu".  To install something, "yaourt -S packagename".  To search for something, "yaourt -Ss".  The beauty of it is that it also searches thru AUR and installs from AUR.  You can also upgrade your AUR packages with your normal update of everything: "yaourt -Syu --aur".  I just put some aliases in my shell's rc file so I can be extra lazy in typing in the commands.  Look at "man yaourt" for more info.

As far as merging the .pacnew files, check on http://wiki.archlinux.fr/howto:archlinu … ave_pacnew , but it sounds to me that at least with the -git version of yaourt, add "AutoSaveBackupFile yes" in /etc/yaourtrc.  Then run "yaourt -C" and it will go through the .pacnew files and ask you what you want to do with them.


Nai haryuvalyë melwa rë

Offline

#16 2008-08-16 11:41:41

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: Dealing With .pacnew Files

There is also pacdiff which is in pacman-contrib in [community].  Seems simpler than installing a whole new package manager just to simplify merging of *.pacnew files.

Offline

#17 2008-08-16 13:51:16

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

==> What do you want to do with /etc/inittab[.pacnew] ?
1: Show diffs with gvim in expert mode
2: Show diffs with vimdiff (in console)
3: Show diffs with kompare
4: Show diffs with kdiff3
5: gvim in EASY mode
6: Enter a command to edit
S: suppress .pacnew file
R: replace actual file by .pacnew
==> Press ENTER to return to menu

What should I be using?  Isn't there some sort of auto-merge option?

Offline

#18 2008-08-16 14:06:39

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Dealing With .pacnew Files

Isn't there some sort of auto-merge option?

no, you can't be that lazy.

It requires some skill to look at the files and see the differences, then it needs a humans interaction to tell it what to do.

For the most part, you'd wanna upgrade to the new .pacnew file. But, what happens if you altered one of these files for a specific task only unique to your pc? You wouldn't wanna overwrite your changes with the new .pacnew file. Instead you would wanna alter the new .pacnew file with your old changes (if neccessary) and then

mv *.conf.pacnew *.conf

Offline

#19 2008-08-16 14:20:24

RAH
Member
Registered: 2008-06-20
Posts: 205

Re: Dealing With .pacnew Files

None of the options on the list do anything, I presume I need to install these various packages first?

Offline

#20 2008-08-16 15:19:41

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Dealing With .pacnew Files

RAH wrote:

None of the options on the list do anything, I presume I need to install these various packages first?

S and R don't do anything?

Offline

#21 2008-08-16 15:22:04

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: Dealing With .pacnew Files

RAH wrote:

What should I be using?  Isn't there some sort of auto-merge option?

auto-merge will only works next time. When a new .pacnew will come (thanks to AutoSaveBackupFile in yaourtrc) , yaourt will see the difference between those two version of .pacnew files and then will automerge them in your /etc/inittab file.
Be sure to have config files up to date the first time. Try to install "kdiff" or "kompare" or "vim", and do it manually.

Offline

#22 2008-08-16 16:05:26

rooloo
Member
Registered: 2008-07-09
Posts: 218

Re: Dealing With .pacnew Files

wain wrote:
RAH wrote:

What should I be using?  Isn't there some sort of auto-merge option?

auto-merge will only works next time. When a new .pacnew will come (thanks to AutoSaveBackupFile in yaourtrc) , yaourt will see the difference between those two version of .pacnew files and then will automerge them in your /etc/inittab file.
Be sure to have config files up to date the first time. Try to install "kdiff" or "kompare" or "vim", and do it manually.

So yaourt won't merge 'old' pacnew files, only ones that are being installed as the time of a -S operation?

Offline

#23 2008-08-16 17:18:44

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: Dealing With .pacnew Files

rooloo wrote:
wain wrote:
RAH wrote:

What should I be using?  Isn't there some sort of auto-merge option?

auto-merge will only works next time. When a new .pacnew will come (thanks to AutoSaveBackupFile in yaourtrc) , yaourt will see the difference between those two version of .pacnew files and then will automerge them in your /etc/inittab file.
Be sure to have config files up to date the first time. Try to install "kdiff" or "kompare" or "vim", and do it manually.

So yaourt won't merge 'old' pacnew files, only ones that are being installed as the time of a -S operation?

not really... Yaourt has to backup 2 version of each config file to make the merge. All you have to do is to enable AutoSaveBackupFile and use yaourt to install or upgrade package. Each config files will be saved automatically. From time to time, just run yaourt -C to check if .pacnew can be merged automatically.

Offline

#24 2009-10-03 01:48:12

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Dealing With .pacnew Files


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#25 2009-12-18 06:50:31

jmdennis
Member
Registered: 2009-03-21
Posts: 61

Re: Dealing With .pacnew Files

I appreciate these instructions.  I have screwed up my system taking the easy way out.  I am used to using other distributions that do not create these files or at least I do not know about them.  I have screwed up my system in that it would boot but then it would not recognize my keyboard or mouse so hard to use a system like this.  To bad I did not find this before I screwed up my system again.

Offline

Board footer

Powered by FluxBB