mirror of
				https://github.com/kewlfft/ansible-aur.git
				synced 2025-11-04 10:02:30 +03:00 
			
		
		
		
	improved verbose messages
verbose messages are visible only if -v is used
This commit is contained in:
		
							
								
								
									
										12
									
								
								aur.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								aur.py
									
									
									
									
									
								
							@@ -87,7 +87,7 @@ def upgrade(module, use):
 | 
				
			|||||||
    module.exit_json(
 | 
					    module.exit_json(
 | 
				
			||||||
        changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
 | 
					        changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
 | 
				
			||||||
        msg='upgraded system',
 | 
					        msg='upgraded system',
 | 
				
			||||||
        helper_used=use,
 | 
					        helper=use,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -105,12 +105,18 @@ def install_packages(module, packages, use, skip_installed):
 | 
				
			|||||||
            rc, out, err = install_with_makepkg(module, package)
 | 
					            rc, out, err = install_with_makepkg(module, package)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            rc, out, err = module.run_command(def_lang + use_cmd[use] + [package], check_rc=True)
 | 
					            rc, out, err = module.run_command(def_lang + use_cmd[use] + [package], check_rc=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out)
 | 
					        changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if changed_iter:
 | 
				
			||||||
 | 
					        message = 'installed package(s)'
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        message = 'package(s) already installed'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    module.exit_json(
 | 
					    module.exit_json(
 | 
				
			||||||
        changed=changed_iter,
 | 
					        changed=changed_iter,
 | 
				
			||||||
        msg='installed package' if not rc else err,
 | 
					        msg=message if not rc else err,
 | 
				
			||||||
        helper_used=use,
 | 
					        helper=use,
 | 
				
			||||||
        rc=rc,
 | 
					        rc=rc,
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user