~apt-fast/apt-fast/apt-fast-ro

« back to all changes in this revision

Viewing changes to apt-fast

  • Committer: Dominique Lasserre
  • Date: 2020-04-07 17:58:18 UTC
  • Revision ID: git-v1:0cba3336f61ddda2ad5c795b14e6d5548cb459a4
Default to last internal exit code on program exit. Closes #175

 * CLEANUP_STATE is only used when exiting from inside an execution path,
   for example if a check fails and the program cannot be recovered.
   It is not used for final executions, e.g. APTMGR installation invocation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
 
257
257
cleanup_aptfast()
258
258
{
259
 
  [ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$?
 
259
  local last_exit_code=$?
 
260
  [ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code
260
261
  cleanup_dllist
261
262
  _remove_lock
262
263
}
530
531
if echo "$http_proxy" | grep -q "^socks5h://" || echo "$https_proxy" | grep -q "^socks5h://"; then
531
532
  msg "Socks proxy detected. Falling back to ${_APTMGR}" "hint"
532
533
  "${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@"
533
 
  CLEANUP_STATE="$?"
534
534
  exit
535
535
fi
536
536
 
591
591
    [ -t 1 ] && tput el
592
592
  fi
593
593
 
 
594
  # different problem resolving for aptitude
594
595
  if [ -z "$DOWNLOAD_ONLY" ] || [ "$_APTMGR" == "aptitude" ]; then
595
596
    "${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@"
596
597
  fi
619
620
    eval "${_DOWNLOADER}"
620
621
  fi
621
622
 
 
623
  # different problem resolving for aptitude
622
624
  if [ "$_APTMGR" == "aptitude" ]; then
623
625
    "${_APTMGR}" "$@"
624
626
  fi
651
653
# Execute package manager directly if unknown options are passed.
652
654
else
653
655
  "${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@"
654
 
  CLEANUP_STATE=$?
655
656
fi
656
657
 
657
658
# After error or all done remove our lockfile (done with EXIT trap)