[Artur Tulyulya] Also detect CRUX. fixes #1626
This commit is contained in:
		
							parent
							
								
									6c34669780
								
							
						
					
					
						commit
						a1b1538c54
					
				
					 1 changed files with 42 additions and 37 deletions
				
			
		|  | @ -74,6 +74,7 @@ distro_info = { | |||
| 	'Arch Linux': '/etc/arch-release', | ||||
| 	'Aurox Linux': '/etc/aurox-release', | ||||
| 	'Conectiva Linux': '/etc/conectiva-release', | ||||
| 	'CRUX': '/usr/bin/crux', | ||||
| 	'Debian GNU/Linux': '/etc/debian_release', | ||||
| 	'Debian GNU/Linux': '/etc/debian_version', | ||||
| 	'Fedora Linux': '/etc/fedora-release', | ||||
|  | @ -129,6 +130,10 @@ def get_os_info(): | |||
| 		for distro_name in distro_info: | ||||
| 			path_to_file = distro_info[distro_name] | ||||
| 			if os.path.exists(path_to_file): | ||||
| 				if os.access(path_to_file, os.X_OK): # is the file executable? | ||||
| 					# yes, then run it and get output. (CRUX ONLY ATM) | ||||
| 					text = helpers.get_output_of_command(path_to_file) | ||||
| 				else: | ||||
| 					fd = open(path_to_file) | ||||
| 					text = fd.readline().strip() # get only first line | ||||
| 					fd.close() | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue