diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-29 11:09:34 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-29 11:09:34 +0000 |
commit | c22cb56acddf5bc4147f60908d5ebd770a079070 (patch) | |
tree | 302eb716e7d6c4b9c514cf5cd9575b5a347fe220 /brp-chrpath | |
parent | b28db8b7389e86a8b2a424f4851ecf7714373516 (diff) |
automatic import of openEuler-rpm-config
Diffstat (limited to 'brp-chrpath')
-rwxr-xr-x | brp-chrpath | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/brp-chrpath b/brp-chrpath deleted file mode 100755 index dc48351..0000000 --- a/brp-chrpath +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/sh -# remove rpath specified - -rpathSuffix=( - "/home/abuild/rpmbuild/BUILD", - "/home/lkp/rpmbuild/BUILD" -) - -rpath=( - "/usr/lib64", - "/lib64", - "/usr/lib", - "/lib", - "/usr/lib/../lib64" -) - -buildroot=$1 - -function rpathChange() -{ - localSrcPath=$1 - localDstPath="" - - rpathArr=(`echo $localSrcPath | tr ':' ' '`) - - for path in ${rpathArr[*]} - do - localflag=0 - for suffix in ${rpathSuffix[*]} - do - if echo "$path" | grep $suffix &> /dev/null; then - localflag=1 - break - fi - done - - # Is the suffix path, delete - if [ $localflag -eq 1 ]; then - continue; - fi - - #Is the standard path, delete - if echo "${rpath[@]}" | grep -w $path &> /dev/null; then - continue - fi - - if [ x"$localDstPath" == x"" ]; then - localDstPath=$path - else - localDstPath=$localDstPath:$path - fi - done - - echo $localDstPath -} - -function removeRpathOrRunpath() -{ - localfile=$1 - - rpathInfo=$(chrpath -l $localfile | grep "RPATH=") - runpathInfo=$(chrpath -l $localfile | grep "RUNPATH=") - - currPath="" - realPath="" - needCh=0 - if [ x"$rpathInfo" != x"" ]; then - needCh=1 - currPath=$(echo $rpathInfo | awk -F "RPATH=" '{print $2}') - realPath=$(rpathChange $currPath) - fi - - if [ x"$runpathInfo" != x"" ]; then - needCh=1 - currPath=$(echo $runpathInfo | awk -F "RUNPATH=" '{print $2}') - realPath=$(rpathChange $currPath) - fi - - if [ $needCh -eq 0 ]; then - return 0 - fi - - if [ x"$realPath" == x"" ]; then - chrpath -d $localfile - else - chrpath -r $realPath $localfile - fi - - return 0 -} - -for file in $(find $buildroot/ -executable -type f -exec file {} ';' | grep "\<ELF\>" | awk -F ':' '{print $1}') -do - test -u $file - if [ $? -eq 0 ]; then - continue - fi - - if [ -w "$file" ]; then - removeRpathOrRunpath $file - fi -done - -exit 0 |