mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-03 18:14:11 +00:00 
			
		
		
		
	Make "approve" an alias for "unblock"
An "approve" hint is effectively an unblock for tpu packages and britney is already quiite happy to parse "unblock $pkg/$tpuversion". We allow the old name to be used for compatibility and replace it with "unblock" internally. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
		
							parent
							
								
									0497e95b71
								
							
						
					
					
						commit
						f7391fc335
					
				@ -831,6 +831,7 @@ class Britney(object):
 | 
				
			|||||||
                    # All current hints require at least one argument
 | 
					                    # All current hints require at least one argument
 | 
				
			||||||
                    self.__log("Malformed hint found in %s: '%s'" % (filename, line), type="W")
 | 
					                    self.__log("Malformed hint found in %s: '%s'" % (filename, line), type="W")
 | 
				
			||||||
                elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]:
 | 
					                elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]:
 | 
				
			||||||
 | 
					                    if l[0] == 'approve': l[0] = 'unblock'
 | 
				
			||||||
                    for package in l[1:]:
 | 
					                    for package in l[1:]:
 | 
				
			||||||
                        hints.add_hint('%s %s' % (l[0], package), who)
 | 
					                        hints.add_hint('%s %s' % (l[0], package), who)
 | 
				
			||||||
                elif l[0] in ["age-days"]:
 | 
					                elif l[0] in ["age-days"]:
 | 
				
			||||||
@ -1483,7 +1484,7 @@ class Britney(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # if the suite is *-proposed-updates, the package needs an explicit approval in order to go in
 | 
					        # if the suite is *-proposed-updates, the package needs an explicit approval in order to go in
 | 
				
			||||||
        if suite in ['tpu', 'pu']:
 | 
					        if suite in ['tpu', 'pu']:
 | 
				
			||||||
            approves = [ x for x in self.hints.search('approve', package=src) if self.same_source(source_u[VERSION], x.version) ]
 | 
					            approves = [ x for x in self.hints.search('unblock', package=src) if self.same_source(source_u[VERSION], x.version) ]
 | 
				
			||||||
            if approves:
 | 
					            if approves:
 | 
				
			||||||
                excuse.addhtml("Approved by %s" % approves[0].user)
 | 
					                excuse.addhtml("Approved by %s" % approves[0].user)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user