3 if [ -z "$1" -o -z "$2" -o -z "$3" -o \
( "$(whoami)" = "root" -a -z "$CHOWNUSER" \
) ] ; then
5 echo "Usage: ./save.sh results_dir dir_tag file_tag [script args...]"
7 echo "Runs the given script, and then copies all resulting binaries"
8 echo "from <results_dir>/results/ into build/<TAG> and renames all"
9 echo "the files to include <file_tag> in the name."
11 echo "Expects CHOWNUSER to be set appropriately"
12 echo "in the environment if run as root."
30 # copy the results back to the target directory
32 cp "$RESULTSDIR"/* "build/$TAG"
33 if [ "$(whoami)" = "root" ] ; then
34 chown
-R "$CHOWNUSER" "build/$TAG"
37 # We do this manually in a for loop, since the rename command is
38 # not the same across various linux distros...
44 mv "$f" "$(echo $f | sed "s
/_\
([^_
]*\
)\.deb$
/_
${SHORTTAG}_\
1.deb
/")"
50 mv "$f" "$(echo $f | sed "s
/\.\
([^.
]*\
)\.rpm$
/.
${SHORTTAG}.\
1.rpm
/")"