From: Michael Tremer Date: Fri, 3 Jan 2025 18:07:16 +0000 (+0000) Subject: scripts: Remove the old find-provides script X-Git-Tag: 0.9.30~548 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8ed9847118d106e966c24e652d1d43058c6927c;p=pakfire.git scripts: Remove the old find-provides script All the functionality has been replaced. Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index d8843829a..d5daa5df4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1021,7 +1021,6 @@ tests_parser_test_LDADD = \ dist_scripts_SCRIPTS = \ src/scripts/compress-man-pages \ src/scripts/find-prerequires \ - src/scripts/find-provides \ src/scripts/find-requires \ src/scripts/mkimage \ src/scripts/perl.prov \ diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 5ac262cc0..345c1aa83 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -863,12 +863,6 @@ static int pakfire_build_find_dependencies(struct pakfire_build* build, if (r < 0) goto ERROR; - // XXX LEGACY CODE - r = pakfire_build_find_deps(build, pkg, - PAKFIRE_PKG_PROVIDES, "find-provides", filelist, 0); - if (r) - goto ERROR; - // Find all Perl provides r = pakfire_build_find_deps(build, pkg, PAKFIRE_PKG_PROVIDES, "perl.prov", filelist, PAKFIRE_FILE_PERL); diff --git a/src/scripts/find-provides b/src/scripts/find-provides deleted file mode 100644 index 0f0b003f6..000000000 --- a/src/scripts/find-provides +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -############################################################################### -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2021 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -############################################################################### - -error() { - echo "$@" >&2 -} - -FILTER_WEAK_PROVIDES='BEGIN { START=0; } - /Version definitions:/ { START=1; } - /^[0-9]/ && (START==1) { print $4; } - /^$/ { START=0; }' - -pkgconfig_provides() { - local file="${1}" - - local n r v - while read -r n r v; do - echo "pkgconfig(${n}) ${r} ${v}" - done < <(pkg-config --print-provides "${file}" 2>/dev/null) - - return 0 -} - -shared_object_provides() { - local file="${1}" - - # Get SONAME - local soname="$(objdump -p "${file}" 2>/dev/null | awk '/SONAME/ { print $2 }')" - - # If the files does not have a SONAME, we will simply use the basename - if [ -z "${soname}" ]; then - soname="$(basename "${file}")" - fi - - local suffix - - # Is this a 64 bit file? - if file -L "${file}" 2>/dev/null | grep -q "ELF 64-bit"; then - suffix="(64bit)" - - echo "${soname}()${suffix}" - else - echo "${soname}" - fi - - # Find weak symbol provides - while read -r symbol; do - echo "${soname}(${symbol})${suffix}" - done < <(objdump -p "${file}" 2>/dev/null | awk "${FILTER_WEAK_PROVIDES}") - - return 0 -} - -main() { - local buildroot="${1}" - - # Check if BUILDROOT exists - if [ ! -d "${buildroot}" ]; then - error "BUILDROOT (${buildroot}) does not exist" - return 1 - fi - - local file - while read -r file; do - # Filter out what we don't need - case "${file}" in - # Debug files - /usr/lib/debug/*|/usr/src/debug/*) - continue - ;; - - # Skip shared objects in Python directories - /usr/lib*/python*/*.so*) - continue - ;; - - # Skip gconv - /usr/lib*/gconv/*) - continue - ;; - esac - - # Make the full path - local path="${buildroot}${file}" - - # Process special files - case "${file}" in - # pkg-config - *.pc) - # Query provides of the package - pkgconfig_provides "${path}" - ;; - - # Shared objects - *.so|*.so.*) - # Skip symlinks - if [ -L "${path}" ]; then - continue - fi - - shared_object_provides "${path}" - ;; - esac - done | sort -u - - return 0 -} - -main "$@" || exit $?