summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2009-01-04 04:37:24 -0800
committerRoland McGrath <roland@redhat.com>2009-01-04 04:37:24 -0800
commitce862303411e3526562184381a6b594053ac2a39 (patch)
tree63e9a9ddfe55b66fc3e46b25ce62b5978da072bc
parente5528628bd8a01aa42916314173f65330487fa85 (diff)
downloaddebuginfo-test-scripts-ce862303411e3526562184381a6b594053ac2a39.tar.gz
debuginfo-test-scripts-ce862303411e3526562184381a6b594053ac2a39.tar.xz
debuginfo-test-scripts-ce862303411e3526562184381a6b594053ac2a39.zip
fixes
-rwxr-xr-xextract-distro.sh14
-rwxr-xr-xextract-rpm.sh2
-rwxr-xr-xpack-debuginfo.sh43
3 files changed, 27 insertions, 32 deletions
diff --git a/extract-distro.sh b/extract-distro.sh
index 866b897..ef8f452 100755
--- a/extract-distro.sh
+++ b/extract-distro.sh
@@ -1,17 +1,17 @@
#!/bin/sh
-n=1
-if [ "x$1" = "x-j" ]; then
- n=$2
- shift
- shift
-esac
+srcdir=`dirname $0`
+srcdir=`(cd "$srcdir"; pwd)`
+PATH="$srcdir:$PATH"
here=`pwd`
+df -h .
for distro; do
for dir in $distro/*/debug/; do
echo "considering ${dir}..."
- (cd "$dir" && ls | ./extract-rpm.sh "$here") | ./pack-debuginfo.sh $n
+ (cd "$dir" && ls | extract-rpm.sh "$here") | pack-debuginfo.sh &
done
+ wait
+ df -h .
done
diff --git a/extract-rpm.sh b/extract-rpm.sh
index 56bf0d9..1449660 100755
--- a/extract-rpm.sh
+++ b/extract-rpm.sh
@@ -8,7 +8,7 @@ fi
dest=$1; shift
-for rpm; do
+while read rpm; do
name="${rpm%.rpm}"
if [ "$name" = "$rpm" ]; then
diff --git a/pack-debuginfo.sh b/pack-debuginfo.sh
index fae5cb7..de76bdd 100755
--- a/pack-debuginfo.sh
+++ b/pack-debuginfo.sh
@@ -7,7 +7,7 @@ get_size()
do_src()
{
- if was=`du -sh usr/src`; then
+ if was=`du -sh usr/src 2> /dev/null`; then
tar cf - usr/src | bzip2 -9 > src.tar.bz2
is=`du -sh src.tar.bz2`
rm -rf usr/src &
@@ -24,7 +24,7 @@ do_collect()
> dyn
> rel
> archive
- find usr/lib* -type f -print0 | xargs -0 file -N -F ' ' -i |
+ find usr/lib* -type f -print0 | xargs --no-run-if-empty -0 file -N -F ' ' -i |
awk -v dir="$dir" -v src="$size" '
BEGIN { e = d = r = u = a = 0 }
NF == 2 && $2 == "application/x-executable" { print $1 > "exec" ; ++e; next }
@@ -46,27 +46,30 @@ do_dir()
do_src &
- find usr/lib/* -type f ! -links 1 -exec rm -f {} \;
+ find usr/lib/debug -type f ! -links 1 -exec rm -f {} \; 2> /dev/null
- summary=`do_collect`
-
- was=`du -sh usr/lib/debug`
- (echo 'all: \'
- sed 's,$,.bz2,;$!s,$,\\,' exec dyn rel
- echo '%.bz2: %; bzip2 -9 $<'
- ) | make -s -r -f - -j`getconf _NPROCESSORS_ONLN`
- is=`du -sh usr/lib/debug`
- get_size $was $is
+ if was=`du -sh usr/lib/debug 2> /dev/null`; then
+ summary=`do_collect`
+ (echo 'all: \'
+ sed 's,$,.bz2,;$!s,$,\\,' exec dyn rel
+ echo '%.bz2: %; bzip2 -9 $<'
+ ) | make -s -r -f - -j`getconf _NPROCESSORS_ONLN`
+ is=`du -sh usr/lib/debug`
+ get_size $was $is
+ summary="$summary bz2 $size"
+ else
+ summary="debug missing"
+ fi
wait
- echo " $summary bz2 $size" >> summary
+ echo " $summary" >> summary
cd ..
+
+ echo "packed $dir"
}
-n=${1:-1}
-run=$n
while read dir; do
if [ -r "$dir/summary" ]; then
@@ -74,15 +77,7 @@ while read dir; do
continue
fi
-
- if [ $run -gt 1 ]; then
- do_dir &
- run=$[$run - 1]
- else
- do_dir
- wait
- run=$n
- fi
+ do_dir
done