if os.path.isfile (attempt):
return attempt
else:
+ pattern="%s/*.spec"%self.edge_dir()
try:
- return glob("%s/*.spec"%self.edge_dir())[0]
+ return glob(pattern)[0]
except:
- raise Exception, 'Cannot guess specfile for module %s'%self.name
+ raise Exception, 'Cannot guess specfile for module %s -- pattern was %s'%(self.name,pattern)
def all_specnames (self):
return glob("%s/*.spec"%self.edge_dir())
def unignored_lines (self, logfile):
result=[]
- exclude="Tagging module %s"%self.name
+ exclude="Setting tag %s"%self.name
white_line_matcher = re.compile("\A\s*\Z")
for logline in file(logfile).readlines():
if logline.strip() == Module.svn_magic_line:
# brute-force : change uncommented lines that define <module>-SVNPATH
else:
if self.options.verbose:
- print 'Setting %s-SVNPATH for using %s\n\tin %s .. '%(self.name,newname,tagsfile),
- pattern="\A\s*%s-SVNPATH\s*(=|:=)\s*(?P<url_main>[^\s]+)/%s/[^\s]+"\
- %(self.name,self.name)
+ print 'Searching for -SVNPATH lines referring to /%s/\n\tin %s .. '%(self.name,tagsfile),
+ pattern="\A\s*(?P<make_name>[^\s]+)-SVNPATH\s*(=|:=)\s*(?P<url_main>[^\s]+)/%s/[^\s]+"\
+ %(self.name)
matcher_module=re.compile(pattern)
for line in tags.readlines():
attempt=matcher_module.match(line)
if attempt:
- svnpath="%s-SVNPATH"%self.name
+ svnpath="%s-SVNPATH"%(attempt.group('make_name'))
+ if self.options.verbose:
+ print ' '+svnpath,
replacement = "%-32s:= %s/%s/tags/%s\n"%(svnpath,attempt.group('url_main'),self.name,newname)
new.write(replacement)
matches += 1
# so we can provide useful information, such as version numbers and diff
# in the same file
changelog="/tmp/%s-%d.txt"%(self.name,os.getpid())
- file(changelog,"w").write("""Tagging module %s - %s
+ file(changelog,"w").write("""Setting tag %s
%s
Please write a changelog for this new tag in the section above
-"""%(self.name,new_tag_name,Module.svn_magic_line))
+"""%(new_tag_name,Module.svn_magic_line))
if not self.options.verbose or prompt('Want to see diffs while writing changelog',True):
file(changelog,"a").write('DIFF=========\n' + diff_output)