Merge branch 'planetlab/master'
authorS.Çağlar Onur <caglar@verivue.com>
Mon, 11 Jul 2011 02:15:55 +0000 (22:15 -0400)
committerS.Çağlar Onur <caglar@verivue.com>
Mon, 11 Jul 2011 02:15:55 +0000 (22:15 -0400)
Conflicts:
coblitz-latest-tags.mk

1  2 
coblitz-latest-tags.mk
module-tools.py

diff --combined coblitz-latest-tags.mk
@@@ -1,15 -1,15 +1,15 @@@
  # build-GITPATH is now set by vbuild-nightly.sh to avoid duplication
  
 -mkinitrd-GITPATH              := git://git.verivue.com/planetlab/mkinitrd.git@mkinitrd-5.1.19.6-3
 +mkinitrd-GITPATH              := git://git.verivue.com/planetlab/mkinitrd.git@mkinitrd-5.1.19.6-4
  linux-2.6-BRANCH                := rhel6
  linux-2.6-GITPATH               := git://git.verivue.com/planetlab/linux-2.6.git@linux-2.6-32-16
- util-vserver-GITPATH            := git://git.verivue.com/planetlab/util-vserver.git@util-vserver-0.30.216-16
+ util-vserver-GITPATH            := git://git.verivue.com/planetlab/util-vserver.git@util-vserver-0.30.216-17
  util-vserver-BUILD-FROM-SRPM  := yes     # tmp
- util-vserver-pl-GITPATH         := git://git.verivue.com/planetlab/util-vserver-pl.git@util-vserver-pl-0.4-25
+ util-vserver-pl-GITPATH         := git://git.verivue.com/planetlab/util-vserver-pl.git@util-vserver-pl-0.4-26
  libnl-GITPATH                 := git://git.verivue.com/planetlab/libnl.git@libnl-1.1-2
- nodeupdate-GITPATH            := git://git.verivue.com/planetlab/nodeupdate.git@nodeupdate-0.5-8
+ nodeupdate-GITPATH            := git://git.verivue.com/planetlab/nodeupdate.git@nodeupdate-0.5-9
  nodemanager-GITPATH           := git://git.verivue.com/planetlab/nodemanager@nodemanager-1.8-38
 -pyplnet-GITPATH                 := git://git.verivue.com/planetlab/pyplnet@pyplnet-4.3-12
 +pyplnet-GITPATH                 := git://git.verivue.com/planetlab/pyplnet@pyplnet-4.3-14
  codemux-GITPATH                 := git://git.verivue.com/planetlab/codemux.git@CoDemux-0.1-13
  iptables-BUILD-FROM-SRPM        := yes # tmp
  iptables-GITPATH                := git://git.verivue.com/planetlab/iptables.git@iptables-1.4.10-4
@@@ -17,14 -17,14 +17,14 @@@ iproute-BUILD-FROM-SRPM         := yes 
  iproute2-GITPATH                := git://git.verivue.com/planetlab/iproute2.git@iproute2-2.6.35-0
  inotify-tools-GITPATH         := git://git.verivue.com/planetlab/inotify-tools.git@inotify-tools-3.13-2
  vsys-GITPATH                    := git://git.verivue.com/planetlab/vsys.git@vsys-0.99-1
- vsys-scripts-GITPATH            := git://git.verivue.com/planetlab/vsys-scripts.git@vsys-scripts-0.95-28
+ vsys-scripts-GITPATH            := git://git.verivue.com/planetlab/vsys-scripts.git@vsys-scripts-0.95-29
  plcapi-GITPATH                        := git://git.verivue.com/planetlab/plcapi@plcapi-4.3-38
  drupal-GITPATH                        := git://git.verivue.com/planetlab/drupal.git@drupal-4.7-14
  plewww-GITPATH                  := git://git.verivue.com/planetlab/plewww@PLEWWW-4.3-53
  pcucontrol-GITPATH              := git://git.verivue.com/planetlab/pcucontrol.git@pcucontrol-1.0-10
  nodeconfig-GITPATH              := git://git.verivue.com/planetlab/nodeconfig.git@nodeconfig-4.3-10
  bootmanager-BRANCH            := 4.3
 -bootmanager-GITPATH           := git://git.verivue.com/planetlab/bootmanager@bootmanager-4.3-28
 +bootmanager-GITPATH           := git://git.verivue.com/planetlab/bootmanager@bootmanager-4.3-30
  pypcilib-GITPATH                := git://git.verivue.com/planetlab/pypcilib.git@pypcilib-0.2-10
  bootcd-GITPATH                  := git://git.verivue.com/planetlab/bootcd.git@bootcd-4.2-25
  vserver-reference-GITPATH     := git://git.verivue.com/planetlab/vserver-reference@vserver-reference-4.2-18
