This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 44259ab Fix dev/check-binary-license on macOS
44259ab is described below
commit 44259ab273589c1ec5d04c7e8653d21d443da34e
Author: Sijie Guo <[email protected]>
AuthorDate: Mon May 21 22:38:52 2018 -0700
Fix dev/check-binary-license on macOS
Descriptions of the changes in this PR:
*Motivation*
`dev/check-binary-license` is used for checking whether LICENSE files are
updated to reflect the dependencies included in the distribution packages.
However this script doesn't work on macOS, which makes the development on
macOS inconvinient.
*Solution*
The change removes `--wildcards` from tar command. The option only works on
linux machines.
Author: Sijie Guo <[email protected]>
Reviewers: Jia Zhai <None>
This closes #1418 from sijie/fix_check_license_script_master
---
.travis_scripts/build.sh | 6 ++----
dev/check-binary-license | 18 ++++++++++++------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/.travis_scripts/build.sh b/.travis_scripts/build.sh
index 85e0847..f751bd8 100755
--- a/.travis_scripts/build.sh
+++ b/.travis_scripts/build.sh
@@ -23,10 +23,8 @@ BINDIR=`dirname "$0"`
BK_HOME=`cd $BINDIR/..;pwd`
mvn --batch-mode clean apache-rat:check compile spotbugs:check install
-DskipTests -Dstream
-if [ "$TRAVIS_OS_NAME" == "linux" ]; then
- $BK_HOME/dev/check-binary-license
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz;
- $BK_HOME/dev/check-binary-license
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz;
-fi
+$BK_HOME/dev/check-binary-license
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz;
+$BK_HOME/dev/check-binary-license
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz;
if [ "$DLOG_MODIFIED" == "true" ]; then
cd $BK_HOME/stream/distributedlog
mvn --batch-mode clean package -Ddistributedlog
diff --git a/dev/check-binary-license b/dev/check-binary-license
index b56cbbf..04f8e7f 100755
--- a/dev/check-binary-license
+++ b/dev/check-binary-license
@@ -31,12 +31,18 @@ if [ -z $TARBALL ]; then
exit -1
fi
-JARS=$(tar --wildcards -tf $TARBALL '*.jar' | sed 's!.*/!!' | sort)
+TAR='tar'
+unamestr=`uname`
+if [[ "$unamestr" == 'Linux' ]]; then
+ TAR='tar --wildcards'
+fi
+
+JARS=$(${TAR} -tf $TARBALL '*.jar' | sed 's!.*/!!' | sort)
-LICENSEPATH=$(tar -tf $TARBALL | awk '/^[^\/]*\/LICENSE/')
-LICENSE=$(tar --wildcards -O -xf $TARBALL "$LICENSEPATH")
-NOTICEPATH=$(tar -tf $TARBALL | awk '/^[^\/]*\/NOTICE/')
-NOTICE=$(tar --wildcards -O -xf $TARBALL $NOTICEPATH)
+LICENSEPATH=$(${TAR} -tf $TARBALL | awk '/^[^\/]*\/LICENSE/')
+LICENSE=$(${TAR} -O -xf $TARBALL "$LICENSEPATH")
+NOTICEPATH=$(${TAR} -tf $TARBALL | awk '/^[^\/]*\/NOTICE/')
+NOTICE=$(${TAR} -O -xf $TARBALL $NOTICEPATH)
LICENSEJARS=$(echo "$LICENSE" | sed -nE 's!.*lib/(.*\.jar).*!\1!gp')
NOTICEJARS=$(echo "$NOTICE" | sed -nE 's!.*lib/(.*\.jar).*!\1!gp')
@@ -47,7 +53,7 @@ LINKEDINLICENSE=$(echo "$LICENSE" | sed -nE
's!.*(deps/[[:graph:]]*).*!\1!gp' |
set +e
# this can error if there's no deps directory in tarball, we still want to
continue with checks
-BUNDLEDLICENSES=$(tar --wildcards -tf $TARBALL '*/deps/*' | sed 's!^[^/]*/!!'
| grep -v /$)
+BUNDLEDLICENSES=$(${TAR} -tf $TARBALL '*/deps/*' | sed 's!^[^/]*/!!' | grep -v
/$)
EXIT=0
--
To stop receiving notification emails like this one, please contact
[email protected].