# HG changeset patch # User Christophe Lincoln # Date 1337119081 -7200 # Node ID 80b6f3e3bb6d5a052b1256e75f4fd58591b33720 # Parent 70c2d1ac28871c6b07b24ec5bcef262ada324ea5 spk-add: we do check modified each time, no test needed and dont add pkg to modifiers if already in diff -r 70c2d1ac2887 -r 80b6f3e3bb6d spk-add --- a/spk-add Tue May 15 23:32:17 2012 +0200 +++ b/spk-add Tue May 15 23:58:01 2012 +0200 @@ -125,44 +125,41 @@ fi [ "$debug" ] && echo "DEBUG: file_to_remove: $files_to_remove" - local check=false + # Create list of all possibly modified files local file_list - # Create list of all possibly modified files for i in $(fgrep -v [ $tmpdir/files.list); do [ -e "${root}${i}" ] || continue [ -d "${root}${i}" ] && continue file_list="$file_list $i" - check=true done [ "$debug" ] && echo "DEBUG: file_list is set" # Check possibly modified files against other packages files.list - if [ "$check" ]; then - [ "$debug" ] && echo "DEBUG: check modified files" - for file in $file_list - do - filegrep=$(egrep ^${file}$ $installed/*/files.list) - if [ "$filegrep" ]; then - local list=$(echo $filegrep | cut -d ":" -f 1) - local name=$(basename $(dirname $list)) - [ "$package_name" == "$name" ] && continue - echo -n "Modified package: $name" - status + [ "$debug" ] && echo "DEBUG: check modified files" + for file in $file_list + do + filegrep=$(egrep ^${file}$ $installed/*/files.list) + if [ "$filegrep" ]; then + local list=$(echo $filegrep | cut -d ":" -f 1) + local name=$(basename $(dirname $list)) + [ "$pkg" == "$name" ] && continue + echo -n "Modified package: $name" + # Tell $name that $pkg is going to overwrite some of its files + if [ -s "$installed/$name/volatile.cpio.gz" ]; then + # We can modify backed up files without notice + zcat $installed/$name/volatile.cpio.gz | cpio -t --quiet | \ + grep -q "^${file#/}$" && continue + fi + # Add $pkg to the modifiers list og $name + if ! egrep -q ^${package_name}$ $installed/$name/modifiers; then + [ "$debug" ] && \ + echo -en "\nDEBUG: Added $pkg to: $name/modifiers" + echo "$package_name" >> $installed/$name/modifiers + fi + status + fi + done - # Tell $pkg that $package_name is going to overwrite some - # of its files - #if [ -s "$pkg/volatile.cpio.gz" ]; then - ## We can modify backed up files without notice - #zcat $pkg/volatile.cpio.gz | cpio -t --quiet | \ - #grep -q "^${file#/}$" && continue - #fi - - [ "$debug" ] && \ - echo "DEBUG: Adding $pkg to: $name/modifiers" - echo "$pkg" >> $installed/$name/modifiers - fi - done - fi cd $tmpdir || exit 1 cp receipt files.list $package_dir