Skip to content

Commit

Permalink
fix for fix_pamd
Browse files Browse the repository at this point in the history
  • Loading branch information
tpgxyz committed Nov 13, 2022
1 parent cb59077 commit 706f35f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = spec-helper
VERSION = 0.31.50
VERSION = 0.31.53
GITPATH = [email protected]:OpenMandrivaSoftware/spec-helper.git

SCRIPT_FILES = clean_files clean_perl check_elf_files \
Expand Down
2 changes: 1 addition & 1 deletion fix_pamd
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions rediff_patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec-cleaner
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ while(<F>) {
$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;
Expand Down

0 comments on commit 706f35f

Please sign in to comment.