summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjistone <jistone>2006-03-03 19:39:49 +0000
committerjistone <jistone>2006-03-03 19:39:49 +0000
commit6f9f33e208c46af712e40c089748c5185121ceaf (patch)
tree6ffc28072a820b3f9b9465c4278290e97c57ddd2
parent77a5c1f9949be4bdf3ebc6fb969debd68a9ebd27 (diff)
downloadsystemtap-steved-6f9f33e208c46af712e40c089748c5185121ceaf.tar.gz
systemtap-steved-6f9f33e208c46af712e40c089748c5185121ceaf.tar.xz
systemtap-steved-6f9f33e208c46af712e40c089748c5185121ceaf.zip
2006-03-03 Josh Stone <joshua.i.stone@intel.com>
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.
-rw-r--r--ChangeLog6
-rw-r--r--main.cxx19
2 files changed, 16 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index bff437d4..2d9eb3c2 100644
--- 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.
diff --git a/main.cxx b/main.cxx
index 8088c65b..46f79566 100644
--- 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);