Commit ffa02b11 authored by Benoit Rat's avatar Benoit Rat Committed by Alessandro Rubini

build: all: improve --clean option and the package name

parent 85be0fff
......@@ -58,15 +58,29 @@ showhelp() {
pack()
{
name=$(git describe --exact-match --tags HEAD &> /dev/null)
#Check if the current git repo correspond to a tag
name=$(git describe --exact-match --tags HEAD &> /dev/null)
if [ $? -ne "0" ]; then
# Otherwise obtain the date and git revision
name=$(date +%y%m%d)"-"$(git log --abbrev-commit --pretty=oneline -1 | cut -d" " -f1)
# Append '+' symbol if some files need to be commited to git
if [ "x$(git status -s .)" != "x" ]; then
name="$name+";
fi;
fi
echo "Packing into wrs-firmware-$name.tar.gz";
tar -czvf "wrs-firmware-$name.tar.gz" -C ${WRS_OUTPUT_DIR}/images/ at91bootstrap.bin barebox.bin zImage wrs-image.jffs2.img
exit 0
}
clean()
{
echo "Cleaning all outputs except downloads"
rm -Rf ${WRS_OUTPUT_DIR}/build/
rm -Rf ${WRS_OUTPUT_DIR}/images/
rm -Rf ${WRS_OUTPUT_DIR}/doc/
}
......@@ -74,7 +88,7 @@ pack()
if [ -n "$1" ]; then
case "$1" in
--help) showhelp;;
--clean) rm -f $WRS_DONE_DIR/0*;;
--clean) clean;;
--fetch) echo "To be done";;
--list) cd $WRS_DONE_DIR; ls 0*; exit 0;;
--pack) pack; exit 0;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment