tidy-html5/build/cmake/pub-bins.sh

100 lines
1.9 KiB
Bash
Raw Normal View History

2015-06-04 17:12:25 +00:00
#!/bin/sh
#< pub-bins.sh - copy binaries to repo for update
BN=`basename $0`
TMPWV="64bit"
TMPSRC="../.."
TMPFIL="$TMPSRC/version.txt"
if [ ! -f "$TMPFIL" ]; then
echo "Can NOT locate $TMPFIL! *** FIX ME ***"
exit 1
fi
echo "$BN: Read file $TMPFIL"
ls -l $TMPFIL
2015-09-07 17:28:29 +00:00
TMPCNT=0
while read LINE; do
if [ "$TMPCNT" = "0" ]; then
TMPVER="$LINE"
fi
TMPCNT=`expr $TMPCNT + 1`
done <$TMPFIL
2015-06-04 17:12:25 +00:00
#TMPVER=$(<$TMPFIL)
2015-09-07 17:28:29 +00:00
#TMPVER=$(cat $TMPFIL)
2015-06-04 17:12:25 +00:00
echo "$BN: Version $TMPVER"
ask()
{
pause
if [ ! "$?" = "0" ]; then
exit 1
fi
}
2015-09-07 17:28:29 +00:00
TMPBIN="$HOME/projects/html_tidy/binaries"
2015-06-04 17:12:25 +00:00
TMPBINS="$TMPBIN/binaries"
if [ ! -d "$TMPBINS" ]; then
echo "$BN: Can NOT location '$TMPBINS'! *** FIX ME ***"
exit 1
fi
TMPDD="$TMPBINS/tidy-$TMPVER"
echo ""
2015-09-07 17:28:29 +00:00
if [ -d "$TMPDD" ]; then
echo "$BN: Destination is $TMPDD"
else
2015-06-04 17:12:25 +00:00
echo "$BN: This is a NEW installation in $TMPDD"
fi
2015-09-07 17:28:29 +00:00
TMPFIL1="tidy-$TMPVER-$TMPWV.deb"
TMPFIL2="tidy-$TMPVER-$TMPWV.rpm"
2015-06-04 17:12:25 +00:00
if [ ! -f "$TMPFIL1" ]; then
echo "$BN: $TMPFIL1 does not exits"
echo "$BN: Have you run '[sudo] make package'?"
exit 1
fi
if [ ! -f "$TMPFIL2" ]; then
echo "$BN: $TMPFIL2 does not exits"
echo "$BN: Have you run '[sudo] make package'?"
exit 1
fi
echo ""
echo "$BN: Will publish..."
echo "$TMPFIL1"
echo "$TMPFIL2"
2015-09-07 17:28:29 +00:00
if [ ! -d "$TMPDD" ]; then
echo "$BN: Will create dir $TMPDD"
else
echo "$BN: Destination $TMPDD"
fi
2015-06-04 17:12:25 +00:00
echo ""
echo "$BN: *** CONTINUE? ***"
ask
if [ ! -d "$TMPDD" ]; then
mkdir $TMPDD
if [ ! -d "$TMPDD" ]; then
echo "$BN: Failed to create folder $TMPDD"
exit 1
fi
fi
TMPSRC="$TMPFIL1"
TMPDST="$TMPDD/$TMPFIL1"
echo "$BN: Copying $TMPSRC to $TMPDST"
cp -u -v $TMPSRC $TMPDST
if [ ! -f "$TMPDST" ]; then
echo "$BN: Copy $TMPSRC FAILED!"
exit 1
fi
TMPSRC="$TMPFIL2"
TMPDST="$TMPDD/$TMPFIL2"
echo "$BN: Copying $TMPSRC to $TMPDST"
cp -u -v $TMPSRC $TMPDST
if [ ! -f "$TMPDST" ]; then
echo "$BN: Copy $TMPSRC FAILED!"
exit 1
fi
# @REM eof