configure: generic run command

This commit is contained in:
Richo Healey 2015-04-27 00:58:31 -07:00
parent 5fb0259edf
commit a8ea78bc35

14
configure vendored
View File

@ -19,6 +19,11 @@ err() {
exit 1
}
run() {
msg "$@"
"$@"
}
need_ok() {
if [ $? -ne 0 ]
then
@ -36,8 +41,7 @@ need_cmd() {
make_dir() {
if [ ! -d $1 ]
then
msg "mkdir -p $1"
mkdir -p $1
run mkdir -p $1
fi
}
@ -46,8 +50,7 @@ copy_if_changed() {
then
msg "leaving $2 unchanged"
else
msg "cp $1 $2"
cp -f $1 $2
run cp -f $1 $2
chmod u-w $2 # make copied artifact read-only
fi
}
@ -57,8 +60,7 @@ move_if_changed() {
then
msg "leaving $2 unchanged"
else
msg "mv $1 $2"
mv -f $1 $2
run mv -f $1 $2
chmod u-w $2 # make moved artifact read-only
fi
}