Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Warn when building on non-gnu systems

  • Loading branch information...
commit 9e89b0e144b3bde70f800af27ea519243173ea79 1 parent 39cf368
Steven Willis authored
Showing with 18 additions and 2 deletions.
  1. +18 −2 build.sh
View
20 build.sh
@@ -1,8 +1,24 @@
#!/bin/bash
+for rl in readlink greadlink ; do
+ ${rl} --version 2> /dev/null | fgrep -q coreutils && readlink=$rl
+done
+if [ -z "${readlink}" ] ; then
+ echo "This build requires GNU readlink from coreutils" >> /dev/stderr
+ exit 1
+fi
+
+for tr in tar gtar ; do
+ ${tr} --version 2> /dev/null | fgrep -q -i 'gnu tar' && tar=$tr
+done
+if [ -z "${tar}" ] ; then
+ echo "This build requires GNU tar" >> /dev/stderr
+ exit 1
+fi
+
# Set up build setting
project_name=compete-hiera_yamlgpg
-project_base_dir="$(readlink -f "$(dirname "${BASH_SOURCE}")")"
+project_base_dir="$(dirname "$(${readlink} -f "${BASH_SOURCE}")")"
version=$(cat "${project_base_dir}/Modulefile" \
| awk '$1=="version" {print $2}' \
@@ -35,7 +51,7 @@ chmod -R go-w ${project_name}-${version}
chmod -R a+rX ${project_name}-${version}
# Create the new tar with root as owner and group
-tar --owner 0 --group 0 -czf ${project_name}-${version}.tar.gz ${project_name}-${version}
+${tar} --owner 0 --group 0 -czf ${project_name}-${version}.tar.gz ${project_name}-${version}
# Exit the package directory
popd > /dev/null
Please sign in to comment.
Something went wrong with that request. Please try again.