diff --git a/packages/termux-tools/build.sh b/packages/termux-tools/build.sh index 63e22eded..76cf395c4 100644 --- a/packages/termux-tools/build.sh +++ b/packages/termux-tools/build.sh @@ -18,7 +18,7 @@ termux_step_make_install () { chmod +x $TERMUX_PREFIX/bin/$tool done - cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock} $TERMUX_PREFIX/bin/ + cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock,login,packages} $TERMUX_PREFIX/bin/ perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd diff --git a/packages/termux-tools/motd b/packages/termux-tools/motd index 78e920722..ffd5541a7 100644 --- a/packages/termux-tools/motd +++ b/packages/termux-tools/motd @@ -6,9 +6,9 @@ IRC channel: #termux on freenode Gitter chat: https://gitter.im/termux/termux Mailing list: termux+subscribe@groups.io -Search packages: termux search -Install a package: termux install -Upgrade packages: termux upgrade -Learn more: termux help +Search packages: packages search +Install a package: packages install +Upgrade packages: packages upgrade +Learn more: packages help Run 'touch ~/.hushlogin' to get rid of this login message. diff --git a/packages/termux-tools/packages b/packages/termux-tools/packages new file mode 100755 index 000000000..b76c62665 --- /dev/null +++ b/packages/termux-tools/packages @@ -0,0 +1,36 @@ +#!/data/data/com.termux/files/usr/bin/sh +set -e -u + +show_help() { + echo 'Usage: packages command [arguments]' + echo '' + echo 'A tool for managing packages. Commands:' + echo '' + echo ' install ' + echo ' list-all' + echo ' list-installed' + echo ' reinstall ' + echo ' search ' + echo ' show ' + echo ' uninstall ' + echo ' upgrade' + exit 1 +} + +if [ $# = 0 ]; then show_help; fi +CMD="$1" +shift 1 + +case "$CMD" in + help) show_help;; + install) apt update; apt install $@;; + list-all) apt list $@;; + list-installed) apt list --installed $@;; + reinstall) apt install --reinstall $@;; + search) apt update; apt search $@;; + show) apt show $@;; + uninstall|remove) apt remove $@;; + update|upgrade) apt update; apt full-upgrade;; + *) echo "Unknown command: '$CMD' (run 'packages help' for usage information)";; +esac +