From fd1f88e7b9ce8524e0d9059cf0428a16ceda2552 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 12 Mar 2010 13:57:56 -0500 Subject: Revert "Make stap-prep script available in the RPM" This reverts commit da3dfc346ff926f0f1bdd2872fe4f5f8e920953a. --- .../en-US/extras/stapprep.sh | 39 ++++++++++++++++++++++ stap-prep | 39 ---------------------- systemtap.spec | 4 --- 3 files changed, 39 insertions(+), 43 deletions(-) create mode 100755 doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh delete mode 100755 stap-prep diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh new file mode 100755 index 00000000..3c6bf785 --- /dev/null +++ b/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh @@ -0,0 +1,39 @@ +#! /bin/bash +check_error() { if test $1 != 0; then echo $2; exit $1; fi } + +if [ "$#" -lt 1 ]; then + UNAME=`uname -r` # determine the kernel running on the machine +else + UNAME=$1 #user passed in uname value +fi +UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace +KERNEL="kernel" +for VARIANT in debug kdump PAE xen; do + TMP=`echo $UNAME | sed s/$VARIANT//` + if [ "$TMP" != "$UNAME" ]; then + UNAME=$TMP; KERNEL="kernel-$VARIANT" + fi +done +KERN_ARCH=`uname -m` +KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname +CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \ + $KERNEL-devel-$KERN_REV.$KERN_ARCH \ + $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH \ + kernel-debuginfo-common-$KERN_REV.$KERN_ARCH" +NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \ + -q $CANDIDATES | grep "is not installed" | awk '{print $2}'` +if [ "$NEEDED" != "" ]; then + echo -e "Need to install the following packages:\n$NEEDED" + if [ `id -u` = "0" ]; then #attempt download and install + DIR=`mktemp -d` || exit 1 + if [ ! -x /usr/bin/yumdownloader ]; then + echo "Need to first install yum-utils for yumdownloader" + yum install -y yum-utils + fi + yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR + check_error $? "problem downloading rpm(s) $NEEDED" + rpm --force -ivh $DIR/*.rpm + check_error $? "problem installing rpm(s) $NEEDED" + rm -r $DIR #cleanup + fi +fi diff --git a/stap-prep b/stap-prep deleted file mode 100755 index 3c6bf785..00000000 --- a/stap-prep +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -check_error() { if test $1 != 0; then echo $2; exit $1; fi } - -if [ "$#" -lt 1 ]; then - UNAME=`uname -r` # determine the kernel running on the machine -else - UNAME=$1 #user passed in uname value -fi -UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace -KERNEL="kernel" -for VARIANT in debug kdump PAE xen; do - TMP=`echo $UNAME | sed s/$VARIANT//` - if [ "$TMP" != "$UNAME" ]; then - UNAME=$TMP; KERNEL="kernel-$VARIANT" - fi -done -KERN_ARCH=`uname -m` -KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname -CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \ - $KERNEL-devel-$KERN_REV.$KERN_ARCH \ - $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH \ - kernel-debuginfo-common-$KERN_REV.$KERN_ARCH" -NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \ - -q $CANDIDATES | grep "is not installed" | awk '{print $2}'` -if [ "$NEEDED" != "" ]; then - echo -e "Need to install the following packages:\n$NEEDED" - if [ `id -u` = "0" ]; then #attempt download and install - DIR=`mktemp -d` || exit 1 - if [ ! -x /usr/bin/yumdownloader ]; then - echo "Need to first install yum-utils for yumdownloader" - yum install -y yum-utils - fi - yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR - check_error $? "problem downloading rpm(s) $NEEDED" - rpm --force -ivh $DIR/*.rpm - check_error $? "problem installing rpm(s) $NEEDED" - rm -r $DIR #cleanup - fi -fi diff --git a/systemtap.spec b/systemtap.spec index 6725d91d..d29dac5f 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -275,9 +275,6 @@ find examples testsuite -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1 # permissions back to 04111 in the %files section below. chmod 755 $RPM_BUILD_ROOT%{_bindir}/staprun -#install the useful stap-prep script -install -c -m 755 stap-prep $RPM_BUILD_ROOT/usr/bin/stap-prep - # Copy over the testsuite cp -rp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap @@ -413,7 +410,6 @@ exit 0 %{_bindir}/stap %{_bindir}/stap-report -%{_bindir}/stap-prep %{_mandir}/man1/* %{_mandir}/man3/* -- cgit