diff options
author | jhb <jhb@FreeBSD.org> | 2013-11-15 20:01:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-11-15 20:01:07 +0000 |
commit | 585cee353e64abc03787f969eb0e9b89ff9d9b90 (patch) | |
tree | 42e48beb48d4a7bf1823d9259b9ad965c54eb6a5 /usr.sbin/etcupdate | |
parent | bac3f925836523cf3dc83ad697a5d6f18a5c0410 (diff) | |
download | FreeBSD-src-585cee353e64abc03787f969eb0e9b89ff9d9b90.zip FreeBSD-src-585cee353e64abc03787f969eb0e9b89ff9d9b90.tar.gz |
Fix a couple of issues with -F:
- Fix ALWAYS_INSTALL to take precedence over the FreeBSD ID checks.
In particular, always install a file where the only change was
the FreeBSD ID even if -F is specified.
- Fix the -F option in the case that the only upstream change is a
change in the FreeBSD ID and the local file is removed.
- Add tests for these two cases.
Diffstat (limited to 'usr.sbin/etcupdate')
-rwxr-xr-x | usr.sbin/etcupdate/etcupdate.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index b1605fa..e5ffe48 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -1026,16 +1026,6 @@ handle_modified_file() fi fi - # If the only change in the new file versus the old file is a - # change in the FreeBSD ID string and -F is specified, just - # update the FreeBSD ID string in the local file. - if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \ - fbsdid_only $OLDTREE/$file $NEWTREE/$file; then - if update_freebsdid $file; then - continue - fi - fi - # If the file was removed from the dest tree, just whine. if [ $newdestcmp -eq $COMPARE_ONLYFIRST ]; then # If the removed file matches an ALWAYS_INSTALL glob, @@ -1050,6 +1040,14 @@ handle_modified_file() return fi + # If the only change in the new file versus the old + # file is a change in the FreeBSD ID string and -F is + # specified, don't warn. + if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \ + fbsdid_only $OLDTREE/$file $NEWTREE/$file; then + return + fi + case $cmp in $COMPARE_DIFFTYPE) old=`file_type $OLDTREE/$file` @@ -1080,6 +1078,16 @@ handle_modified_file() fi fi + # If the only change in the new file versus the old file is a + # change in the FreeBSD ID string and -F is specified, just + # update the FreeBSD ID string in the local file. + if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \ + fbsdid_only $OLDTREE/$file $NEWTREE/$file; then + if update_freebsdid $file; then + continue + fi + fi + # If the file changed types between the old and new trees but # the files in the new and dest tree are both of the same # type, treat it like an added file just comparing the new and |