From 50a447c4b88ad73e16dec18f354816a248c527fb Mon Sep 17 00:00:00 2001 From: lace <> Date: Fri, 18 Sep 2009 07:03:52 +0000 Subject: [PATCH] Support local changes present in .rpmnew. Do not stop on the first conflict. --- bin/rpmmerge | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/bin/rpmmerge b/bin/rpmmerge index 9cf201a..38eb885 100755 --- a/bin/rpmmerge +++ b/bin/rpmmerge @@ -3,6 +3,7 @@ set -ex +ok=true l="$*" [ -z "$l" ] && l="$(rpm -qla|perl -lne 'chomp;s/$/.rpmnew/;print if -f;')" for base in $l;do @@ -25,7 +26,15 @@ for base in $l;do continue fi - if diff -u $orig $base.rpmnew | patch -f $base + # Local changes present in new rpm? + if cmp -s $base $base.rpmnew + then + mv -f $base.rpmnew $base + cp -p $base $orig + continue + fi + + if diff -u $orig $base.rpmnew | patch -N $base then test ! -f $base.rej rm -f $base.orig @@ -36,9 +45,18 @@ for base in $l;do test -f $base.rej mv -f $base.orig $base rm -f $base.rej - exit 1 + + #exit 1 + ok=false + continue done -rpm -qac|perl -ne 'chomp;next if $_ eq "(contains no files)";next if m{^/var/lib/rpm/};next if $_ eq "/usr/lib/locale/locale-archive";next if ! -f $_;$o=$_;$o=~tr{/}{-};$o="/root/rpmmerge/$o";next if -e $o;system "cp -i -p '\''$_'\'' '\''$o'\''" and die "$_: $!";' +if $ok +then + rpm -qac|perl -ne 'chomp;next if $_ eq "(contains no files)";next if m{^/var/lib/rpm/};next if $_ eq "/usr/lib/locale/locale-archive";next if ! -f $_;$o=$_;$o=~tr{/}{-};$o="/root/rpmmerge/$o";next if -e $o;system "cp -i -p '\''$_'\'' '\''$o'\''" and die "$_: $!";' -echo OK + echo OK +else + echo ERRORS + exit 1 +fi -- 1.8.3.1