rpm-build/scripts/find-scriptlet-requires.in
Vitaly Chikunov b893f89a7f Fix regression introduced by forgotten file usage
There was two forgotten file instances. Fix error such as:

  /root/tmp/rpm-tmp.80ZNEF: line 1: /usr/sbin/post_service: No such file or directory
  error: %post(traefik-2.4.14-alt1.x86_64) scriptlet failed, exit status 127
  error: traefik-2.4.14-alt1.x86_64: install failed

Fixes: 5ef5c8ff4 ("Use file4 instead of file")
2021-08-18 01:20:36 +03:00

39 lines
1.0 KiB
Bash
Executable File

#!/bin/sh -efu
#
# Copyright (C) 2008 Alexey Tourbin <at@altlinux.org>
#
# 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 2 of the License, or
# (at your option) any later version.
. @RPMCONFIGDIR@/functions
script="$1"
RunMethod()
{
local exe="$1"; shift
local filter="$exe".files
[ -x "$filter" ] || return 0
local file_and_type
file_and_type=$(file4 -L -NF$'\t' "$script")
local filtered
filtered=$(printf '%s\n' "$file_and_type" |"$filter") ||
Fatal "$filter failed"
[ -n "$filtered" ] || return 0
printf '%s\n' "$script" |"$exe" ||
Fatal "$exe failed"
}
export RPM_FINDPACKAGE_COMMANDS_LOG="$RPM_BUILD_ROOT"/.findpackage-commands
>"$RPM_FINDPACKAGE_COMMANDS_LOG"
methods=$(SetupMethods req all)
RunMethods req "$methods" RunMethod
if [ -s "$RPM_FINDPACKAGE_COMMANDS_LOG" ]; then
LC_ALL=C sort -u -o "$RPM_FINDPACKAGE_COMMANDS_LOG"{,}
Info "FINDPACKAGE-COMMANDS:" $(cat <"$RPM_FINDPACKAGE_COMMANDS_LOG")
fi