mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	Use libarchive instead of the Python implementation
This commit is contained in:
		
							parent
							
								
									e85573d0e1
								
							
						
					
					
						commit
						86beac22e2
					
				
					 2 changed files with 14 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -105,7 +105,7 @@ ubuntu_xenial_pip:
 | 
			
		|||
  only:
 | 
			
		||||
    - master@fdroid/fdroidserver
 | 
			
		||||
  script:
 | 
			
		||||
    - apt-get install git default-jdk-headless python3-pip python3-venv rsync zipalign
 | 
			
		||||
    - apt-get install git default-jdk-headless python3-pip python3-venv rsync zipalign libarchive13
 | 
			
		||||
    - rm -rf env
 | 
			
		||||
    - pyvenv env
 | 
			
		||||
    - . env/bin/activate
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -430,13 +430,19 @@ class LibvirtBuildVm(FDroidBuildVm):
 | 
			
		|||
                  end""".format_map({'memory': str(int(domainInfo[1] / 1024)), 'cpus': str(domainInfo[3])}))
 | 
			
		||||
            with open('Vagrantfile', 'w') as fp:
 | 
			
		||||
                fp.write(vagrantfile)
 | 
			
		||||
            with tarfile.open(output, 'w:gz') as tar:
 | 
			
		||||
                logging.debug('adding metadata.json to box %s ...', output)
 | 
			
		||||
                tar.add('metadata.json')
 | 
			
		||||
                logging.debug('adding Vagrantfile to box %s ...', output)
 | 
			
		||||
                tar.add('Vagrantfile')
 | 
			
		||||
                logging.debug('adding box.img to box %s ...', output)
 | 
			
		||||
                tar.add('box.img')
 | 
			
		||||
            try:
 | 
			
		||||
                import libarchive
 | 
			
		||||
                with libarchive.file_writer(output, 'gnutar', 'gzip') as tar:
 | 
			
		||||
                    logging.debug('adding files to box %s ...', output)
 | 
			
		||||
                    tar.add_files('metadata.json', 'Vagrantfile', 'box.img')
 | 
			
		||||
            except (ModuleNotFoundError, AttributeError):
 | 
			
		||||
                with tarfile.open(output, 'w:gz') as tar:
 | 
			
		||||
                    logging.debug('adding metadata.json to box %s ...', output)
 | 
			
		||||
                    tar.add('metadata.json')
 | 
			
		||||
                    logging.debug('adding Vagrantfile to box %s ...', output)
 | 
			
		||||
                    tar.add('Vagrantfile')
 | 
			
		||||
                    logging.debug('adding box.img to box %s ...', output)
 | 
			
		||||
                    tar.add('box.img')
 | 
			
		||||
 | 
			
		||||
            if not keep_box_file:
 | 
			
		||||
                logging.debug('box packaging complete, removing temporary files.')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue