From 706f35fa709d30a2ffa3dcf5c035749fa9f102ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= Date: Sun, 13 Nov 2022 12:58:15 +0100 Subject: [PATCH] fix for fix_pamd --- Makefile | 2 +- fix_pamd | 2 +- rediff_patch | 18 +++++++++--------- spec-cleaner | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 1606bd8..a87992c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = spec-helper -VERSION = 0.31.50 +VERSION = 0.31.53 GITPATH = git@github.com:OpenMandrivaSoftware/spec-helper.git SCRIPT_FILES = clean_files clean_perl check_elf_files \ diff --git a/fix_pamd b/fix_pamd index 1b137d5..42b9b8f 100755 --- a/fix_pamd +++ b/fix_pamd @@ -13,6 +13,6 @@ fi configs=$(find $RPM_BUILD_ROOT/etc/pam.d/ -type f ! -type l 2> /dev/null) if [ -n "$configs" ]; then printf '%s\n' "Fixing pam.d config files..." - sed -e 's,/lib64/security/,,g ; s,/lib/security/,,g' $configs + sed -r 's,/(usr/)?(lib|lib64)/security/,,g' $configs printf '%s\n' "...done" fi diff --git a/rediff_patch b/rediff_patch index 220faba..27863a7 100755 --- a/rediff_patch +++ b/rediff_patch @@ -15,7 +15,7 @@ shopt -s nullglob -spec_count=`ls -1 *spec 2>/dev/null | wc -l` +spec_count=$(ls -1 *spec 2>/dev/null | wc -l) if [[ $spec_count != 1 ]]; then echo "Can't detect spec file to work with - current folder either contains no spec files or contains several spec files." exit @@ -38,7 +38,7 @@ if [[ $target_patch == '-h' || $target_patch == '--help' ]]; then fi # Remember number of patch files in current dir -patch_count=`ls -1 *patch 2>/dev/null | wc -l` +patch_count=$(ls -1 *patch 2>/dev/null | wc -l) if [[ "${target_patch}" == "" ]]; then # if no patch is provided as script argument and there is only a single patch in the folder, @@ -51,7 +51,7 @@ if [[ "${target_patch}" == "" ]]; then fi exit 1 else - target_patch=`ls -1 *patch` + target_patch=$(ls -1 *patch) echo "No patch specified as an argument, processing ${target_patch}" fi fi @@ -63,16 +63,16 @@ if [[ $? == 0 ]]; then patch_cmd="patch -p1 --force" elif [[ $patch_count == 1 ]]; then # only one patch and no %apply_patches, so we can expect the only %patch command in the spec - patch_cmd=`grep '^%patch' *spec | cut -f1,2 -d- | sed 's/^%patch[[:digit:]]*/patch --force /'` + patch_cmd=$(grep '^%patch' *spec | cut -f1,2 -d- | sed 's/^%patch[[:digit:]]*/patch --force /') else # grep for Patch: record in spec corresponding to our patch # drop name from the beginning of the patch name, # since one can use %name or %{name} in patch name in spec - project=`basename "$PWD"` - patch_num=`grep "^Patch.*${target_patch/$project/}" *spec | sed 's/^Patch\([[:digit:]]*\).*$/\1/'` + project=$(basename "$PWD") + patch_num=$(grep "^Patch.*${target_patch/$project/}" *spec | sed 's/^Patch\([[:digit:]]*\).*$/\1/') # now grep for necessary %patch command - patch_cmd=`grep "\%patch${patch_num}[[:space:]]\|\%patch${patch_num}\$" *spec | cut -f1,2 -d- | sed 's/^\%patch[[:digit:]]*/patch --force /'` + patch_cmd=$(grep "\%patch${patch_num}[[:space:]]\|\%patch${patch_num}\$" *spec | cut -f1,2 -d- | sed 's/^\%patch[[:digit:]]*/patch --force /') fi rm -rf rediff_patch @@ -128,7 +128,7 @@ fi # Let's check how many folders exist in the current one after tarball unpacking # We support only the situation when we have a single folder (except .git) # which will be subjected to patching then -count=`ls -l | grep -v .git | grep '^d' 2>/dev/null | wc -l` +count=$(ls -l | grep -v .git | grep '^d' 2>/dev/null | wc -l) if [[ $count != 1 ]]; then if [[ $count == 0 ]]; then echo "No folders, something went wrong with unpacking of tarball" @@ -140,7 +140,7 @@ if [[ $count != 1 ]]; then fi # Create folder backup and try to apply the patch -folder=`ls -l | grep '^d' | rev | cut -f1 -d\ | rev` +folder=$(ls -l | grep '^d' | rev | cut -f1 -d\ | rev) cp -r $folder ${folder}.orig cp ../$target_patch $folder diff --git a/spec-cleaner b/spec-cleaner index cb3f0d7..b27e6ae 100755 --- a/spec-cleaner +++ b/spec-cleaner @@ -259,7 +259,7 @@ while() { $line =~ s/({|%)python3_sitelib/$1py3_puresitedir/g; $line =~ s/({|%)python_version/$1py_ver/g; $line =~ s/({|%)pyver/$1py_ver/g; - $line =~ s/\%py_requires -d/BuildRequires: python-devel/; + $line =~ s/\%py_requires -d/BuildRequires: pkgconfig\(python\)/; foreach $var (@vars) { $line =~ s/\%$var/\%\{$var\}/g;