summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2010-02-03 23:15:31 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-02-11 15:40:09 +0200
commit398ae27985ff854c627353cbd578a21c1dff3dcd (patch)
tree8fea9ef71201795c4a9d887487c06eae3912c185
parent4302a06700656da0d82a91964581e74f04bec9e4 (diff)
downloadrpm-398ae27985ff854c627353cbd578a21c1dff3dcd.tar.gz
rpm-398ae27985ff854c627353cbd578a21c1dff3dcd.tar.bz2
rpm-398ae27985ff854c627353cbd578a21c1dff3dcd.zip
Avoid some unnecessary command invocations in scripts.
-rwxr-xr-xscripts/brp-compress3
-rwxr-xr-xscripts/brp-python-hardlink2
2 files changed, 2 insertions, 3 deletions
diff --git a/scripts/brp-compress b/scripts/brp-compress
index 3c8e7577b..1e8772d8d 100755
--- a/scripts/brp-compress
+++ b/scripts/brp-compress
@@ -17,10 +17,9 @@ for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f`
+ for f in `find $d -type f ! -name dir`
do
[ -f "$f" ] || continue
- [ "`basename $f`" = "dir" ] && continue
case "$f" in
*.gz|*.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
diff --git a/scripts/brp-python-hardlink b/scripts/brp-python-hardlink
index a9375291c..5453866eb 100755
--- a/scripts/brp-python-hardlink
+++ b/scripts/brp-python-hardlink
@@ -8,7 +8,7 @@ fi
# Hardlink identical *.pyc and *.pyo, originally from PLD's rpm-build-macros
# Modified to use sha1sum instead of cmp to avoid a diffutils dependency.
find "$RPM_BUILD_ROOT" -type f -name "*.pyc" | while read pyc ; do
- pyo="$(echo $pyc | sed -e 's/.pyc$/.pyo/')"
+ pyo="${pyc%c}o"
if [ -f "$pyo" ] ; then
csha="$(sha1sum -b $pyc | cut -d' ' -f 1)" && \
osha="$(sha1sum -b $pyo | cut -d' ' -f 1)" && \