From c9ebc799b5afbe07c59f3bc850fbed63f793be9b Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 17 Nov 2010 12:41:29 +0300 Subject: [PATCH] Improve select distro. --- pym/cl_builder.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pym/cl_builder.py b/pym/cl_builder.py index 49dcf61..fa5254d 100644 --- a/pym/cl_builder.py +++ b/pym/cl_builder.py @@ -541,7 +541,14 @@ class cl_builder(color_print): if len(distros) == 1: newprofile = distros[0] newprofile = newprofile or "" - reProfile = re.compile('(^|/)%s(/|$)'%newprofile.strip('/'),re.S) + # if $ at end of newprofile then it be at end of profile name + if newprofile.endswith("$"): + newprofile = newprofile[:-1] + reProfile = re.compile('(^|/)%s$'% + "/([^/]+/)*".join(newprofile.strip('/').split('/')),re.S|re.I) + else: + reProfile = re.compile('(^|/)%s(/|$)'% + "/([^/]+/)*".join(newprofile.strip('/').split('/')),re.S|re.I) likeProfile = filter(reProfile.search, self.clVars.Get('cl_builder_distro')) if len(likeProfile) != 1: