Browse Source

termux-tools: Add a 'packages' utility

android-5
Fredrik Fornwall 8 years ago
parent
commit
d6df138bb1
  1. 2
      packages/termux-tools/build.sh
  2. 8
      packages/termux-tools/motd
  3. 36
      packages/termux-tools/packages

2
packages/termux-tools/build.sh

@ -18,7 +18,7 @@ termux_step_make_install () {
chmod +x $TERMUX_PREFIX/bin/$tool chmod +x $TERMUX_PREFIX/bin/$tool
done 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 perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm
cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd

8
packages/termux-tools/motd

@ -6,9 +6,9 @@ IRC channel: #termux on freenode
Gitter chat: https://gitter.im/termux/termux Gitter chat: https://gitter.im/termux/termux
Mailing list: termux+subscribe@groups.io Mailing list: termux+subscribe@groups.io
Search packages: termux search <query> Search packages: packages search <query>
Install a package: termux install <package> Install a package: packages install <package>
Upgrade packages: termux upgrade Upgrade packages: packages upgrade
Learn more: termux help Learn more: packages help
Run 'touch ~/.hushlogin' to get rid of this login message. Run 'touch ~/.hushlogin' to get rid of this login message.

36
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 <packages-to-install>'
echo ' list-all'
echo ' list-installed'
echo ' reinstall <packages-to-reinstall>'
echo ' search <query>'
echo ' show <packages-to-show>'
echo ' uninstall <packages-to-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
Loading…
Cancel
Save