From 8970a83359e87cbf7d99c10e9a62c8dbe595675e Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Date: Thu, 9 Jul 2009 12:35:41 +0000
Subject: [PATCH] fix 'force' adoption when modulename != makename (e.g.
 geniwrapper & sfa)

---
 module-tools.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/module-tools.py b/module-tools.py
index 6ad1c59e..b9d0cb74 100755
--- a/module-tools.py
+++ b/module-tools.py
@@ -652,14 +652,16 @@ The module-sync function has the following limitations
         # 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
-- 
2.47.0