Ticket #72: force_installation.patch

File force_installation.patch, 2.3 kB (added by Hylk0r, 4 months ago)
  • share/apkg-defs

    old new  
    124124  -h, --help        Display this help screen 
    125125  -p, --prefix      Sets the prefix that the package will install to 
    126126  -t, --ttyfe       Forces the usage of the text based terminal frontend 
     127  --local-only      Force installation locally 
     128  --root-only       Force installation system-wide 
    127129" 
    128130 
    129131intl_UNSUPPORTED_CPU_ARCH=$"Sorry, this package is incompatible with your CPU architecture. 
  • share/apkg-funclib

    old new  
    13791379        # for the root password, because root will not be able to find the 
    13801380        # autopackage support libraries. 
    13811381 
    1382         if [[ `id -u` == 0 || ( ! -f /etc/autopackage/config && -f "${XDG_CONFIG_HOME:-$HOME/.config}/autopackage/config" ) || ("$autopackage_no_autosu" == "true" && "$1" != "--root-only") ]]; then 
     1382        if [[ `id -u` == 0 || $INSTALL_FORCE == 2 || ( ! -f /etc/autopackage/config && -f "${XDG_CONFIG_HOME:-$HOME/.config}/autopackage/config" ) || ("$autopackage_no_autosu" == "true" && "$1" != "--root-only") ]]; then 
    13831383                # Filter out autosu arguments 
    13841384                while [[ "${1:0:1}" == "-" ]]; do 
    13851385                        if [[ "$1" == '--root-only' ]]; then 
    13861386                                shift 
     1387                        elif [[ "$1" == '--local-only' ]]; then 
     1388                                shift 
    13871389                        elif [[ "$1" == '-m' ]]; then 
    13881390                                shift 
    13891391                                shift 
     
    15121514                        "-h" | "--help") shift; out "$intl_INSTALLER_HELP"; _installerFinish; exit 0;; 
    15131515                        "-g" | "--gtkfe") shift; export AUTOPACKAGE_FRONTEND="autopackage-frontend-gtk";; 
    15141516                        "-t" | "--ttyfe") shift; export AUTOPACKAGE_FRONTEND="apkg-ttyfe";; 
     1517                        "--local-only") shift; export INSTALL_FORCE=2;; # Force local installation 
     1518                        "--root-only") shift; export INSTALL_FORCE=1;; # Force system-wide installation 
    15151519                        *)  red; outn "$intl_FAIL"; normal; out "$intl_UNKNOWN_OPTION" "$1"; shift; 
    15161520                                shift; exit 1; 
    15171521                                ;; 
     
    22242228                export AUTOSU_DISPLAYNAME="$DISPLAYNAME" 
    22252229 
    22262230                # recurse 
    2227                 if [[ "$ROOTINSTALLONLY" == "Yes" ]]; then 
     2231                if [[ "$ROOTINSTALLONLY" == "Yes" || $INSTALL_FORCE == 1 ]]; then 
    22282232                        _autosuCommand --root-only "$_meta_dir/apkg-installer" "$@" 
    22292233                else 
    22302234                        _autosuCommand "$_meta_dir/apkg-installer" "$@"