From: jistone Date: Fri, 3 Mar 2006 19:39:49 +0000 (+0000) Subject: 2006-03-03 Josh Stone X-Git-Tag: release-0.5.5~54 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6f9f33e208c46af712e40c089748c5185121ceaf;p=systemtap.git 2006-03-03 Josh Stone 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. --- diff --git a/ChangeLog b/ChangeLog index bff437d44..2d9eb3c20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,16 @@ 2006-03-03 Josh Stone * 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 * tapset/indent.stp, indent-default.stp: New little tapset. diff --git a/main.cxx b/main.cxx index 8088c65b1..46f795663 100644 --- a/main.cxx +++ b/main.cxx @@ -313,7 +313,7 @@ main (int argc, char * const argv []) // Construct arch / kernel-versioning search path vector 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);