You are not logged in.
I got no secret, I love meld . Does a great job of showing differences alot of times if even scattered all over the page, allows for copy and paste... vimdiff is good but requires a much more keypresses, copy and paste isn't as elegant, and with my fixed drop-down terminal is just too narrow to be able to do it well. So what I usually end up doing is:
find /etc -type f -name "*.pacnew"
and just go through them one at a time:
kdesu meld /etc/config /etc/config.pacnew
I haven't do much work with loops, so I was hoping that someone that knew a little about them that could create a script that would go through them one by one. I suppose this is going to be a little tricker because (I imagine) it's going to have to detect when the windowed instance closes.
From the knowledge I know, I would do:
#!/bin/bash
# etc-update - merge *.pacnew files with original configurations with meld
pacnew=$(find /etc -type f -name "*.pacnew")
for i in $pacnew
do
kdesu meld $i
done
Which isn't going to work very well. Well, I guess it could, but it's going to open them all at once and leave a nice scruched-up taskbar with *.pacnew files. Like to be able to go through them one by one.
Anyone had any experiences at this that could help?
Last edited by Gen2ly (2009-10-03 01:46:55)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Maybe....
#!/bin/bash
# etc-update - merge *.pacnew files with original configurations with meld
pacnew=$(find /etc -type f -name "*.pacnew")
for i in $pacnew
do
kdesu meld $(basename $i .pacmew) $i &
wait
done
Note - untested
Offline
http://pbrisbin.com:8080/bin/pacnews
just do a find/replace of vimdiff for meld (or whatever...)
//github/
Offline
I just edited the pacdiff script to use meld and it worked great : ) -- I am not at home atm, but if you would like I can post up my edited pacdiff script.
Last edited by ugkbunb (2009-10-02 16:40:44)
Offline
Maybe....
#!/bin/bash # etc-update - merge *.pacnew files with original configurations with meld pacnew=$(find /etc -type f -name "*.pacnew") for i in $pacnew do kdesu meld $(basename $i .pacmew) $i & wait done
Note - untested
pacmew ? Kittens ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
How about
#!/bin/bash
pacnew=$(find /etc -type f -name "*.pacnew")
for i in $pacnew ; do
kdesu meld $i &
while (ps -e | grep ^$! &>/dev/null); do
sleep 1
done
done
Edit: wait!
Last edited by lolilolicon (2009-10-02 17:46:29)
This silver ladybug at line 28...
Offline
Nice one lolilolicon. BTW $! does not expire, so you could use kdesu meld $i & while [ -d /proc/$! ]; do sleep 1; done
Offline
Nice one lolilolicon. BTW $! does not expire, so you could use kdesu meld $i & while [ -d /proc/$! ]; do sleep 1; done
Procyon, this is Great!
This silver ladybug at line 28...
Offline
i wrote my full script a while back... but in the interest of a find-the-simplest-way challenge i'll post this version of allan's
for file in $(find /etc -name '*.pacnew'); do meld ${file/.pacnew/} $file; done
why do you all send it to the background then wait for it? just leave it in foreground and the loop will wait for you, right?
/edit: screwed up the order
/edit2: nope, had it right the first time...
Last edited by brisbin33 (2009-10-02 18:57:32)
//github/
Offline
http://pbrisbin.com:8080/bin/pacnews
just do a find/replace of vimdiff for meld (or whatever...)
Nice script, bris. If I had know about that before, I'd be using it. Do like the idea of the walk-through process and the saving of the the current one.
lol, I just read your last post and just what I thought about.
I just edited the pacdiff script to use meld and it worked great : ) -- I am not at home atm, but if you would like I can post up my edited pacdiff script.
Yeah, I saw that on the wiki. Said it was for CLI though so I didn't get to try.
@ lolilolicon, and Procyon
Still learning about pids, what I have seen was more complicated than this. Pretty clever.
Maybe....
#!/bin/bash # etc-update - merge *.pacnew files with original configurations with meld pacnew=$(find /etc -type f -name "*.pacnew") for i in $pacnew do kdesu meld $(basename $i .pacmew) $i & wait done
Note - untested
Ah, very nice. Also fits into my knowledge of bash. Hadn't thought about just using & but it works great. Had to truncate the file extension and just used a bash filter:
#!/bin/bash
# pacnew-diff - merge *.pacnew files with original configurations with meld
pacnew=$(find /etc -type f -name "*.pacnew")
for config in $pacnew
do
kdesu meld ${config%\.*} $config &
wait
done
Like to be able to do a backup of the current config and then erase the pacnew file afterword, but havn't found out a way to do that without having to type in a password everytime, but, I guess, that can easily be done elsewhere.
Last edited by Gen2ly (2009-10-02 20:27:17)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Ooop, forgot to mention Thanks to everyone for all the help.
Thanks o/
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline