You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/01/06 12:09:53 UTC
[whimsy] branch master updated: Automate creation of new file if
possible
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new abc45cf Automate creation of new file if possible
abc45cf is described below
commit abc45cf98f2ce173b5ceada970568f650dfc2532
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jan 6 12:09:52 2019 +0000
Automate creation of new file if possible
---
tools/tocsplit.sh | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/tocsplit.sh b/tools/tocsplit.sh
index 8dd766a..4e5259f 100755
--- a/tools/tocsplit.sh
+++ b/tools/tocsplit.sh
@@ -13,18 +13,26 @@ DIRNAME=$(dirname $(readlink "$BASH_SOURCE" || echo "$BASH_SOURCE"))
rm -f ${TMPF}*.tmp
-$DIRNAME/tocsplit.rb $1 || exit
+$DIRNAME/tocsplit.rb $FILE || exit
# How many files were created?
PARTS=$(ls ${TMPF}*.tmp | wc -l)
ls -l ${TMPF}*.tmp
# Check that the split worked OK (needs bash, not sh)
-diff <(cat ${TMPF}*.tmp) $1 && echo Split worked
+diff <(cat ${TMPF}*.tmp) $FILE && echo Split worked
if [ $PARTS -eq 5 ] # file start, start of Incubator, ToC*2, rest of file
then
- diff ${TMPF}10[34].tmp && echo "Files 103/104 are the same - can drop one of them"
+ if diff ${TMPF}10[34].tmp
+ then
+ echo "Files 103/104 are the same - can drop one of them"
+ rm ${TMPF}104.tmp # remove second
+ cat ${TMPF}*.tmp > ${FILE}.tmp
+ echo Created ${FILE}.tmp with duplicate removed
+ else
+ echo "ToC sections have differences; cannot decide which to drop"
+ fi
elif [ $PARTS -eq 4 ]
then
echo "File appears to have the correct number of ToC sections"