diff --combined module-tools.py
@@@ -22,20 -22,7 +22,20 @@@ RENAMED_SVN_MODULES = 
      "CoDemux": "codemux",
      "NodeManager": "nodemanager",
      "NodeUpdate": "nodeupdate",
 -    "Monitor": "monitor"
 +    "Monitor": "monitor",
 +
 +    #we keep planetlab modules in a sub-directory
 +    "planetlab/PLEWWW": "planetlab/plewww",
 +    "planetlab/PLCAPI": "planetlab/plcapi",
 +    "planetlab/BootManager": "planetlab/bootmanager",
 +    "planetlab/BootCD": "planetlab/bootcd",
 +    "planetlab/VserverReference": "planetlab/vserver-reference",
 +    "planetlab/BootstrapFS": "planetlab/bootstrapfs",
 +    "planetlab/MyPLC": "planetlab/myplc",
 +    "planetlab/CoDemux": "planetlab/codemux",
 +    "planetlab/NodeManager": "planetlab/nodemanager",
 +    "planetlab/NodeUpdate": "planetlab/nodeupdate"
 +
      }
  
  def svn_to_git_name(module):
@@@ -186,7 -173,7 +186,7 @@@ class SvnRepository
          for line in out.split('\n'):
              if line.startswith("Repository Root:"):
                  root = line.split()[2].strip()
 -                return "%s/%s" % (root, self.name())
 +                return "%s/%s" % (root, self.pathname())
  
      @classmethod
      def checkout(cls, remote, local, options, recursive=False):
@@@ -279,7 -266,7 +279,7 @@@ class GitRepository
      def gitweb(self):
          c = Command("git show | grep commit | awk '{print $2;}'", self.options)
          out = self.__run_in_repo(c.output_of).strip()
 -        return "http://git.onelab.eu/?p=%s.git;a=commit;h=%s" % (self.name(), out)
 +        return "http://git.onelab.eu/?p=%s.git;a=commit;h=%s" % (self.pathname(), out)
  
      def repo_root(self):
          c = Command("git remote show origin", self.options)
@@@ -458,9 -445,9 +458,9 @@@ class Module
                  cls.prompt_config_option(key, message, default)
  
      # for parsing module spec name:branch
 -    matcher_branch_spec=re.compile("\A(?P<name>[\w\.-]+):(?P<branch>[\w\.-]+)\Z")
 +    matcher_branch_spec=re.compile("\A(?P<name>[\w\.-\/]+):(?P<branch>[\w\.-]+)\Z")
      # special form for tagged module - for Build
 -    matcher_tag_spec=re.compile("\A(?P<name>[\w\.-]+)@(?P<tagname>[\w\.-]+)\Z")
 +    matcher_tag_spec=re.compile("\A(?P<name>[\w\.-\/]+)@(?P<tagname>[\w\.-]+)\Z")
      # parsing specfiles
      matcher_rpm_define=re.compile("%(define|global)\s+(\S+)\s+(\S*)\s*")
  
  
      def __init__ (self,module_spec,options):
          # parse module spec
 -        self.name, branch_or_tagname, module_type = self.parse_module_spec(module_spec)
 +        self.pathname, branch_or_tagname, module_type = self.parse_module_spec(module_spec)
 +        self.name = os.path.basename(self.pathname)
  
          if module_type == "branch":
              self.branch=branch_or_tagname
          self.name = svn_to_git_name(self.name)
  
          self.options=options
 -        self.module_dir="%s/%s"%(options.workdir,self.name)
 +        self.module_dir="%s/%s"%(options.workdir,self.pathname)
          self.repository = None
          self.build = None
  
  
      def friendly_name (self):
          if hasattr(self,'branch'):
 -            return "%s:%s"%(self.name,self.branch)
 +            return "%s:%s"%(self.pathname,self.branch)
          elif hasattr(self,'tagname'):
 -            return "%s@%s"%(self.name,self.tagname)
 +            return "%s@%s"%(self.pathname,self.tagname)
          else:
 -            return self.name
 +            return self.pathname
  
      @classmethod
      def git_remote_dir (cls, name):
