Skip to content

Commit

Permalink
lastools-el7: Instead of hard-coding the LASTools version in the fpm.sh,
Browse files Browse the repository at this point in the history
we now capture the version by running "laszip -version".
  • Loading branch information
johnpinto1 committed Apr 18, 2017
1 parent 5bb832c commit 26378c6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lastools-el7/fpm.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/bash

version=20170414
# The version can be captured by running a LAStools binary, e.g.,
# > laszip -version
# The output we get is of the form:
# "LAStools (by martin@rapidlasso.com) version 170414"
# For some unknown reason, the output is redirected to the stderr (file descriptor 2).
# So we capture it as follows.s
version_output=$(/root/LAStools/bin/laszip -version 2>&1)
# The version is last in the text, so we reverse the text, get the reversed version substring,
# and then reverse this again.
version=$(echo $version_output | rev | cut -d' ' -f1 | rev)
echo "LasTools version: $version"

fpm -v ${version} \
--iteration 1.el7 \
Expand Down

0 comments on commit 26378c6

Please sign in to comment.