This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Making the scripts used in the beginner's guide available


Hi,

There was some requests to make the scripts described in the SystemTap Beginners
Guide available. The attached patch makes to those scripts available.
The following changes were made:

1) Move the scripts from doc/SystemTap_Beginners_Guide to scripts
2) Modify the make file of the Beginners Guide to copy the scripts
3) Modify the main make files to install the scripts
4) List the installed script in the systemtap.spec

I would like some feedback before checking in this patch.

-Will
diff --git a/Makefile.am b/Makefile.am
index 580c417..ea119c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,7 +24,9 @@ man/stapprobes.tcp.3stap man/stapprobes.udp.3stap
 # see also configure.ac
 
 bin_PROGRAMS = stap staprun
-bin_SCRIPTS = stap-report
+bin_SCRIPTS = stap-report \
+	      scripts/stapprep.sh scripts/fedoradebugurl.sh \
+	      scripts/rheldebugurl.sh
 oldinclude_HEADERS = includes/sys/sdt.h
 if BUILD_SERVER
 man_MANS += stap-server.8 
diff --git a/Makefile.in b/Makefile.in
index 35bcd48..3a0ea19 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -289,6 +289,7 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
@@ -306,7 +307,9 @@ man_MANS = stap.1 stapprobes.3stap stapfuncs.3stap stapvars.3stap \
 	man/stapprobes.scsi.3stap man/stapprobes.signal.3stap \
 	man/stapprobes.socket.3stap man/stapprobes.tcp.3stap \
 	man/stapprobes.udp.3stap $(am__append_1)
-bin_SCRIPTS = stap-report $(am__append_3) dtrace
+bin_SCRIPTS = stap-report scripts/stapprep.sh \
+	scripts/fedoradebugurl.sh scripts/rheldebugurl.sh \
+	$(am__append_3) dtrace
 oldinclude_HEADERS = includes/sys/sdt.h
 stap_SOURCES = main.cxx \
 	parse.cxx staptree.cxx elaborate.cxx translate.cxx \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 9375366..e23a669 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -163,6 +163,7 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 PDF_FILES = tutorial.pdf langref.pdf
diff --git a/doc/SystemTap_Beginners_Guide/Makefile b/doc/SystemTap_Beginners_Guide/Makefile
index 32dc0d5..2805f3f 100644
--- a/doc/SystemTap_Beginners_Guide/Makefile
+++ b/doc/SystemTap_Beginners_Guide/Makefile
@@ -15,8 +15,10 @@ include $(COMMON_CONFIG)/make/Makefile.common
 
 pre::
 	cp -a ../../testsuite en-US/extras/;
+	cp -a ../../scripts/*.sh en-US/extras/;
 
 post::
 	rm -rf en-US/extras/testsuite
+	rm -rf en-US/extras/*.sh
 	sed -i -e 's/<productname>Fedora/<productname>Red Hat Enterprise Linux/g' en-US/Book_Info.xml;
 	sed -i -e 's/<productnumber>10/<productnumber>5/g' en-US/Book_Info.xml;
diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/fedoradebugurl.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/fedoradebugurl.sh
deleted file mode 100755
index ac6b525..0000000
--- a/doc/SystemTap_Beginners_Guide/en-US/extras/fedoradebugurl.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/bash
-echo -n "Enter nvr of kernel-debuginfo (e.g. 2.6.25-14.fc9.x86_64) " ; \
-read NVR; \
-BASE=`uname -m` ; \
-NVR=`echo $NVR | sed s/.$BASE//` ; \
-VERSION=`echo $NVR | awk -F- '{print $1}'` ; \
-RELEASE=`echo $NVR | awk -F- '{print $2}'` ; \
-echo "http://kojipkgs.fedoraproject.org/\
-packages/kernel/$VERSION/$RELEASE/$BASE/"
diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/rheldebugurl.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/rheldebugurl.sh
deleted file mode 100755
index 0449843..0000000
--- a/doc/SystemTap_Beginners_Guide/en-US/extras/rheldebugurl.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/bash
-pkg="redhat-release"
-releasever=`rpm -q --qf "%{version}" $pkg`
-base=`uname -m`
-echo "ftp://ftp.redhat.com/pub/redhat/linux/\
-enterprise/$releasever/en/os/$base/Debuginfo"
diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh
deleted file mode 100755
index 6905c9c..0000000
--- a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh
+++ /dev/null
@@ -1,35 +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
-        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/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in
index 06286d6..6fe6bab 100644
--- a/doc/SystemTap_Tapset_Reference/Makefile.in
+++ b/doc/SystemTap_Tapset_Reference/Makefile.in
@@ -166,6 +166,7 @@ staplog_CPPFLAGS = @staplog_CPPFLAGS@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap
diff --git a/scripts/fedoradebugurl.sh b/scripts/fedoradebugurl.sh
new file mode 100755
index 0000000..ac6b525
--- /dev/null
+++ b/scripts/fedoradebugurl.sh
@@ -0,0 +1,9 @@
+#! /bin/bash
+echo -n "Enter nvr of kernel-debuginfo (e.g. 2.6.25-14.fc9.x86_64) " ; \
+read NVR; \
+BASE=`uname -m` ; \
+NVR=`echo $NVR | sed s/.$BASE//` ; \
+VERSION=`echo $NVR | awk -F- '{print $1}'` ; \
+RELEASE=`echo $NVR | awk -F- '{print $2}'` ; \
+echo "http://kojipkgs.fedoraproject.org/\
+packages/kernel/$VERSION/$RELEASE/$BASE/"
diff --git a/scripts/rheldebugurl.sh b/scripts/rheldebugurl.sh
new file mode 100755
index 0000000..0449843
--- /dev/null
+++ b/scripts/rheldebugurl.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+pkg="redhat-release"
+releasever=`rpm -q --qf "%{version}" $pkg`
+base=`uname -m`
+echo "ftp://ftp.redhat.com/pub/redhat/linux/\
+enterprise/$releasever/en/os/$base/Debuginfo"
diff --git a/scripts/stapprep.sh b/scripts/stapprep.sh
new file mode 100755
index 0000000..6905c9c
--- /dev/null
+++ b/scripts/stapprep.sh
@@ -0,0 +1,35 @@
+#! /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
+        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 020cd00..e27817d 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -249,6 +249,9 @@ exit 0
 
 %{_bindir}/stap
 %{_bindir}/stap-report
+%{_bindir}/stapprep.sh
+%{_bindir}/fedoradebugurl.sh
+%{_bindir}/rheldebugurl.sh
 %{_mandir}/man1/*
 %{_mandir}/man3/*
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]