From: Michael Tremer Date: Sat, 4 Jan 2025 13:57:30 +0000 (+0000) Subject: build: Drop the old find-requires script X-Git-Tag: 0.9.30~541 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8c11a4e059dc2ba0ee503d4889432e94e9d97aa;p=pakfire.git build: Drop the old find-requires script Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index d5daa5df4..a0a6d5d5a 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-requires \ src/scripts/mkimage \ src/scripts/perl.prov \ src/scripts/perl.req diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 8a3c659b6..88169e81b 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -907,12 +907,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_REQUIRES, "find-requires", filelist, 0); - if (r) - goto ERROR; - // Find all Perl requires r = pakfire_build_find_deps(build, pkg, PAKFIRE_PKG_REQUIRES, "perl.req", filelist, PAKFIRE_FILE_PERL); diff --git a/src/scripts/find-requires b/src/scripts/find-requires deleted file mode 100644 index 8c46eaa73..000000000 --- a/src/scripts/find-requires +++ /dev/null @@ -1,118 +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 -} - -find_script_interpreter() { - local file="${1}" - - # Don't find interpreters for non-executable files - if [ ! -x "${file}" ]; then - return 0 - fi - - local first_line="$(grep -q "^#!" "${file}" && head -n1 "${file}")" - - # Skip files that are not scripts - if [ "${first_line:0:2}" != "#!" ]; then - return 0 - fi - - local interpreter="${first_line:2}" - - # Ignore anything that does not have an absolute path - if [ "${first_line:3:1}" != "/" ]; then - return 0 - fi - - case "${interpreter}" in - */perl) - # XXX process perl files here - ;; - esac - - echo "${interpreter}" - 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 gconv - /usr/lib*/gconv/*) - continue - ;; - - # Skip all kernel modules - *.ko) - continue - ;; - esac - - # Make the full path - local path="${buildroot}${file}" - - # Process unresolvable symlinks - if [ -L "${path}" ]; then - local link="$(readlink -m "${path}")" - - # Make link relative to buildroot - link="${link#${buildroot}}" - - # If the destination is not in this package, we create a dependency for it - echo "${link}" - - # We do not process symlinks any further - continue - fi - - # Skip anything that isn't a regular file - if [ ! -f "${path}" ]; then - continue - fi - - # Add script interpreters - if ! find_script_interpreter "${path}"; then - return 1 - fi - done | sort -u - - return 0 -} - -main "$@" || exit $?