]> sourceware.org Git - systemtap.git/commitdiff
2006-03-03 Josh Stone <joshua.i.stone@intel.com>
authorjistone <jistone>
Fri, 3 Mar 2006 19:39:49 +0000 (19:39 +0000)
committerjistone <jistone>
Fri, 3 Mar 2006 19:39:49 +0000 (19:39 +0000)
PR 2390
* main.cxx (main): expand search path so that revision w.x.y.z
searches w.x.y.z, w.x.y, and w.x.

ChangeLog
main.cxx

index bff437d4475cf0118003fa27bbc19996303d3eda..2d9eb3c20f67a9fa9a160ad72e8f2c3c22730477 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,16 @@
 2006-03-03  Josh Stone  <joshua.i.stone@intel.com>
 
        * main.cxx (main): search forward for dashes in the kernel release,
-       to work properly with release names with more than one dash.
+       to work properly with release names with more than one dash.  Also
        * parse.cxx (eval_pp_conditional): ditto
        * tapsets.cxx (profile_derived_probe::profile_derived_probe): ditto
        * safety/safety.py (StaticSafety::__build_search_suffixes): ditto,
        and add copyright & GPL tag
 
+       PR 2390
+       * main.cxx (main): expand search path so that revision w.x.y.z
+       searches w.x.y.z, w.x.y, and w.x.
+
 2006-03-03  Frank Ch. Eigler  <fche@elastic.org>
 
        * tapset/indent.stp, indent-default.stp: New little tapset.
index 8088c65b1eeb95809a8bcb5f0c035d106226a31c..46f795663db1f0dc5f3e5cac798b080ba6a725b9 100644 (file)
--- a/main.cxx
+++ b/main.cxx
@@ -313,7 +313,7 @@ main (int argc, char * const argv [])
 
   // Construct arch / kernel-versioning search path
   vector<string> version_suffixes;
-  const string& kvr = s.kernel_release;
+  string kvr = s.kernel_release;
   const string& arch = s.architecture;
   // add full kernel-version-release (2.6.NN-FOOBAR) + arch
   version_suffixes.push_back ("/" + kvr + "/" + arch);
@@ -321,15 +321,18 @@ main (int argc, char * const argv [])
   // add kernel version (2.6.NN) + arch
   string::size_type dash_index = kvr.find ('-');
   if (dash_index > 0 && dash_index != string::npos) {
-    version_suffixes.push_back ("/" + kvr.substr (0, dash_index) + "/" + arch);
-    version_suffixes.push_back ("/" + kvr.substr (0, dash_index));
+    kvr.erase(dash_index);
+    version_suffixes.push_back ("/" + kvr + "/" + arch);
+    version_suffixes.push_back ("/" + kvr);
   }
   // add kernel family (2.6) + arch
-  string::size_type dot_index = kvr.find ('.');
-  string::size_type dot2_index = kvr.find ('.', dot_index+1);
-  if (dot2_index > 0 && dot2_index != string::npos) {
-    version_suffixes.push_back ("/" + kvr.substr (0, dot2_index) + "/" + arch);
-    version_suffixes.push_back ("/" + kvr.substr (0, dot2_index));
+  string::size_type dot1_index = kvr.find ('.');
+  string::size_type dot2_index = kvr.rfind ('.');
+  while (dot2_index > dot1_index && dot2_index != string::npos) {
+    kvr.erase(dot2_index);
+    version_suffixes.push_back ("/" + kvr + "/" + arch);
+    version_suffixes.push_back ("/" + kvr);
+    dot2_index = kvr.rfind ('.');
   }
   // add architecture search path
   version_suffixes.push_back("/" + arch);
This page took 0.037546 seconds and 5 git commands to generate.