mirror of
				https://github.com/dockersrc/alpine
				synced 2025-11-04 07:02:11 -05:00 
			
		
		
		
	🗃️ Committing everything that changed 🗃️
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				alpine-3-14 / alpine-3-14 (push) Failing after 5m17s
				
			
		
			
				
	
				alpine-3-15 / alpine-3-15 (push) Failing after 8m11s
				
			
		
			
				
	
				alpine-3-16 / alpine-3-16 (push) Failing after 5m38s
				
			
		
			
				
	
				alpine-3-17 / alpine-3-17 (push) Failing after 2m45s
				
			
		
			
				
	
				alpine-3-18 / alpine-3-18 (push) Failing after 5m15s
				
			
		
			
				
	
				alpine-3-19 / alpine-3-19 (push) Failing after 6m26s
				
			
		
			
				
	
				alpine-3-20 / alpine-3-20 (push) Failing after 5m53s
				
			
		
			
				
	
				alpine-3-21 / alpine-3-20 (push) Failing after 5m54s
				
			
		
			
				
	
				alpine-edge / alpine-edge (push) Failing after 8m35s
				
			
		
			
				
	
				alpine-latest / alpine-latest (push) Failing after 8m13s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	alpine-3-14 / alpine-3-14 (push) Failing after 5m17s
				
			alpine-3-15 / alpine-3-15 (push) Failing after 8m11s
				
			alpine-3-16 / alpine-3-16 (push) Failing after 5m38s
				
			alpine-3-17 / alpine-3-17 (push) Failing after 2m45s
				
			alpine-3-18 / alpine-3-18 (push) Failing after 5m15s
				
			alpine-3-19 / alpine-3-19 (push) Failing after 6m26s
				
			alpine-3-20 / alpine-3-20 (push) Failing after 5m53s
				
			alpine-3-21 / alpine-3-20 (push) Failing after 5m54s
				
			alpine-edge / alpine-edge (push) Failing after 8m35s
				
			alpine-latest / alpine-latest (push) Failing after 8m13s
				
			rootfs/usr/local/bin/pkmgr
This commit is contained in:
		@@ -1,17 +1,10 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
# shellcheck shell=bash
 | 
			
		||||
#!/usr/bin/env sh
 | 
			
		||||
# shellcheck shell=sh
 | 
			
		||||
# shellcheck disable=SC2016
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
[ -n "$_DEBUG" ] && _DEBUG_OPTIONS="-x"
 | 
			
		||||
[ "$1" = "--debug" ] && _DEBUG_OPTIONS="-x" && shift 1
 | 
			
		||||
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS
 | 
			
		||||
set -e $_DEBUG_OPTIONS
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
USER_UID="$(id -u)"
 | 
			
		||||
USER_GID="$(id -g)"
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
[ -f "/etc/pkmgr/options.conf" ] && . "/etc/pkmgr/options.conf"
 | 
			
		||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
if [ -x "$(command -v apt 2>/dev/null)" ]; then
 | 
			
		||||
  export DEBIAN_FRONTEND=noninteractive
 | 
			
		||||
  pkmgr_cmd="apt"
 | 
			
		||||
@@ -19,6 +12,7 @@ if [ -x "$(command -v apt 2>/dev/null)" ]; then
 | 
			
		||||
  pkmgr_mkcache_cmd="$pkmgr_cmd update"
 | 
			
		||||
  pkmgr_update_cmd="$pkmgr_cmd upgrade -yy"
 | 
			
		||||
  pkmgr_install_cmd="$pkmgr_cmd install -yy $PKMGR_OPTS"
 | 
			
		||||
  pkmgr_install_post="$pkmgr_cmd --fix-broken install"
 | 
			
		||||
elif [ -x "$(command -v apt-get 2>/dev/null)" ]; then
 | 
			
		||||
  export DEBIAN_FRONTEND=noninteractive
 | 
			
		||||
  pkmgr_cmd="apt-get"
 | 
			
		||||
