Skip to content

Commit 27842dd

Browse files
committed
fix: custom tag
fix a small bug in how libtorrent tag generation worked with a custom tag and release info generation.
1 parent 486b20a commit 27842dd

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ No breaking changes. Some work towards Libtorrent RC_2_1 support but mostly bugs
7474
| 68 | Medium | Qt tag filtering `sub("(.*)(-a\|-b\|-r)", "")` mangles pre-release tags instead of filtering them | Fixed |
7575
| 69 | Medium | `qbt_dl_folder_path` collapses to install dir on corrupt archive (carried from v1) | Fixed |
7676
| 70 | Medium | fix qt apps multiarch command for qbt_host_deps | Fixed |
77+
| 70 | Medium | fix tag generation with libtorrent when using master branch | Fixed |
7778

7879
### v2.2.2 - 30/08/2025
7980

qbittorrent-nox-static.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ _libtorrent_std_cons() {
522522
return
523523
fi
524524

525-
if [[ ${github_tag[libtorrent]} =~ ^v1\.2\. && "$(_semantic_version "${github_tag[libtorrent]/v/}")" -ge "$(_semantic_version "1.2.19")" ]]; then
525+
if [[ ${github_tag[libtorrent]} =~ ^v1\.2\. && "$(_semantic_version "${app_version[libtorrent]}")" -ge "$(_semantic_version "1.2.19")" ]]; then
526526
printf "yes"
527527
return
528528
fi
529-
if [[ ${github_tag[libtorrent]} =~ ^v2\.0\. && "$(_semantic_version "${github_tag[libtorrent]/v/}")" -ge "$(_semantic_version "2.0.10")" ]]; then
529+
if [[ ${github_tag[libtorrent]} =~ ^v2\.0\. && "$(_semantic_version "${app_version[libtorrent]}")" -ge "$(_semantic_version "2.0.10")" ]]; then
530530
printf "yes"
531531
return
532532
fi
@@ -548,7 +548,7 @@ _qbittorrent_std_cons() {
548548
return
549549
fi
550550

551-
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${github_tag[qbittorrent]/release-/}")" -ge "$(_semantic_version "4.6.0")" ]]; then
551+
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${app_version[qbittorrent]}")" -ge "$(_semantic_version "4.6.0")" ]]; then
552552
printf "yes"
553553
return
554554
fi
@@ -566,7 +566,7 @@ _qbittorrent_build_cons() {
566566
return
567567
fi
568568

569-
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${github_tag[qbittorrent]/release-/}")" -ge "$(_semantic_version "5.0.0")" ]]; then
569+
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${app_version[qbittorrent]}")" -ge "$(_semantic_version "5.0.0")" ]]; then
570570
printf "yes"
571571
return
572572
fi
@@ -1587,7 +1587,7 @@ _set_module_urls() {
15871587
source_archive_url[double_conversion]="https://github.com/google/double-conversion/archive/refs/tags/${github_tag[double_conversion]}.tar.gz"
15881588
source_archive_url[openssl]="https://github.com/openssl/openssl/releases/download/${github_tag[openssl]}/${github_tag[openssl]}.tar.gz"
15891589
_boost_url # function to test and set the boost url and more
1590-
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${github_tag[libtorrent]#v}.tar.gz"
1590+
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${app_version[libtorrent]}.tar.gz"
15911591

15921592
read -ra qt_version_short_array <<< "${app_version[qtbase]//\./ }"
15931593
qt_version_short="${qt_version_short_array[0]}.${qt_version_short_array[1]}"
@@ -1605,7 +1605,7 @@ _set_module_urls() {
16051605
# Configure the qbt_workflow_archive_url associative array for all the applications this script uses and we call them as ${qbt_workflow_archive_url[app_name]}
16061606
##########################################################################################################################################################
16071607
if [[ ${os_id} =~ ^(debian|ubuntu)$ ]]; then
1608-
qbt_workflow_archive_url[glibc]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/glibc.${github_tag[glibc]#glibc-}.tar.xz"
1608+
qbt_workflow_archive_url[glibc]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/glibc.${app_version[glibc]}.tar.xz"
16091609
fi
16101610

16111611
if [[ ${qbt_zlib_type} == "zlib" ]]; then
@@ -1619,7 +1619,7 @@ _set_module_urls() {
16191619
qbt_workflow_archive_url[double_conversion]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/double_conversion.tar.xz"
16201620
qbt_workflow_archive_url[openssl]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/openssl.tar.xz"
16211621
qbt_workflow_archive_url[boost]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/boost.tar.xz"
1622-
qbt_workflow_archive_url[libtorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/libtorrent.${github_tag[libtorrent]/v/}.tar.xz"
1622+
qbt_workflow_archive_url[libtorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/libtorrent.${app_version[libtorrent]}.tar.xz"
16231623
qbt_workflow_archive_url[qtbase]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qt${qbt_qt_version:0:1}base.tar.xz"
16241624
qbt_workflow_archive_url[qttools]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qt${qbt_qt_version:0:1}tools.tar.xz"
16251625
qbt_workflow_archive_url[qbittorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qbittorrent.tar.xz"
@@ -1730,16 +1730,8 @@ _installation_modules() {
17301730
#######################################################################################################################################################
17311731
_apply_patches() {
17321732
[[ -n ${1} ]] && app_name="${1}"
1733-
# Start to define the default master branch we will use by transforming the app_version[libtorrent] variable to underscores. The result is dynamic and can be: RC_1_0, RC_1_1, RC_1_2, RC_2_0, RC_2_1 and so on.
1734-
default_jamfile="${app_version[libtorrent]//./_}"
1735-
1736-
# Remove everything after second underscore. Occasionally the tag will be short, like v2.0 or v2.1 so we need to make sure not remove the underscore if there is only one present.
1737-
local underscores="${default_jamfile//[^_]/}"
1738-
if [[ ${#underscores} -le 1 ]]; then
1739-
default_jamfile="RC_${default_jamfile}"
1740-
else
1741-
default_jamfile="RC_${default_jamfile%_*}"
1742-
fi
1733+
# Start to define the default master branch we will use by transforming the qbt_libtorrent_version variable to underscores. The result is dynamic and can be: RC_1_0, RC_1_1, RC_1_2, RC_2_0, RC_2_1 and so on.
1734+
default_jamfile="RC_${qbt_libtorrent_version//./_}"
17431735

17441736
if [[ ${app_name} == "bootstrap" ]]; then
17451737
_sort_modules
@@ -3182,6 +3174,8 @@ while (("${#}")); do
31823174
app_version[libtorrent]="${app_version[libtorrent]//_/\.}"
31833175
elif [[ ${github_tag[libtorrent]} =~ ^v[0-9] ]]; then
31843176
app_version[libtorrent]="${github_tag[libtorrent]#v}"
3177+
else
3178+
app_version[libtorrent]="${github_tag[libtorrent]}"
31853179
fi
31863180
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${app_version[libtorrent]}.tar.gz"
31873181
if ! _curl "${source_archive_url[libtorrent]}" &> /dev/null; then
@@ -3195,7 +3189,11 @@ while (("${#}")); do
31953189
unset qbt_default_libtorrent_github_tag
31963190

31973191
read -ra lt_version_short_array <<< "${app_version[libtorrent]//\./ }"
3198-
qbt_libtorrent_version="${lt_version_short_array[0]}.${lt_version_short_array[1]}"
3192+
if [[ -n ${lt_version_short_array[1]} ]]; then
3193+
qbt_libtorrent_version="${lt_version_short_array[0]}.${lt_version_short_array[1]}"
3194+
else
3195+
qbt_libtorrent_version="${lt_version_short_array[0]}"
3196+
fi
31993197
[[ ${github_tag[libtorrent]} =~ ^RC_ ]] && app_version[libtorrent]="RC_${app_version[libtorrent]//\./_}" # set back to RC_... so that release info has proper version context
32003198

32013199
_test_git_output "${github_tag[libtorrent]}" "libtorrent" "$2"

qbt-nox-static.bash

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ _libtorrent_std_cons() {
522522
return
523523
fi
524524

525-
if [[ ${github_tag[libtorrent]} =~ ^v1\.2\. && "$(_semantic_version "${github_tag[libtorrent]/v/}")" -ge "$(_semantic_version "1.2.19")" ]]; then
525+
if [[ ${github_tag[libtorrent]} =~ ^v1\.2\. && "$(_semantic_version "${app_version[libtorrent]}")" -ge "$(_semantic_version "1.2.19")" ]]; then
526526
printf "yes"
527527
return
528528
fi
529-
if [[ ${github_tag[libtorrent]} =~ ^v2\.0\. && "$(_semantic_version "${github_tag[libtorrent]/v/}")" -ge "$(_semantic_version "2.0.10")" ]]; then
529+
if [[ ${github_tag[libtorrent]} =~ ^v2\.0\. && "$(_semantic_version "${app_version[libtorrent]}")" -ge "$(_semantic_version "2.0.10")" ]]; then
530530
printf "yes"
531531
return
532532
fi
@@ -548,7 +548,7 @@ _qbittorrent_std_cons() {
548548
return
549549
fi
550550

551-
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${github_tag[qbittorrent]/release-/}")" -ge "$(_semantic_version "4.6.0")" ]]; then
551+
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${app_version[qbittorrent]}")" -ge "$(_semantic_version "4.6.0")" ]]; then
552552
printf "yes"
553553
return
554554
fi
@@ -566,7 +566,7 @@ _qbittorrent_build_cons() {
566566
return
567567
fi
568568

569-
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${github_tag[qbittorrent]/release-/}")" -ge "$(_semantic_version "5.0.0")" ]]; then
569+
if [[ ${github_tag[qbittorrent]} =~ ^release- && "$(_semantic_version "${app_version[qbittorrent]}")" -ge "$(_semantic_version "5.0.0")" ]]; then
570570
printf "yes"
571571
return
572572
fi
@@ -1587,7 +1587,7 @@ _set_module_urls() {
15871587
source_archive_url[double_conversion]="https://github.com/google/double-conversion/archive/refs/tags/${github_tag[double_conversion]}.tar.gz"
15881588
source_archive_url[openssl]="https://github.com/openssl/openssl/releases/download/${github_tag[openssl]}/${github_tag[openssl]}.tar.gz"
15891589
_boost_url # function to test and set the boost url and more
1590-
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${github_tag[libtorrent]#v}.tar.gz"
1590+
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${app_version[libtorrent]}.tar.gz"
15911591

15921592
read -ra qt_version_short_array <<< "${app_version[qtbase]//\./ }"
15931593
qt_version_short="${qt_version_short_array[0]}.${qt_version_short_array[1]}"
@@ -1605,7 +1605,7 @@ _set_module_urls() {
16051605
# Configure the qbt_workflow_archive_url associative array for all the applications this script uses and we call them as ${qbt_workflow_archive_url[app_name]}
16061606
##########################################################################################################################################################
16071607
if [[ ${os_id} =~ ^(debian|ubuntu)$ ]]; then
1608-
qbt_workflow_archive_url[glibc]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/glibc.${github_tag[glibc]#glibc-}.tar.xz"
1608+
qbt_workflow_archive_url[glibc]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/glibc.${app_version[glibc]}.tar.xz"
16091609
fi
16101610

16111611
if [[ ${qbt_zlib_type} == "zlib" ]]; then
@@ -1619,7 +1619,7 @@ _set_module_urls() {
16191619
qbt_workflow_archive_url[double_conversion]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/double_conversion.tar.xz"
16201620
qbt_workflow_archive_url[openssl]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/openssl.tar.xz"
16211621
qbt_workflow_archive_url[boost]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/boost.tar.xz"
1622-
qbt_workflow_archive_url[libtorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/libtorrent.${github_tag[libtorrent]/v/}.tar.xz"
1622+
qbt_workflow_archive_url[libtorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/libtorrent.${app_version[libtorrent]}.tar.xz"
16231623
qbt_workflow_archive_url[qtbase]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qt${qbt_qt_version:0:1}base.tar.xz"
16241624
qbt_workflow_archive_url[qttools]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qt${qbt_qt_version:0:1}tools.tar.xz"
16251625
qbt_workflow_archive_url[qbittorrent]="https://github.com/userdocs/qbt-workflow-files/releases/latest/download/qbittorrent.tar.xz"
@@ -1730,16 +1730,8 @@ _installation_modules() {
17301730
#######################################################################################################################################################
17311731
_apply_patches() {
17321732
[[ -n ${1} ]] && app_name="${1}"
1733-
# Start to define the default master branch we will use by transforming the app_version[libtorrent] variable to underscores. The result is dynamic and can be: RC_1_0, RC_1_1, RC_1_2, RC_2_0, RC_2_1 and so on.
1734-
default_jamfile="${app_version[libtorrent]//./_}"
1735-
1736-
# Remove everything after second underscore. Occasionally the tag will be short, like v2.0 or v2.1 so we need to make sure not remove the underscore if there is only one present.
1737-
local underscores="${default_jamfile//[^_]/}"
1738-
if [[ ${#underscores} -le 1 ]]; then
1739-
default_jamfile="RC_${default_jamfile}"
1740-
else
1741-
default_jamfile="RC_${default_jamfile%_*}"
1742-
fi
1733+
# Start to define the default master branch we will use by transforming the qbt_libtorrent_version variable to underscores. The result is dynamic and can be: RC_1_0, RC_1_1, RC_1_2, RC_2_0, RC_2_1 and so on.
1734+
default_jamfile="RC_${qbt_libtorrent_version//./_}"
17431735

17441736
if [[ ${app_name} == "bootstrap" ]]; then
17451737
_sort_modules
@@ -3182,6 +3174,8 @@ while (("${#}")); do
31823174
app_version[libtorrent]="${app_version[libtorrent]//_/\.}"
31833175
elif [[ ${github_tag[libtorrent]} =~ ^v[0-9] ]]; then
31843176
app_version[libtorrent]="${github_tag[libtorrent]#v}"
3177+
else
3178+
app_version[libtorrent]="${github_tag[libtorrent]}"
31853179
fi
31863180
source_archive_url[libtorrent]="https://github.com/arvidn/libtorrent/releases/download/${github_tag[libtorrent]}/libtorrent-rasterbar-${app_version[libtorrent]}.tar.gz"
31873181
if ! _curl "${source_archive_url[libtorrent]}" &> /dev/null; then
@@ -3195,7 +3189,11 @@ while (("${#}")); do
31953189
unset qbt_default_libtorrent_github_tag
31963190

31973191
read -ra lt_version_short_array <<< "${app_version[libtorrent]//\./ }"
3198-
qbt_libtorrent_version="${lt_version_short_array[0]}.${lt_version_short_array[1]}"
3192+
if [[ -n ${lt_version_short_array[1]} ]]; then
3193+
qbt_libtorrent_version="${lt_version_short_array[0]}.${lt_version_short_array[1]}"
3194+
else
3195+
qbt_libtorrent_version="${lt_version_short_array[0]}"
3196+
fi
31993197
[[ ${github_tag[libtorrent]} =~ ^RC_ ]] && app_version[libtorrent]="RC_${app_version[libtorrent]//\./_}" # set back to RC_... so that release info has proper version context
32003198

32013199
_test_git_output "${github_tag[libtorrent]}" "libtorrent" "$2"

0 commit comments

Comments
 (0)