Skip to content

Commit

Permalink
check_codebase.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
adastreamer committed Jun 13, 2019
1 parent 3502ce1 commit 43afdc0
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ton-test-liteclient-full/lite-client-build
ton-test-liteclient-full/lite-client/tl/generate
ton-test-liteclient-full/lite-client/tdutils/generate
ton-test-liteclient-full/lite-client/crypto/block/*auto*
ton-test-liteclient-full/lite-client-check
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Code was downloaded from https://test.ton.org/download.html

Last codebase update was performed on June 5, 2019.`sha256sum('ton-test-liteclient-full.tar.xz')`=`edd57971cba5cff9b219a1c99401a7315176ac9ab30afc9df0b1ed39e1dbc009`.

### Source code check

Run a command `./ton-test-liteclient-full/check_codebase.sh` while updating a codebase to be sure it's up-to-date

---
## Table of contents:

Expand Down
36 changes: 36 additions & 0 deletions ton-test-liteclient-full/check_codebase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

ARCHIVE_NAME=ton-test-liteclient-full.tar.xz
SOURCES=https://test.ton.org/$ARCHIVE_NAME
SOURCE_IN_ARCHIVE=lite-client
SOURCE_DIR=lite-client
CHECK_DIR=lite-client-check

DIFF_CONFIG=lite-client-check-exclude.pats

cd "$( dirname "${BASH_SOURCE[0]}")"

# CLEAN UP
echo ">>> cleaning up"
rm -f $ARCHIVE_NAME
rm -rf $CHECK_DIR
mkdir $CHECK_DIR

# DOWNLOAD
echo ">>> downloading latest sources from $"
wget -q $SOURCES
tar -C $CHECK_DIR -xf $ARCHIVE_NAME
rm -f $ARCHIVE_NAME

echo ">>> checking sources"

# COMPARE
RES=$(diff -r $SOURCE_DIR $CHECK_DIR/$SOURCE_IN_ARCHIVE -X $DIFF_CONFIG)

if [ -z "$RES" ]
then
echo ">>> sources are up-to-date"
else
echo ">>> sources are changed, double check the diff:"
echo -e "$RES"
fi
3 changes: 3 additions & 0 deletions ton-test-liteclient-full/lite-client-check-exclude.pats
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
generate
.DS_Store
*-auto.*

0 comments on commit 43afdc0

Please sign in to comment.