summaryrefslogtreecommitdiff
path: root/notepadpp/build-orig-tarball.sh
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-10-05 10:44:44 -0400
committerB Stack <bgstack15@gmail.com>2020-10-05 10:44:55 -0400
commitd066af3b0e92c03a27875eb8a23dea6546d5819c (patch)
treeff299505ae29e3dc098cce08c595e1ad3ea484f0 /notepadpp/build-orig-tarball.sh
parentMerge branch 'palemoon-bump' into master (diff)
downloadstackrpms-d066af3b0e92c03a27875eb8a23dea6546d5819c.tar.gz
stackrpms-d066af3b0e92c03a27875eb8a23dea6546d5819c.tar.bz2
stackrpms-d066af3b0e92c03a27875eb8a23dea6546d5819c.zip
notepadpp 7.9
Diffstat (limited to 'notepadpp/build-orig-tarball.sh')
-rwxr-xr-xnotepadpp/build-orig-tarball.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/notepadpp/build-orig-tarball.sh b/notepadpp/build-orig-tarball.sh
index 80b2260..275a1aa 100755
--- a/notepadpp/build-orig-tarball.sh
+++ b/notepadpp/build-orig-tarball.sh
@@ -40,8 +40,12 @@ latest_version="$( curl -s "https://notepad-plus-plus.org/downloads/" | grep -oi
ferror "USING VERSION ${latest_version}"
## 2. dl npp main version, 32 and 64
-get "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v${latest_version}/npp.${latest_version}.bin.7z"
-get "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v${latest_version}/npp.${latest_version}.bin.x64.7z"
+# magic awk written 2020-10-05 to handle naming convention change from 7.8.9.bin to 7.9.portable.
+lv_compare="$( echo "${latest_version}" | awk -v 'maxsections=3' -F'.' 'NF < maxsections {printf("%s",$0);for(i=NF;i<maxsections;i++)printf("%s",".0");printf("\n")} NF >= maxsections {print}' | awk -v 'maxdigits=2' -F'.' '{print $1*10^(maxdigits*2)+$2*10^(maxdigits)+$3}' )"
+export fn_section=".portable"
+test ${lv_compare} -lt 70900 && export fn_section=".bin"
+get "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v${latest_version}/npp.${latest_version}${fn_section}.7z"
+get "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v${latest_version}/npp.${latest_version}${fn_section}.x64.7z"
## 3. dl 32 plugins
# fetch master list of plugins
@@ -71,14 +75,14 @@ test -z "${DRYRUN}" && { mkdir -p "notepadpp-${latest_version}" ; cd "notepadpp-
test -n "${DEBUG}" && ferror "mkdir -p notepadpp-bin32 notepadpp-bin64"
test -z "${DRYRUN}" && { mkdir -p notepadpp-bin32 notepadpp-bin64 ; }
-test -n "${DEBUG}" && ferror "cd notepadpp-bin32 ; 7za -bd -aoa x ../../\"npp.${latest_version}.bin.7z\" ; cd plugins ; 7za -bd -aoa x ../../../\"${file_current_plugin_32_Compare}\" ; 7za -bd -aoa x ../../../\"${file_current_plugin_32_TextFX}\" ; cd ../.. "
-test -z "${DRYRUN}" && { cd notepadpp-bin32 ; 7za -bd -aoa x ../../"npp.${latest_version}.bin.7z" ; cd plugins ; 7za -bd -aoa x ../../../"${file_current_plugin_32_Compare}" ; 7za -bd -aoa x ../../../"${file_current_plugin_32_TextFX}" ; cd ../..; }
-test -n "${DEBUG}" && ferror "cd notepadpp-bin64 ; 7za -bd -aoa x ../../\"npp.${latest_version}.bin.x64.7z\" ; cd plugins ; 7za -bd -aoa x ../../../\"${file_current_plugin_64_Compare}\" ; cd ../.. "
-test -z "${DRYRUN}" && { cd notepadpp-bin64 ; 7za -bd -aoa x ../../"npp.${latest_version}.bin.x64.7z" ; cd plugins ; 7za -bd -aoa x ../../../"${file_current_plugin_64_Compare}" ; cd ../.. ; }
+test -n "${DEBUG}" && ferror "cd notepadpp-bin32 ; 7za -bd -aoa x ../../\"npp.${latest_version}${fn_section}.7z\" ; cd plugins ; 7za -bd -aoa x ../../../\"${file_current_plugin_32_Compare}\" ; 7za -bd -aoa x ../../../\"${file_current_plugin_32_TextFX}\" ; cd ../.. "
+test -z "${DRYRUN}" && { cd notepadpp-bin32 ; 7za -bd -aoa x ../../"npp.${latest_version}${fn_section}.7z" ; cd plugins ; 7za -bd -aoa x ../../../"${file_current_plugin_32_Compare}" ; 7za -bd -aoa x ../../../"${file_current_plugin_32_TextFX}" ; cd ../..; }
+test -n "${DEBUG}" && ferror "cd notepadpp-bin64 ; 7za -bd -aoa x ../../\"npp.${latest_version}${fn_section}.x64.7z\" ; cd plugins ; 7za -bd -aoa x ../../../\"${file_current_plugin_64_Compare}\" ; cd ../.. "
+test -z "${DRYRUN}" && { cd notepadpp-bin64 ; 7za -bd -aoa x ../../"npp.${latest_version}${fn_section}.x64.7z" ; cd plugins ; 7za -bd -aoa x ../../../"${file_current_plugin_64_Compare}" ; cd ../.. ; }
test -n "${DEBUG}" && ferror "cd .."
test -z "${DRYRUN}" && cd ..
test -n "${DEBUG}" && ferror "tar -zcf \"notepadpp_${latest_version}.orig.tar.gz\" \"notepadpp-${latest_version}\""
test -z "${DRYRUN}" && tar -zcf "notepadpp_${latest_version}.orig.tar.gz" "notepadpp-${latest_version}"
# CLEAN UP
-rm -rf "${tmpfile1}" "notepadpp-${latest_version}/" "${file_current_plugin_32_Compare}" "${file_current_plugin_32_TextFX}" "${file_current_plugin_64_Compare}" "npp.${latest_version}.bin.7z" "npp.${latest_version}.bin.x64.7z"
+rm -rf "${tmpfile1}" "notepadpp-${latest_version}/" "${file_current_plugin_32_Compare}" "${file_current_plugin_32_TextFX}" "${file_current_plugin_64_Compare}" "npp.${latest_version}${fn_section}.7z" "npp.${latest_version}${fn_section}.x64.7z"
bgstack15