summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorpapajoker2015-10-04 12:57:51 +0200
committerpapajoker2015-10-04 12:57:51 +0200
commitcd7620ef9f6ace6a92eb691850add38a0d98aa0c (patch)
tree3a408916152e32c2db422bc2a7878e591203ebe1
parentb29acae05b205924c1036d9a8b4adb6b4146ec10 (diff)
downloadaur-cd7620ef9f6ace6a92eb691850add38a0d98aa0c.tar.gz
fix erase msg
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rwxr-xr-xpacman-diffs20
3 files changed, 12 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4985e38c1b93..46aa48faa635 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pacman-diffs
pkgdesc = finding .pacnew files and compare, and archive
pkgver = 1.1.0
- pkgrel = 0
+ pkgrel = 1
arch = any
license = GPL
depends = findutils
diff --git a/PKGBUILD b/PKGBUILD
index f9a1139a1260..447d5d9353e0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Papajoker <papajoker [at] archlinux [dot] info>
pkgname=pacman-diffs
pkgver=1.1.0
-pkgrel=0
+pkgrel=1
pkgdesc="finding .pacnew files and compare, and archive"
arch=('any')
license=('GPL')
diff --git a/pacman-diffs b/pacman-diffs
index 7ad4ef51073c..21e4143ca497 100755
--- a/pacman-diffs
+++ b/pacman-diffs
@@ -103,17 +103,17 @@ function make_diff()
local file1="$1"
local file2="$2"
local original="$3"
- local nothing=1
- IFS=$'\n'
- # < : removed > : added
- diff $file1 $file2| grep -E "^>|^<" | while read line ; do
- if [ "${line::1}" = '<' ]; then c="$c_red-"; else c="$c_green+"; fi
- echo -e "$c ${line:2}$c_end"
- nothing=0
- done
- if [[ $nothing -eq 1 ]]; then
+
+ if [[ $(diff $file1 $file2|wc -l) -eq 0 ]]; then
# can remove etc/pacnew
- echo -e "-- ${c_yellow}${txt[erase]}${c_end} : sudo rm $file"
+ echo -e "-- ${c_yellow}${txt[erase]}${c_end} : sudo rm $original"
+ else
+ IFS=$'\n'
+ # < : removed > : added
+ diff $file1 $file2| grep -E "^>|^<" | while read line ; do
+ if [ "${line::1}" = '<' ]; then c="$c_red-"; else c="$c_green+"; fi
+ echo -e "$c ${line:2}$c_end"
+ done
fi
}