mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	Make removal of obsolete source packages configurable
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									fe7cc466e1
								
							
						
					
					
						commit
						e5e6d7e5b7
					
				
							
								
								
									
										35
									
								
								britney.py
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								britney.py
									
									
									
									
									
								
							@ -2733,23 +2733,24 @@ class Britney(object):
 | 
			
		||||
        # run the auto hinter
 | 
			
		||||
        self.auto_hinter()
 | 
			
		||||
 | 
			
		||||
        # obsolete source packages
 | 
			
		||||
        # a package is obsolete if none of the binary packages in testing
 | 
			
		||||
        # are built by it
 | 
			
		||||
        self.log("> Removing obsolete source packages from testing", type="I")
 | 
			
		||||
        # local copies for performance
 | 
			
		||||
        sources = self.sources['testing']
 | 
			
		||||
        binaries = self.binaries['testing']
 | 
			
		||||
        used = set(binaries[arch][0][binary].source
 | 
			
		||||
                     for arch in binaries
 | 
			
		||||
                     for binary in binaries[arch][0]
 | 
			
		||||
                  )
 | 
			
		||||
        removals = [ MigrationItem("-%s/%s" % (source, sources[source].version))
 | 
			
		||||
                     for source in sources if source not in used
 | 
			
		||||
                   ]
 | 
			
		||||
        if len(removals) > 0:
 | 
			
		||||
            self.output_write("Removing obsolete source packages from testing (%d):\n" % (len(removals)))
 | 
			
		||||
            self.do_all(actions=removals)
 | 
			
		||||
        if getattr(self.options, "remove_obsolete", "yes") == "yes":
 | 
			
		||||
            # obsolete source packages
 | 
			
		||||
            # a package is obsolete if none of the binary packages in testing
 | 
			
		||||
            # are built by it
 | 
			
		||||
            self.log("> Removing obsolete source packages from testing", type="I")
 | 
			
		||||
            # local copies for performance
 | 
			
		||||
            sources = self.sources['testing']
 | 
			
		||||
            binaries = self.binaries['testing']
 | 
			
		||||
            used = set(binaries[arch][0][binary].source
 | 
			
		||||
                         for arch in binaries
 | 
			
		||||
                         for binary in binaries[arch][0]
 | 
			
		||||
                      )
 | 
			
		||||
            removals = [ MigrationItem("-%s/%s" % (source, sources[source].version))
 | 
			
		||||
                         for source in sources if source not in used
 | 
			
		||||
                       ]
 | 
			
		||||
            if removals:
 | 
			
		||||
                self.output_write("Removing obsolete source packages from testing (%d):\n" % (len(removals)))
 | 
			
		||||
                self.do_all(actions=removals)
 | 
			
		||||
 | 
			
		||||
        # smooth updates
 | 
			
		||||
        removals = old_libraries(self.sources, self.binaries, self.options.outofsync_arches)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user