Bug fixes on OS X, add GNU readlink as deps #20

Makefile:
- short help was not properly created

love-release.sh:
- script aborts if GNU getopt is not found
- add GNU readlink as dependency, will check for greadlink too

README.md:
- add GNU readlink as dependency
This commit is contained in:
Antonin Décimo
2015-07-12 15:26:15 +02:00
parent ae3b742c45
commit e20238a6ac
3 changed files with 20 additions and 9 deletions

View File

@@ -19,13 +19,13 @@ love-release: clean
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -Ee "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \ ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -Ee "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \ if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
long="$${l},$${long}"; \ long="$${l},$${long}"; \
if [[ -n $$shelp ]]; then shelp="$$shelp\n"; fi; \ shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\\\"; \
shelp="$$shelp -$$(grep "init_module" $$file | sed -e 's/init_module //' -e 's/" "/\t/g' -e 's/"//g' | awk -F "\t" '{print($$3," ",$$1)}')"; \
done; \ done; \
shelp="$$shelp\\n"; \
sed -Ee "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \ sed -Ee "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
-e 's/INSTALLED=false/INSTALLED=true/' \ -e 's/INSTALLED=false/INSTALLED=true/' \
-e "/^EndOfSHelp/ i\\$$shelp" \ -e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' \
-e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' love-release.sh > '$(BUILD_DIR)/love-release'; \ -e "$$(echo "$$(sed -n '/^EndOfSHelp/=' love-release.sh) i \\$$(printf "$$shelp")")" love-release.sh > '$(BUILD_DIR)/love-release'; \
comp="$$(if [[ -n $$long ]]; then echo --$$long | tr -d ':' | sed -e 's/,$$//' -e 's/,/ --/g'; fi)$$(if [[ -n $$short ]]; then echo $$short | sed -E 's/(.)/ -\1/g'; fi) "; \ comp="$$(if [[ -n $$long ]]; then echo --$$long | tr -d ':' | sed -e 's/,$$//' -e 's/,/ --/g'; fi)$$(if [[ -n $$short ]]; then echo $$short | sed -E 's/(.)/ -\1/g'; fi) "; \
sed -Ee "s/opts=\"(.*)/opts=\"$$comp\1/" completion.sh > '$(BUILD_DIR)/completion.sh' sed -Ee "s/opts=\"(.*)/opts=\"$$comp\1/" completion.sh > '$(BUILD_DIR)/completion.sh'
cp love-release.1 '$(BUILD_DIR)/love-release.1' cp love-release.1 '$(BUILD_DIR)/love-release.1'
@@ -52,12 +52,13 @@ embedded: clean
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -Ee "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \ ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -Ee "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \ if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
long="$${l},$${long}"; \ long="$${l},$${long}"; \
shelp="$$shelp -$$(grep "init_module" $$file | sed -e 's/init_module //' -e 's/" "/\t/g' -e 's/"//g' | awk -F "\t" '{print($$3," ",$$1)}')"; \ shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\\\"; \
done; \ done; \
shelp="$$shelp\\n"; \
sed -Ee "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \ sed -Ee "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
-e 's/EMBEDDED=false/EMBEDDED=true/' \ -e 's/EMBEDDED=false/EMBEDDED=true/' \
-e "/^EndOfSHelp/ i\\$$shelp" \ -e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' \
-e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh' -e "$$(echo "$$(sed -n '/^EndOfSHelp/=' love-release.sh) i \\$$(printf "$$shelp")")" love-release.sh > '$(BUILD_DIR)/love-release.sh';
chmod 0775 '$(BUILD_DIR)/love-release.sh' chmod 0775 '$(BUILD_DIR)/love-release.sh'
rm -rf '$(BUILD_DIR)/tmp' rm -rf '$(BUILD_DIR)/tmp'

View File

@@ -2,7 +2,7 @@
`love-release.sh` -- Bash script to generate [LÖVE](https://love2d.org/) game releases `love-release.sh` -- Bash script to generate [LÖVE](https://love2d.org/) game releases
### INSTALLATION ### INSTALLATION
`love-release` relies on `GNU getopt` (OSX and BSD user needs to install it), `curl`, `zip` and `unzip`. `love-release` relies on `GNU getopt` and `GNU readlink` (OSX and BSD users need to install them), `curl`, `zip` and `unzip`.
You need to have `lua` installed to be able to read the configuration. You need to have `lua` installed to be able to read the configuration.
You also need Wine to get icons and installer for Windows, the Debian pakaging utilities for Debian and the Android SDK to build a package for Android. You also need Wine to get icons and installer for Windows, the Debian pakaging utilities for Debian and the Android SDK to build a package for Android.

View File

@@ -26,7 +26,7 @@ check_deps () {
} && { } && {
unset GETOPT_COMPATIBLE unset GETOPT_COMPATIBLE
local out=$(getopt -T) local out=$(getopt -T)
if [[ $? -eq 4 && -z $out ]]; then if (( $? != 4 )) && [[ -n $out ]]; then
local opt=false local opt=false
fi fi
} }
@@ -34,6 +34,16 @@ check_deps () {
>&2 echo "GNU getopt is not installed. Aborting." >&2 echo "GNU getopt is not installed. Aborting."
local EXIT=true local EXIT=true
fi fi
if ! command -v readlink > /dev/null 2>&1 || ! readlink -m / > /dev/null 2>&1; then
command -v greadlink > /dev/null 2>&1 || {
>&2 echo "GNU readlink is not installed. Aborting."
local EXIT=true
} && {
readlink () {
greadlink "$@"
}
}
fi
command -v lua > /dev/null 2>&1 || { command -v lua > /dev/null 2>&1 || {
echo "lua is not installed. Install it to ease your releases." echo "lua is not installed. Install it to ease your releases."