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);
+++ /dev/null
-#!/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 <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-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 $?