- raise Exception, 'Something is wrong with module %s, cannot determine %s - exiting'%(self.name,err)
-
- def tag_url (self, spec_dict):
- return "%s/tags/%s"%(self.mod_url(),self.tag_name(spec_dict))
-
- def check_svnpath_exists (self, url, message):
- if self.options.fast_checks:
- return
- if self.options.verbose:
- print 'Checking url (%s) %s'%(url,message),
- ok=Svnpath(url,self.options).url_exists()
- if ok:
- if self.options.verbose: print 'exists - OK'
- else:
- if self.options.verbose: print 'KO'
- raise Exception, 'Could not find %s URL %s'%(message,url)
-
- def check_svnpath_not_exists (self, url, message):
- if self.options.fast_checks:
- return
- if self.options.verbose:
- print 'Checking url (%s) %s'%(url,message),
- ok=not Svnpath(url,self.options).url_exists()
- if ok:
- if self.options.verbose: print 'does not exist - OK'
- else:
- if self.options.verbose: print 'KO'
- raise Exception, '%s URL %s already exists - exiting'%(message,url)
-
- # locate specfile, parse it, check it and show values
-
-##############################
- def do_version (self):
- self.init_module_dir()
- self.init_edge_dir()
- self.revert_edge_dir()
- self.update_edge_dir()
- spec_dict = self.spec_dict()
- if self.options.www:
- self.html_store_title('Version for module %s (%s)' % (self.friendly_name(),self.last_tag(spec_dict)))
- for varname in self.varnames:
- if not spec_dict.has_key(varname):
- self.html_print ('Could not find %%define for %s'%varname)
- return
- else:
- self.html_print ("%-16s %s"%(varname,spec_dict[varname]))
- if self.options.show_urls:
- self.html_print ("%-16s %s"%('edge url',self.edge_url()))
- self.html_print ("%-16s %s"%('latest tag url',self.tag_url(spec_dict)))
- if self.options.verbose:
- self.html_print ("%-16s %s"%('main specfile:',self.main_specname()))
- self.html_print ("%-16s %s"%('specfiles:',self.all_specnames()))
- self.html_print_end()
-
-##############################
- def do_list (self):
-# print 'verbose',self.options.verbose
-# print 'list_tags',self.options.list_tags
-# print 'list_branches',self.options.list_branches
-# print 'all_modules',self.options.all_modules
-
- (verbose,branches,pattern,exact) = (self.options.verbose,self.options.list_branches,
- self.options.list_pattern,self.options.list_exact)
-
- extra_command=""
- extra_message=""
- if hasattr(self,'branch'):
- pattern=self.branch
- if pattern or exact:
- if exact:
- if verbose: grep="%s/$"%exact
- else: grep="^%s$"%exact
- else:
- grep=pattern
- extra_command=" | grep %s"%grep
- extra_message=" matching %s"%grep
-
- if not branches:
- message="==================== tags for %s"%self.friendly_name()
- command="svn list "
- if verbose: command+="--verbose "
- command += "%s/tags"%self.mod_url()
- command += extra_command
- message += extra_message
- if verbose: print message
- self.run(command)
-
- else:
- message="==================== branches for %s"%self.friendly_name()
- command="svn list "
- if verbose: command+="--verbose "
- command += "%s/branches"%self.mod_url()
- command += extra_command
- message += extra_message
- if verbose: print message
- self.run(command)
-
-##############################
- sync_warning="""*** WARNING
-The module-sync function has the following limitations
-* it does not handle changelogs
-* it does not scan the -tags*.mk files to adopt the new tags"""
-
- def do_sync(self):
- if self.options.verbose:
- print Module.sync_warning
- if not prompt('Want to proceed anyway'):
- return
-
- self.init_module_dir()
- self.init_edge_dir()
- self.revert_edge_dir()
- self.update_edge_dir()
- spec_dict = self.spec_dict()