CDNWiki
View Source:
KnowledgeBase/FreeBSD/merge-unchanged.sh
Note:
You are viewing an old version of this page.
View the current version.
Run mergemaster to set up /var/tmp/temproot, then abort it before touching any files. Run this against it, to install all files whose only change is their CVS ID Rerun mergemaster, and it will silently ignore the newly updated files <code brush="bash"> cd /var/tmp/temproot find . -type f | while read file do # Detect if there are any additions or deletions diff=$(diff -e "${file}" "/${file}") [ $? -eq 0 ] && continue # Ignore files with additions or deletions echo "${diff}" | egrep -q '^[0-9]+[ad]$' && continue # Ignore files with more than one change changes="$(echo "${diff}" | egrep -c '^[0-9]+c$')" [ "${changes}" -ne 1 ] && continue # Make sure the changed line is the FreeBSD CVS tag cvstag="$(echo "${diff}" | grep -c '$FreeBSD: ')" [ "${cvstag}" -ne 1 ] && continue mv -v "${file}" "/${file}" done </code>