Check for RPM and DNF before using them
This allows dependencies to be automatically installed on Fedora, without causing problems on Debian.
This commit is contained in:
		
							parent
							
								
									5daa964b9c
								
							
						
					
					
						commit
						afbba5e552
					
				
							
								
								
									
										17
									
								
								run-tests
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								run-tests
									
									
									
									
									
								
							| @ -1,13 +1,16 @@ | |||||||
| #!/bin/bash -- | #!/bin/bash -- | ||||||
| 
 | 
 | ||||||
| set -eu | set -eu | ||||||
| unset applications do_install_deps CLEANUP_LVM name DEFAULT_LVM_POOL retcode | unset CLEANUP_LVM name DEFAULT_LVM_POOL retcode | ||||||
| applications=(lvm2 python3-inotify python3-sphinx python3-docutils | install_rpm_deps () { | ||||||
|     python3-pyyaml python3-jinja2 python3-lxml python3-pylint python3-coverage |     local applications | ||||||
|     btrfs-progs vim-common) |     applications=(lvm2 python3-inotify python3-sphinx python3-docutils | ||||||
| do_install_deps=false |         python3-pyyaml python3-jinja2 python3-lxml python3-pylint | ||||||
| rpm -q --quiet -- "${applications[@]}" || |         python3-coverage btrfs-progs vim-common) | ||||||
| sudo dnf -- install "${applications[@]}" |     rpm -q --quiet -- "${applications[@]}" || | ||||||
|  |     sudo dnf -- install "${applications[@]}" | ||||||
|  | } | ||||||
|  | if { command -pv rpm && command -pv dnf; }>/dev/null; then install_rpm_deps; fi | ||||||
| CLEANUP_LVM= | CLEANUP_LVM= | ||||||
| name=$(dirname "$0") | name=$(dirname "$0") | ||||||
| if sudo --non-interactive "$name/ci/lvm-manage" setup-lvm vg$$/pool; then | if sudo --non-interactive "$name/ci/lvm-manage" setup-lvm vg$$/pool; then | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Demi Marie Obenour
						Demi Marie Obenour