From 12f39ce8e57d569666b2a57b387261ecaf1b7eca Mon Sep 17 00:00:00 2001 From: Giuliano Belinassi Date: Tue, 27 Jan 2026 11:02:35 -0300 Subject: [PATCH] Fix minor problems in the setup_package.sh Previously the setup_package.sh script had some problems like aborting when debuginfo for a package is not found, problems when comparing timestamps and warning out in functions that is not used. This commit fixes those problems. Signed-off-by: Giuliano Belinassi --- scripts/setup_package.sh | 45 ++++++++-------------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/scripts/setup_package.sh b/scripts/setup_package.sh index 40b97b5f..c9435e4b 100755 --- a/scripts/setup_package.sh +++ b/scripts/setup_package.sh @@ -142,35 +142,6 @@ get_name_from_package_name() echo ${tokens[0]} } -get_sle_version_from_package_name() -{ - local package=$1 - # Declare a hash table mapping version number to a label used in - # download.suse.de - - declare -A sle_hash=( ["150000"]="SLE-15" - ["150100"]="SLE-15-SP1" - ["150200"]="SLE-15-SP2" - ["150300"]="SLE-15-SP3" - ["150400"]="SLE-15-SP4" - ["150500"]="SLE-15-SP5" - ["150600"]="SLE-15-SP6" - ["150700"]="SLE-15-SP7" - ["slfo.1.1"]="SLFO:1.1" - ["slfo.1.2"]="SLFO:1.2" - ) - - local version=$(echo "$1" | grep -Eo "($SLE_VERSION_REGEX)") - local sle_version=${sle_hash[$version]} - - if [ "x$sle_version" = "x" ]; then - echo "Unsupported SLE package version $version" >> /dev/stderr - exit 1 - fi - - echo $sle_version -} - extract_lib_package_names() { local file=$1 @@ -181,7 +152,11 @@ extract_lib_package_names() for lib in ${interesting_lines}; do lib=${lib%?} # Remove last " from string. - final="$final $lib" + + # Do not add livepatch packages to the list. + if [[ "$lib" != *"livepatch"* ]]; then + final="$final $lib" + fi done echo $final @@ -326,8 +301,6 @@ download_ipa_clones() local ipa_clones_list=$(get_list_of_ipa_clones "$*") local old_url=$URL - local sle_ver=$(get_sle_version_from_package_name $1) - set_url_platform $PLATFORM $PRODUCT $ARCH "ipa-clones" parallel_download_packages "$ipa_clones_list" } @@ -463,7 +436,7 @@ dump_interesting_info_from_elfs() local debug=$(match_so_to_debuginfo $so) if [ "$debug" == "" ]; then - exit 1 + continue fi # Run the ulp extract command on both the library and debuginfo. @@ -491,7 +464,7 @@ dump_interesting_info_from_elfs() find . -type f -name "*.txt" -delete # Delete any broken symlinks that may have been left after we deleted stuff. - find . -xtype l -exec rm {} \; + find . -xtype l -delete fi # Delete empty directories left. @@ -714,11 +687,11 @@ main() done for package in $all_names; do - local target=$(LANG=C date --date="today - 13 months") + local target=$(LANG=C date --date="today - 13 months" +%s) # Check if package time is in the supported range. if [[ $SETUP_UNSUPPORTED_LIBRARIES -eq 0 && \ - "$(LANG=C date -r $package)" < "$target" ]]; then + "$(LANG=C date -r $package +%s)" < "$target" ]]; then echo "Dropping $package because it is older than 13 months." continue; fi