module-tag fixed for multi-package modules
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 15 Feb 2008 15:17:56 +0000 (15:17 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 15 Feb 2008 15:17:56 +0000 (15:17 +0000)
tags now use the svn module name rather than the rpm package name

module-tag.py
onelab-tags-4.2.mk
planetlab-tags-4.2.mk

index 7079eda..9a966db 100755 (executable)
@@ -100,7 +100,7 @@ class Module:
 
     svn_magic_line="--This line, and those below, will be ignored--"
     
-    redirectors=[ ('module_name_varname','name'),
+    redirectors=[ ('module_name_varname','name'),
                   ('module_version_varname','version'),
                   ('module_taglevel_varname','taglevel'), ]
 
@@ -218,7 +218,7 @@ that for other purposes than tagging"""%topdir
             print 'Updating',self.trunkdir
         self.run_fatal("svn update -N %s"%self.trunkdir)
 
-    def guess_specname (self):
+    def main_specname (self):
         attempt="%s/%s.spec"%(self.trunkdir,self.name)
         if os.path.isfile (attempt):
             return attempt
@@ -253,7 +253,7 @@ that for other purposes than tagging"""%topdir
     # stores in self.module_name_varname the rpm variable to be used for the module's name
     # and the list of these names in self.varnames
     def spec_dict (self):
-        specfile=self.guess_specname()
+        specfile=self.main_specname()
         redirector_keys = [ varname for (varname,default) in Module.redirectors]
         redirect_dict = self.parse_spec(specfile,redirector_keys)
         if self.options.debug:
@@ -332,7 +332,8 @@ that for other purposes than tagging"""%topdir
     def trunk_url (self):
         return "%s/%s/trunk"%(Module.config['svnpath'],self.name)
     def tag_name (self, spec_dict):
-        return "%s-%s-%s"%(spec_dict[self.module_name_varname],
+        return "%s-%s-%s"%(#spec_dict[self.module_name_varname],
+                           self.name,
                            spec_dict[self.module_version_varname],
                            spec_dict[self.module_taglevel_varname])
     def tag_url (self, spec_dict):
@@ -348,7 +349,7 @@ that for other purposes than tagging"""%topdir
         spec_dict = self.spec_dict()
         print 'trunk url',self.trunk_url()
         print 'latest tag url',self.tag_url(spec_dict)
-        print 'main specfile:',self.guess_specname()
+        print 'main specfile:',self.main_specname()
         print 'specfiles:',self.all_specnames()
         for varname in self.varnames:
             if not spec_dict.has_key(varname):
@@ -522,8 +523,9 @@ Please write a changelog for this new tag in the section above
 usage="""Usage: %prog options module1 [ .. modulen ]
 Purpose:
   manage subversion tags and specfile
-  requires the specfile to define name, version and taglevel
-  OR alternatively redirection variables like module_version_varname
+  requires the specfile to define version and taglevel
+  OR alternatively 
+  redirection variables module_version_varname / module_taglevel_varname
 """
 functions={ 
     'diff' : "show difference between trunk and latest tag",
@@ -575,7 +577,8 @@ def main():
                           help="just list modules that exhibit differences")
     parser.add_option("-w","--workdir", action="store", dest="workdir", 
                       default="%s/%s"%(os.getenv("HOME"),"modules"),
-                      help="name for workdir - defaults to ~/modules")
+                      help="""name for dedicated working dir - defaults to ~/modules
+** THIS MUST NOT ** be your usual working directory""")
     parser.add_option("-v","--verbose", action="store_true", dest="verbose", default=False, 
                       help="run in verbose mode")
     parser.add_option("-d","--debug", action="store_true", dest="debug", default=False, 
index 7376cb1..ae5a56c 100644 (file)
@@ -11,24 +11,24 @@ libnl-SVNPATH                       := http://svn.planet-lab.org/svn/libnl/tags/libnl-1.0-11
 util-vserver-SVNPATH           := http://svn.planet-lab.org/svn/util-vserver/branches/scholz
 util-vserver-pl-SVNPATH                := http://svn.planet-lab.org/svn/util-vserver-pl/tags/util-vserver-pl-0.1-1
 NodeUpdate-SVNPATH             := http://svn.planet-lab.org/svn/NodeUpdate/tags/NodeUpdate-0.5-2
-PingOfDeath-SVNPATH            := http://svn.planet-lab.org/svn/PingOfDeath/tags/ipod-2.2-1
+PingOfDeath-SVNPATH            := http://svn.planet-lab.org/svn/PingOfDeath/tags/PingOfDeath-2.2-1
 NodeManager-SVNPATH            := http://svn.planet-lab.org/svn/NodeManager/tags/NodeManager-1.7-2
 pl_sshd-SVNPATH                        := http://svn.planet-lab.org/svn/pl_sshd/tags/pl_sshd-1.0-10
 libhttpd++-SVNPATH             := http://svn.planet-lab.org/svn/libhttpd++/tags/libhttpd++-0.1.4-1
 proper-SVNPATH                 := http://svn.planet-lab.org/svn/proper/tags/proper-0.3-37
-CoDemux-SVNPATH                        := http://svn.planet-lab.org/svn/CoDemux/tags/codemux-0.1-7
+CoDemux-SVNPATH                        := http://svn.planet-lab.org/svn/CoDemux/tags/CoDemux-0.1-7
 ulogd-SVNPATH                  := http://svn.planet-lab.org/svn/ulogd/tags/ulogd-1.24-4
 fprobe-ulog-SVNPATH            := http://svn.planet-lab.org/svn/fprobe-ulog/tags/fprobe-ulog-1.1.2-1
-PlanetFlow-SVNPATH             := http://svn.planet-lab.org/svn/PlanetFlow/tags/netflow-4.0-2
-Mom-SVNPATH                    := http://svn.planet-lab.org/svn/Mom/tags/pl_mom-2.2-2
+PlanetFlow-SVNPATH             := http://svn.planet-lab.org/svn/PlanetFlow/tags/PlanetFlow-4.0-2
+Mom-SVNPATH                    := http://svn.planet-lab.org/svn/Mom/tags/Mom-2.2-2
 iptables-SVNPATH               := http://svn.planet-lab.org/svn/iptables/tags/iptables-1.3.8-0
-iproute2-SVNPATH               := http://svn.planet-lab.org/svn/iproute2/tags/iproute-2.6.16-1
+iproute2-SVNPATH               := http://svn.planet-lab.org/svn/iproute2/tags/iproute2-2.6.16-1
 vsys-SVNPATH                   := http://svn.planet-lab.org/svn/vsys/tags/vsys-0.7-2
 PLCAPI-SVNPATH                 := http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.2-3
 PLCWWW-SVNPATH                 := http://svn.one-lab.org/PLCWWW/tags/PLCWWW-4.2-7
-VserverReference-SVNPATH       := http://svn.planet-lab.org/svn/VserverReference/tags/vserver-4.2-2
-BootManager-SVNPATH            := http://svn.planet-lab.org/svn/BootManager/tags/bootmanager-3.2-4
+VserverReference-SVNPATH       := http://svn.planet-lab.org/svn/VserverReference/tags/VserverReference-4.2-2
+BootManager-SVNPATH            := http://svn.planet-lab.org/svn/BootManager/tags/BootManager-3.2-4
 pypcilib-SVNPATH               := http://svn.planet-lab.org/svn/pypcilib/tags/pypcilib-0.1-1
-BootCD-SVNPATH                 := http://svn.planet-lab.org/svn/BootCD/tags/bootcd-3.4-4
-BootstrapFS-SVNPATH            := http://svn.planet-lab.org/svn/BootstrapFS/tags/bootstrapfs-0.1-2
-MyPLC-SVNPATH                  := http://svn.planet-lab.org/svn/MyPLC/tags/myplc-4.2.2
+BootCD-SVNPATH                 := http://svn.planet-lab.org/svn/BootCD/tags/BootCD-3.4-4
+BootstrapFS-SVNPATH            := http://svn.planet-lab.org/svn/BootstrapFS/tags/BootstrapFS-0.1-2
+MyPLC-SVNPATH                  := http://svn.planet-lab.org/svn/MyPLC/tags/MyPLC-4.2.3
index c5f5aa4..30f9e37 100644 (file)
@@ -8,27 +8,27 @@ libnl-SVNPATH                         := http://svn.planet-lab.org/svn/libnl/tags/libnl-1.0-11
 util-vserver-SVNPATH           := http://svn.planet-lab.org/svn/util-vserver/branches/scholz
 util-vserver-pl-SVNPATH                := http://svn.planet-lab.org/svn/util-vserver-pl/tags/util-vserver-pl-0.1-1
 NodeUpdate-SVNPATH             := http://svn.planet-lab.org/svn/NodeUpdate/tags/NodeUpdate-0.5-2
-PingOfDeath-SVNPATH            := http://svn.planet-lab.org/svn/PingOfDeath/tags/ipod-2.2-1
+PingOfDeath-SVNPATH            := http://svn.planet-lab.org/svn/PingOfDeath/tags/PingOfDeath-2.2-1
 NodeManager-SVNPATH            := http://svn.planet-lab.org/svn/NodeManager/tags/NodeManager-1.7-2
 pl_sshd-SVNPATH                        := http://svn.planet-lab.org/svn/pl_sshd/tags/pl_sshd-1.0-10
 libhttpd++-SVNPATH             := http://svn.planet-lab.org/svn/libhttpd++/tags/libhttpd++-0.1.4-1
 proper-SVNPATH                 := http://svn.planet-lab.org/svn/proper/tags/proper-0.3-37
-CoDemux-SVNPATH                        := http://svn.planet-lab.org/svn/CoDemux/tags/codemux-0.1-7
+CoDemux-SVNPATH                        := http://svn.planet-lab.org/svn/CoDemux/tags/CoDemux-0.1-7
 ulogd-SVNPATH                  := http://svn.planet-lab.org/svn/ulogd/tags/ulogd-1.24-4
 fprobe-ulog-SVNPATH            := http://svn.planet-lab.org/svn/fprobe-ulog/tags/fprobe-ulog-1.1.2-1
-PlanetFlow-SVNPATH             := http://svn.planet-lab.org/svn/PlanetFlow/tags/netflow-4.0-2
-Mom-SVNPATH                    := http://svn.planet-lab.org/svn/Mom/tags/pl_mom-2.2-2
+PlanetFlow-SVNPATH             := http://svn.planet-lab.org/svn/PlanetFlow/tags/PlanetFlow-4.0-2
+Mom-SVNPATH                    := http://svn.planet-lab.org/svn/Mom/tags/Mom-2.2-2
 iptables-SVNPATH               := http://svn.planet-lab.org/svn/iptables/tags/iptables-1.3.8-0
-iproute2-SVNPATH               := http://svn.planet-lab.org/svn/iproute2/tags/iproute-2.6.16-1
+iproute2-SVNPATH               := http://svn.planet-lab.org/svn/iproute2/tags/iproute2-2.6.16-1
 vsys-SVNPATH                   := http://svn.planet-lab.org/svn/vsys/tags/vsys-0.7-2
 PLCAPI-SVNPATH                 := http://svn.planet-lab.org/svn/PLCAPI/tags/PLCAPI-4.2-3
 PLCWWW-SVNPATH                 := http://svn.planet-lab.org/svn/PLCWWW/tags/PLCWWW-4.1-2
-VserverReference-SVNPATH       := http://svn.planet-lab.org/svn/VserverReference/tags/vserver-4.2-2
-BootManager-SVNPATH            := http://svn.planet-lab.org/svn/BootManager/tags/bootmanager-3.2-4
+VserverReference-SVNPATH       := http://svn.planet-lab.org/svn/VserverReference/tags/VserverReference-4.2-2
+BootManager-SVNPATH            := http://svn.planet-lab.org/svn/BootManager/tags/BootManager-3.2-4
 pypcilib-SVNPATH               := http://svn.planet-lab.org/svn/pypcilib/tags/pypcilib-0.1-1
-BootCD-SVNPATH                 := http://svn.planet-lab.org/svn/BootCD/tags/bootcd-3.4-4
-BootstrapFS-SVNPATH            := http://svn.planet-lab.org/svn/BootstrapFS/tags/bootstrapfs-0.1-2
-MyPLC-SVNPATH                  := http://svn.planet-lab.org/svn/MyPLC/tags/myplc-4.2-3
+BootCD-SVNPATH                 := http://svn.planet-lab.org/svn/BootCD/tags/BootCD-3.4-4
+BootstrapFS-SVNPATH            := http://svn.planet-lab.org/svn/BootstrapFS/tags/BootstrapFS-0.1-2
+MyPLC-SVNPATH                  := http://svn.planet-lab.org/svn/MyPLC/tags/MyPLC-4.2-3
 
 #
 # unused so far