aboutsummaryrefslogtreecommitdiff
path: root/tools/cpm-fetch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cpm-fetch.sh')
-rwxr-xr-xtools/cpm-fetch.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/cpm-fetch.sh b/tools/cpm-fetch.sh
index 648bbae1c8..5620996433 100755
--- a/tools/cpm-fetch.sh
+++ b/tools/cpm-fetch.sh
@@ -59,7 +59,7 @@ download_package() {
if grep -e "patches" <<< "$JSON" > /dev/null; then
PATCHES=$(jq -r '.patches | join(" ")' <<< "$JSON")
for patch in $PATCHES; do
- patch -p1 < "$ROOTDIR"/.patch/$package/$patch
+ patch --binary -p1 < "$ROOTDIR"/.patch/$package/$patch
done
fi
@@ -118,6 +118,14 @@ do
continue
fi
+ VERSION=$(jq -r ".version" <<< "$JSON")
+ GIT_VERSION=$(jq -r ".git_version" <<< "$JSON")
+ TAG=$(jq -r ".tag" <<< "$JSON")
+ SHA=$(jq -r ".sha" <<< "$JSON")
+
+ [ "$GIT_VERSION" == null ] && GIT_VERSION="$VERSION"
+ [ "$GIT_VERSION" == null ] && GIT_VERSION="$TAG"
+
# url parsing WOOOHOOHOHOOHOHOH
URL=$(jq -r ".url" <<< "$JSON")
REPO=$(jq -r ".repo" <<< "$JSON")
@@ -173,7 +181,7 @@ do
# key parsing
KEY=$(jq -r ".key" <<< "$JSON")
- if [ "$KEY" == null ]; then
+ if [ "$KEY" == null ]; then
if [ "$SHA" != null ]; then
KEY=$(cut -c1-4 - <<< "$SHA")
elif [ "$GIT_VERSION" != null ]; then