-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathau
More file actions
executable file
·16 lines (16 loc) · 1.72 KB
/
au
File metadata and controls
executable file
·16 lines (16 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env sh
# Copyright 2017-2022 (c) all rights reserved by SDRausty, please see LICENSE.
# https://sdrausty.github.io/au Contributors: Glow/frumpylava, Hax4us
# In order to save native space on device the path /storage/emulated/0/Android/data/com.termux/txdebs can be changed to a microSDcard destination.
# dpkg --purge name.pkg ; dpkg --install name.pkg # can downgrade packages
################################################################################
set -eu
_AUDIR_ () { [ -e /storage/emulated/0/Android/data/com.termux/txdebs ] || { cd /storage/emulated/0/Android/data/com.termux/ && mkdir -p txdebs ; } || _PRIT_ printf '%s' "Please create directory '/storage/emulated/0/Android/data/com.termux/' in Android. If an external micro sdcard is being used, '/storage/1234-5678/Android/{data,media}/com.termux/' can be used after modifying the path in the ${0##*/} command; " ; }
# update, upgrade and then install packages if any or print message
_AUGET_ () { { apt update && apt -o APT::Keep-Downloaded-Packages="true" upgrade -y && apt -o APT::Keep-Downloaded-Packages="true" install "$@" -y && find /data/data/com.termux/cache/apt/archives/ -maxdepth 1 -type f -name "*.deb" -exec mv -f {} /storage/emulated/0/Android/data/com.termux/txdebs/ \; ; } || printf "\\n%s\\n\\n" "Something unexpected occured; Please study the first lines of the error output, and run ${0##*/} again to install and auto update packages!" ; }
_PD_ () { _PRNT_ "Command '${0##*/}': DONE" ; }
_PRIT_ () { printf "%s" "$1" ; } # print message with no trialing newline
_PRNT_ () { printf "%s\\n" "$1" ; } # print message with one trialing newline
_PB_ () { _PRNT_ "Command '${0##*/}': BEGUN... " ; }
_PB_ && _AUDIR_ && _AUGET_ "$@" && _PD_
# SDRausty/au FE