Implemented telmich's suggestions
Using $($__explorer/os), command -v directly Fix spacing Fix copyright year
This commit is contained in:
		
					parent
					
						
							
								37a8b4af2b
							
						
					
				
			
			
				commit
				
					
						6eff4bb898
					
				
			
		
					 4 changed files with 19 additions and 26 deletions
				
			
		| 
						 | 
				
			
			@ -21,13 +21,7 @@
 | 
			
		|||
# Retrieve the status of a package - parsed dpkg output
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# Can't access $__global/explorer/os from here, so recreate the functionality
 | 
			
		||||
#   because there's no point in executing this explorer on non-FreeBSD targets.
 | 
			
		||||
if [ $(uname) = "FreeBSD" ]; then
 | 
			
		||||
   if command -v pkg >&-; then
 | 
			
		||||
      printf "pkg-ng installed"
 | 
			
		||||
   else
 | 
			
		||||
      printf "pkg-ng not found"
 | 
			
		||||
   fi
 | 
			
		||||
if [ "$($__explorer/os)" = "freebsd" ]; then
 | 
			
		||||
   command -v pkg
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,8 +34,7 @@ else
 | 
			
		|||
         archlinux) type="pacman" ;;
 | 
			
		||||
         debian|ubuntu) type="apt" ;;
 | 
			
		||||
         freebsd)
 | 
			
		||||
            exists="$(cat "$__object/explorer/pkgng_exists")"
 | 
			
		||||
            if [ "$exists" = "pkg-ng installed" ]; then
 | 
			
		||||
            if [ -n "$(cat "$__object/explorer/pkgng_exists")" ]; then
 | 
			
		||||
               type="pkgng_freebsd"
 | 
			
		||||
            else
 | 
			
		||||
               type="pkg_freebsd"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# 2012 Jake Guffey (jake.guffey at eprotex.com)
 | 
			
		||||
# 2014 Jake Guffey (jake.guffey at eprotex.com)
 | 
			
		||||
#
 | 
			
		||||
# This file is part of cdist.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# 2012 Jake Guffey (jake.guffey at eprotex.com)
 | 
			
		||||
# 2014 Jake Guffey (jake.guffey at eprotex.com)
 | 
			
		||||
#
 | 
			
		||||
# This file is part of cdist.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue