Browse Source

s3.TUP Better library detection part 2 (v0.22.6)

- update library preselection when more than one library is configured with the same version major and minor
- remove LIB_USBB_version quotes from config template
pull/61/head
WXbet 4 years ago
parent
commit
51eac50463
  1. 4
      support/configs/plugin_update_toolchain.config.template
  2. 8
      support/functions/_plugin_update_toolchain

4
support/configs/plugin_update_toolchain.config.template

@ -1,6 +1,6 @@
# List of setup, build and config commands below. All commands are executed in the context of the current user.
# Pay attention to the SEMICOLON at the end of EACH command and the correct quoting (' or ") for or to avoid expansion of variables.
S3TUP_CONFIG_VERSION="30";
S3TUP_CONFIG_VERSION="31";
# Tokens that are replaced automatically:
# @CTNGSOURCE@ crosstool-NG source folder; support/crosstool/crosstool-ng
@ -231,7 +231,7 @@ LIB_USB_tasks+=('[ "@TYPE@" == "android-ndk" ] && find "@PREFIX@/lib/" -maxdepth
LIB_USBB="1";
LIB_USBB_beta="0";
LIB_USBB_name="libusb";
LIB_USBB_version="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases" | jq '[.[] | select(.tag_name|test("v1.0.23"))][0] | .tag_name' | sed -e 's#v##g')";
LIB_USBB_version="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases" | jq '[.[] | select(.tag_name|test("v1.0.23"))][0] | .tag_name' | sed -e 's#v##g; s#\"##g')";
LIB_USBB_desc="$LIB_USBB_name $LIB_USBB_version (no C11)";
LIB_USBB_check="libusb-1.0.pc $(printf "$LIB_USBB_version")";
LIB_USBB_url="$(curl --silent "https://api.github.com/repos/libusb/libusb/releases" | jq '[.[] | select(.tag_name|test("v1.0.23"))][0] | .assets[1].browser_download_url' | sed -e 's#\"##g')";

8
support/functions/_plugin_update_toolchain

@ -3,7 +3,7 @@
#simplebuild_plugin tcupdate
tcupdate(){
pversion="0.22.5";
pversion="0.22.6";
pname="s3.TUP";
pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config";
@ -218,6 +218,7 @@ _integrate_libs(){
do
key=$(echo "$l" | awk -F'|' '{print $3}' | xargs);
if [ "$key" == "$libkey" ];then
libcheckfile=$(echo "$l" | awk -F'|' '{print $1}' | xargs);
libversioncurrent=$(echo "$l" | awk -F'|' '{print $2}' | xargs);
libversioncompare=$(echo "$l" | awk -F'|' '{print $5}' | xargs);
break;
@ -231,6 +232,8 @@ _integrate_libs(){
[ "$libversioncompare" == "=" ] && libtxtfmt="\Z2" || libtxtfmt="";
[ "$libversioncompare" == "<" ] && libtxtfmt="\Z1";
[ "$libversioncompare" == ">" ] && [ "${#libversioncurrent}" -gt 0 ] && libselected="on" && libtxtfmt="\Z5" || libselected="off";
[ "$libcheckfile" == "$libselectedflag" ] && libselected="off";
libselectedflag="$libcheckfile";
MENU_OPTIONS+=("$libkey" "${libdesc}$(printf '%*s' $((24-${#libdesc})))${libtxtfmt}$([ $libversioncurrent ] && echo $libversioncompare) $(echo $libversioncurrent | sed -e 's/^$/ ---/g')\Zn" "$(echo $libselected)" "$([ $libname ] && echo "${libdesc}: ${liburl}")");counter;
@ -971,10 +974,9 @@ _get_toolchain_libs(){
libchecklib="$key"_checklib;libchecklib="${!libchecklib}";
libversion="$key"_version;libversion="${!libversion}";
libversioncompare=$(_compare_version $libversion $version);
if [[ "$pkg $version" =~ ^${libcheck}.* ]] || [[ "$pkg $version" =~ ^${libcheck::-2}.* ]];then #regex match, don't quote the right side
if [[ "$pkg $version" =~ ^${libcheck}.* ]];then #regex match, don't quote the right side
if [ -n "$libchecklib" -a -f "$pkgconfigdir/../$libchecklib" -o -z "$libchecklib" ];then
libs+="$pkg\|$version\|$key\|$libversion\|$libversioncompare\|$name;";
break;
fi;
fi;
done;

Loading…
Cancel
Save