source: projects/proc-rpmnew/trunk/proc-rpmnew.in @ 4547

Revision 4547, 1.1 KB checked in by yasumichi, 13 years ago (diff)

gettextized.

Line 
1#!/bin/bash
2
3TEXTDOMAIN=proc-rpmnew
4TEXTDOMAINDIR=/usr/share/locale
5
6prefix=@prefix@
7datadir=@datadir@
8
9output_menu()
10{
11        echo $"s) Show difference."
12        echo $"e) Edit on diff mode of vim."
13        echo $"i) merge Intaractively by sdiff."
14        echo $"r) Replace current file by saved file."
15        echo $"p) Protect current file and remove saved file."
16        echo $"n) Next file."
17        echo -n $"Do you want to? > "
18}
19
20for file in `find /etc 2>/dev/null | @EGREP@ "rpm(new|save)$"`
21do
22        dir=`dirname $file`
23        sav=`basename $file`
24        cur=`basename $file .rpmnew`
25        if [ $cur = $sav ]
26        then
27                cur=`basename $file .rpmsave`
28        fi
29        if [ -e $cur ]
30        then
31                continue
32        fi
33        echo $"$file is saved."
34        ok=0
35        while [ $ok -eq 0 ]
36        do
37                output_menu
38
39                read command
40                echo
41                case "$command" in
42                        s)      diff --side-by-side $dir/$cur $dir/$sav | pager ;;      # --suppress-common-lines
43
44                        e)      vim +r$dir/$cur -d $dir/$cur.new $dir/$sav
45                                mv $dir/$cur.new $dir/$cur ;;
46
47                        i)      sdiff -o $dir/$cur.new $dir/$cur $dir/$sav
48                                mv $dir/$cur.new $dir/$cur ;;
49
50                        r)      mv $dir/$sav $dir/$cur
51                                ok=1;;
52
53                        p)      rm $dir/$sav
54                                ok=1;;
55
56                        n)      ok=1;;
57
58                        *)      echo $"You inputed wrong character."
59                                echo;;
60                esac
61        done
62done
Note: See TracBrowser for help on using the repository browser.