diff options
author | Dave Brolley <brolley@redhat.com> | 2008-09-12 11:24:05 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2008-09-12 11:24:05 -0400 |
commit | 2c92c3026644f70f2628949a5cc0f94506a46ff5 (patch) | |
tree | 872adface963534337345d73daaa4e76a9927e82 | |
parent | 7d24ceab85d64c5e9dcb4963d91d123d8303ef30 (diff) | |
download | systemtap-steved-2c92c3026644f70f2628949a5cc0f94506a46ff5.tar.gz systemtap-steved-2c92c3026644f70f2628949a5cc0f94506a46ff5.tar.xz systemtap-steved-2c92c3026644f70f2628949a5cc0f94506a46ff5.zip |
fixes for stap-find-servers and systemtap.spec
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | stap-find-servers | 28 | ||||
-rw-r--r-- | systemtap.spec | 4 |
3 files changed, 28 insertions, 11 deletions
@@ -1,3 +1,10 @@ +2008-09-12 Dave Brolley <brolley@redhat.com> + + * stap-find-servers (match_server): Don't read past the start of the + next server description. Don't use '^' at the start of the regexp + on calls to 'expr'. + * systemtap.spec: client and server sub packages require avahi. + 2008-09-10 Josh Stone <joshua.i.stone@intel.com> * main.cxx (printscript): Ensure no variables are printed in probe lists diff --git a/stap-find-servers b/stap-find-servers index fea645bd..3038c54e 100755 --- a/stap-find-servers +++ b/stap-find-servers @@ -50,19 +50,27 @@ function match_server { local rc=1 # not found yet # Loop over the avahi service descriptors. - while read + read || exit $rc + while test "X$REPLY" != "X" do + server_name= + server_ip= + server_port= + server_sysinfo= + # Examine the next service descriptor # Is it a stap server? - (echo $REPLY | grep -q "^=.*_stap") || continue + if ! echo $REPLY | grep -q "=.* .* IPv4 .*_stap"; then + read || exit $rc + continue + fi + REPLY= # Get the details of the service - local service_tag equal data + local service_tag equal service_data while read service_tag equal service_data do case $service_tag in - '=' ) - break ;; hostname ) server_name=`expr "$service_data" : '\[\([^]]*\)\]'` ;; @@ -74,12 +82,12 @@ function match_server { local attempt for ((attempt=0; $attempt < 5; ++attempt)) do - server_ip=`expr "$server_ip" : '^\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)$'` + server_ip=`expr "$server_ip" : '\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)$'` if test "X$server_ip" != "X"; then break fi # Resolve the server.domain to an ip address. - server_ip=`avahi-resolve-host-name $hostname` + server_ip=`avahi-resolve-host-name $server_name` server_ip=`expr "$server_ip" : '.* \(.*\)$'` done ;; @@ -90,7 +98,9 @@ function match_server { server_sysinfo=`expr "$service_data" : '\[.*\"\(sysinfo=[^]]*\)\"\]'` ;; * ) - break ;; + REPLY="$service_tag $equal $service_data" + break + ;; esac done @@ -100,7 +110,7 @@ function match_server { fi # It's compatible, or we're finding all servers. Print a summary line - echo $server_name $server_ip $server_port "'$server_sysinfo'" + echo "$server_name $server_ip $server_port '$server_sysinfo'" rc=0 done diff --git a/systemtap.spec b/systemtap.spec index 4a7d2b4a..1a967cf1 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -81,7 +81,7 @@ Group: Development/System License: GPLv2+ URL: http://sourceware.org/systemtap/ Requires: systemtap-runtime = %{version}-%{release} -Requires: avahi-tools nc mktemp +Requires: avahi avahi-tools nc mktemp %description client SystemTap client is the client component of an instrumentation @@ -94,7 +94,7 @@ Group: Development/System License: GPLv2+ URL: http://sourceware.org/systemtap/ Requires: systemtap -Requires: avahi-tools nc net-tools mktemp +Requires: avahi avahi-tools nc net-tools mktemp %description server SystemTap server is the server component of an instrumentation |