@@@ -592,10 -578,6 +592,10 @@@ that for other purposes than tagging""
                  Module.config[key]=value                
              f.close()
  
 +            # owerride config variables using options.
 +            if options.build_module:
 +                Module.config['build'] = options.build_module
 +
          if not os.path.isdir (options.workdir):
              print "Cannot find",options.workdir,"let's create it"
              Command("mkdir -p %s" % options.workdir, options).run_silent()
              print 'Checking for',self.module_dir
  
          if not os.path.isdir (self.module_dir):
 -            if Repository.has_moved_to_git(self.name, Module.config):
 -                self.repository = GitRepository.checkout(self.git_remote_dir(self.name),
 +            if Repository.has_moved_to_git(self.pathname, Module.config):
 +                self.repository = GitRepository.checkout(self.git_remote_dir(self.pathname),
                                                           self.module_dir,
                                                           self.options)
              else:
          self.repository = Repository(self.module_dir, self.options)
          if self.repository.type == "svn":
              # check if module has moved to git    
 -            if Repository.has_moved_to_git(self.name, Module.config):
 +            if Repository.has_moved_to_git(self.pathname, Module.config):
                  Command("rm -rf %s" % self.module_dir, self.options).run_silent()
                  self.init_module_dir()
              # check if we have the required branch/tag
  
          if level2:
              return level2[0]
 -        raise Exception, 'Cannot guess specfile for module %s -- patterns were %s or %s'%(self.name,pattern1,pattern2)
 +        raise Exception, 'Cannot guess specfile for module %s -- patterns were %s or %s'%(self.pathname,pattern1,pattern2)
  
      def all_specnames (self):
          level1=glob("%s/*.spec" % self.module_dir)
          # brute-force : change uncommented lines that define <module>-SVNPATH
          else:
              if self.options.verbose:
 -                print 'Searching for -SVNPATH or -GITPATH lines referring to /%s/\n\tin %s .. '%(self.name,tagsfile),
 +                print 'Searching for -SVNPATH or -GITPATH lines referring to /%s/\n\tin %s .. '%(self.pathname,tagsfile),
              pattern="\A\s*%s-(SVNPATH|GITPATH)\s*(=|:=)\s*(?P<url_main>[^\s]+)/%s[^\s]+"\
                                            %(self.name,self.name)
              matcher_module=re.compile(pattern)
                  if attempt:
                      if line.find("-GITPATH") >= 0:
                          modulepath = "%s-GITPATH"%self.name
 -                        replacement = "%-32s:= %s/%s.git@%s\n"%(modulepath,attempt.group('url_main'),self.name,newname)
 +                        replacement = "%-32s:= %s/%s.git@%s\n"%(modulepath,attempt.group('url_main'),self.pathname,newname)
                      else:
                          modulepath = "%s-SVNPATH"%self.name
                          replacement = "%-32s:= %s/%s/tags/%s\n"%(modulepath,attempt.group('url_main'),self.name,newname)
          # checking for diffs
          diff_output = self.repository.diff_with_tag(old_tag_name)
          if len(diff_output) == 0:
 -            if not prompt ("No pending difference in module %s, want to tag anyway"%self.name,False):
 +            if not prompt ("No pending difference in module %s, want to tag anyway"%self.pathname,False):
                  return
  
          # side effect in trunk's specfile
@@@ -1005,7 -987,7 +1005,7 @@@ Please write a changelog for this new t
          if not build.is_clean():
              build.revert()
  
-         tagsfiles=glob(build.path+"/*-tags*.mk")
+         tagsfiles=glob(build.path+"/*-tags.mk")
          tagsdict=dict( [ (x,'todo') for x in tagsfiles ] )
          default_answer = 'y'
          tagsfiles.sort()
@@@ -1112,7 -1094,7 +1112,7 @@@ n: move to next file"""%locals(
  
          if self.options.list:
              if diff_output:
 -                print self.name
 +                print self.pathname
          else:
              thename=self.friendly_name()
              do_print=False
@@@ -1398,7 -1380,7 +1398,7 @@@ Branches
          'version' : "check latest specfile and print out details",
          'diff' : "show difference between module (trunk or branch) and latest tag",
          'tag'  : """increment taglevel in specfile, insert changelog in specfile,
-                 create new tag and and monitor its adoption in build/*-tags*.mk""",
+                 create new tag and and monitor its adoption in build/*-tags.mk""",
          'branch' : """create a branch for this module, from the latest tag on the trunk, 
                    and change trunk's version number to reflect the new branch name;
                    you can specify the new branch name by using module:branch""",
  ** THIS MUST NOT ** be your usual working directory""")
          parser.add_option("-F","--fast-checks",action="store_true",dest="fast_checks",default=False,
                            help="skip safety checks, such as svn updates -- use with care")
 +        parser.add_option("-B","--build-module",action="store",dest="build_module",default=None,
 +                          help="specify a build module to owerride the one in the CONFIG")
  
          # default verbosity depending on function - temp
          verbose_modes= ['tag', 'sync', 'branch']