Skip to content

Commit 0407fe6

Browse files
committed
cat
1 parent af00742 commit 0407fe6

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

usr.sbin/etcupdate/etcupdate.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,9 @@ install_resolved()
673673
return 1
674674
fi
675675

676-
log "cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1"
677-
cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1 >&3 2>&1
676+
# Use cat rather than cp to preserve metadata
677+
log "cat ${CONFLICTS}$1 > ${DESTDIR}$1"
678+
cat ${CONFLICTS}$1 > ${DESTDIR}$1 2>&3
678679
post_install_file $1
679680
return 0
680681
}
@@ -1612,6 +1613,18 @@ EOF
16121613
cat $WARNINGS
16131614
fi
16141615

1616+
# If this was a dryrun, remove the temporary tree if we built
1617+
# a new one.
1618+
if [ -n "$dryrun" ]; then
1619+
if [ -n "$dir" ]; then
1620+
if [ -n "$rerun" ]; then
1621+
panic "Should not have a temporary directory"
1622+
fi
1623+
remove_tree $dir
1624+
fi
1625+
return
1626+
fi
1627+
16151628
# Finally, rotate any needed trees.
16161629
if [ "$new" != "$NEWTREE" ]; then
16171630
if [ -n "$rerun" ]; then

0 commit comments

Comments
 (0)