@@ -26,6 +20,7 @@ elif [ -x "$(command -v apt-get 2>/dev/null)" ]; then
 | 
			
		||||
  pkmgr_mkcache_cmd="$pkmgr_cmd update"
 | 
			
		||||
  pkmgr_update_cmd="$pkmgr_cmd upgrade -yy"
 | 
			
		||||
  pkmgr_install_cmd="$pkmgr_cmd install -yy $PKMGR_OPTS"
 | 
			
		||||
  pkmgr_install_post="$pkmgr_cmd --fix-broken install"
 | 
			
		||||
elif [ -x "$(command -v dnf 2>/dev/null)" ]; then
 | 
			
		||||
  pkmgr_cmd="dnf"
 | 
			
		||||
  pkmgr_clean_cmd="$pkmgr_cmd clean all"
 | 
			
		||||
@@ -90,13 +85,34 @@ pip)
 | 
			
		||||
  case "$1" in
 | 
			
		||||
  install)
 | 
			
		||||
    shift 1
 | 
			
		||||
    $pip_bin -m $pip_opts "$@"
 | 
			
		||||
    pkg_list="$*"
 | 
			
		||||
    for pkg in $pkg_list; do
 | 
			
		||||
      $pip_bin -m pip $pip_opts "$pkg"
 | 
			
		||||
    done
 | 
			
		||||
    ;;
 | 
			
		||||
  *)
 | 
			
		||||
    $pip_bin "$@"
 | 
			
		||||
    for pkg in "$@"; do
 | 
			
		||||
      $pip_bin -m pip "$pkg"
 | 
			
		||||
    done
 | 
			
		||||
    ;;
 | 
			
		||||
  esac
 | 
			
		||||
  exit $?
 | 
			
		||||
  exit
 | 
			
		||||
  ;;
 | 
			
		||||
install)
 | 
			
		||||
  shift 1
 | 
			
		||||
  [ -n "$1" ] || exit 0
 | 
			
		||||
  [ "$USER_UID" -eq 0 ] || [ "$USER" = "root" ] || pkmgr_install_cmd="sudo $pkmgr_install_cmd"
 | 
			
		||||
  if [ -f "$1" ]; then
 | 
			
		||||
    install_list="$(cat "$1")"
 | 
			
		||||
  else
 | 
			
		||||
    install_list="$*"
 | 
			
		||||
  fi
 | 
			
		||||
  for pkg in $install_list; do
 | 
			
		||||
    echo "installing packages command: $pkmgr_install_cmd $pkg"
 | 
			
		||||
    $pkmgr_install_cmd $pkg
 | 
			
		||||
    [ -n "$pkmgr_install_post" ] && eval $pkmgr_install_post
 | 
			
		||||
  done
 | 
			
		||||
  exit
 | 
			
		||||
  ;;
 | 
			
		||||
update | upgrade)
 | 
			
		||||
  shift $#
 | 
			
		||||
@@ -114,20 +130,6 @@ clean)
 | 
			
		||||
  $pkmgr_clean_cmd
 | 
			
		||||
  exit $?
 | 
			
		||||
  ;;
 | 
			
		||||
install)
 | 
			
		||||
  shift 1
 | 
			
		||||
  [ -n "$1" ] || exit 0
 | 
			
		||||
  [ "$USER_UID" -eq 0 ] || [ "$USER" = "root" ] || pkmgr_install_cmd="sudo $pkmgr_install_cmd"
 | 
			
		||||
  if [ -f "$1" ]; then
 | 
			
		||||
    install_list="$(cat "$1")"
 | 
			
		||||
    echo 'installing packages from file with command: '$pkmgr_install_cmd' "$(<"$1")"'
 | 
			
		||||
  else
 | 
			
		||||
    install_list="$*"
 | 
			
		||||
    echo "installing packages command: $pkmgr_install_cmd $install_list"
 | 
			
		||||
  fi
 | 
			
		||||
  $pkmgr_install_cmd $install_list
 | 
			
		||||
  exit $?
 | 
			
		||||
  ;;
 | 
			
		||||
*)
 | 
			
		||||
  [ -n "$1" ] || exit 0
 | 
			
		||||
  [ "$USER_UID" -eq 0 ] || [ "$USER" = "root" ] || pkmgr_cmd="sudo $pkmgr_cmd"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user