diff --git a/build-compare.changes b/build-compare.changes index 6b8871c..631a249 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 8 12:35:21 UTC 2012 - aj@suse.de + +- Further handling of pdf files (bnc#760867), patch by + David Haller . + ------------------------------------------------------------------- Mon May 7 14:50:43 UTC 2012 - aj@suse.de diff --git a/rpm-check.sh b/rpm-check.sh index 5d4f4d0..bafec5e 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -138,7 +138,7 @@ diff_two_files() check_single_file() { - local file=$1 + local file="$1" case $file in *.spec) sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file @@ -406,13 +406,22 @@ check_single_file() # PDF files contain a unique ID, remove it # Format of the ID is: # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>] - # pdftex creates also: + # with optional spaces. pdftex creates also: # /CreationDate (D:20120103083206Z) # /ModDate (D:20120103083206Z) - for f in old/$file new/$file; do - sed -i -e 's%/ID \?\[ \?<[^>]\+> <[^>]\+> \?\]%/IDrandom%g' $f - sed -i -e 's%/CreationDate (D:.*)%/CreationDate (D: XXX)%g' $f - sed -i -e 's%/ModDate (D:.*)%/ModDate (D: XXX)%g' $f + # and possibly XML metadata as well + for f in "old/$file" "new/$file"; do + sed -i \ + '/obj/,/endobj/{ + s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g; + s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g; + s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + }' "$f" done ;; esac