Avoid some unnecessary command invocations in scripts.

This commit is contained in:
Ville Skyttä 2010-02-03 23:15:31 +02:00 committed by Panu Matilainen
parent 4302a06700
commit 398ae27985
2 changed files with 2 additions and 3 deletions

View File

@ -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\)$//'`;;

View File

@ -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)" && \