summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD4
-rwxr-xr-xpacman-diffs10
3 files changed, 13 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1f6301f1ff5e..e0352e41697d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -8,6 +8,8 @@ pkgbase = pacman-diffs
depends = diffutils
optdepends = diffuse: graphical editor[community]
optdepends = kompare: kde editor [extra]
+ optdepends = gksu: gnome gui for su
+ optdepends = kdesu: kde gui for su
source = pacman-diffs
md5sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index b34da62bd377..d78cfbcdfd1c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,9 @@ arch=('any')
license=('GPL')
depends=('findutils' 'diffutils')
optdepends=('diffuse: graphical editor[community]'
- 'kompare: kde editor [extra]')
+ 'kompare: kde editor [extra]'
+ 'gksu: gnome gui for su'
+ 'kdesu: kde gui for su')
source=("pacman-diffs")
md5sums=('SKIP')
diff --git a/pacman-diffs b/pacman-diffs
index a5ab4d5e5563..2596f1dec11e 100755
--- a/pacman-diffs
+++ b/pacman-diffs
@@ -75,10 +75,16 @@ find '/etc' -name "*.$EXT" -mtime -$AGE -type f 2> /dev/null | while read file ;
fi
if [ "$edit" == "$fname" ]; then
+ kdesu=''
+ if [ -f '/usr/bin/kdesu' ]; then
+ kdesu='kdesu'
+ else
+ [ -f '/usr/bin/gksu' ] && kdesu='gksu'
+ fi
if [ -f '/usr/bin/diffuse' ]; then
- /usr/bin/diffuse $ofile $file &
+ $kdesu /usr/bin/diffuse $ofile $file &
else
- [ -f '/usr/bin/kompare' ] && /usr/bin/kompare $ofile $file &
+ [ -f '/usr/bin/kompare' ] && $kdesu /usr/bin/kompare $ofile $file &
fi
fi