Commit Graph

151 Commits

Author SHA1 Message Date
Leonid Pliushch
acd44693df termux-tools: add one line padding to the end of MOTD 2020-10-04 19:40:38 +03:00
Leonid Pliushch
83e3020a2c termux-tools: add manual page for Termux app
An offline compilation of important information from the
Termux Wiki.
2020-10-02 21:32:06 +03:00
Leonid Pliushch
46425818bc termux-tools: avoid duplicate slashes in URLs when checking mirror availability
Really this is not an issue, but double slashes make logs looking a bit weird:

... "HEAD //dists/stable/Release HTTP/1.1" ...
2020-08-11 20:42:17 +03:00
Leonid Pliushch
fc0e77edb2 termux-tools: fix typo in pkg 2020-08-04 01:39:52 +03:00
Leonid Pliushch
578f66a5e3 termux-tools: use 5 seconds connection timeout when testing mirror availability 2020-08-02 01:50:34 +03:00
Leonid Pliushch
22a4bf8cfe termux-tools: use weight-based mirror selection (#5628)
* Weight-based mirror selection: do not give each mirror same usage ratio as hosts have different properties.
* Rotate mirrors after 6h: pkg now checks usability of all mirrors before selecting one, this takes time but we may want to reduce delays before the actual `apt` operation will be started.
* Update apt cache after 20min: reduce amount of necessary package list queries. We even can go with 1h, but since we prefer origin repository over mirrors as download source, 20 minutes should be fine.
2020-08-01 20:25:19 +03:00
Leonid Pliushch
0c682b3cd6 termux-tools: improve usage info for pkg
* Avoid long lines.
* Add missing info for some commands.
* Do not show deb cache size if its size cannot be determined, for example if cache dir was deleted.
2020-08-01 02:49:07 +03:00
buttaface
4801874eb6 termux-tools: add 'pkg autoclean' and command descriptions to help (#5627) 2020-08-01 15:21:10 +03:00
Leonid Pliushch
9c1635f1c3 termux-tools: fix path to pkgcache.bin after apt update, add support for pkg clean 2020-07-31 19:31:42 +03:00
Leonid Pliushch
c30de5e30b termux-tools: use https://termux.org/packages/ as fallback instead of direct Bintray URL 2020-07-31 14:29:31 +03:00
Leonid Pliushch
713c7160fc termux-tools: automatically pick a mirror by pkg (#5621)
See https://github.com/termux/termux-packages/issues/5620.

Implements automatic mirror selection:
* Pick a random URL of top 4 mirrors of Termux main repository and use it during 30 minutes limit, then rotate to a new one. Distribute traffic accross multiple mirrors, including origin Bintray repository.
* During 30 minutes limit, let `pkg` to check whether mirror is accessible on each run. If mirror is not accessible, use a new one. Mirrors are not guaranteed to be 100% accessible, so let pkg to check which one is working before using `apt`.
* Skip rotating if using `.cn` mirrors - Chinese users will not want to use something else due to great firewall and download speed issues.
2020-07-31 14:18:43 +03:00
Leonid Pliushch
23eee5f7cb termux-tools: add '-Xusejit:true' to dalvikvm 2020-07-26 14:08:52 +03:00
Leonid Pliushch
d5b4dddff0 termux-tools: termux-reset: ensure that $PREFIX is RWX before deleting
Set RWX permissions recursively on $PREFIX before deleting it. This
is needed to ensure that all files and directories can be deleted
by `rm`.

However this may not work if permissions were messed up with root.
2020-07-21 16:01:45 +03:00
Leonid Pliushch
3f081dd19e termux-tools: do not mkdir $PREFIX/bin/applets 2020-07-09 00:59:24 +03:00
Leonid Pliushch
f7216d85b8 termux-tools: bump revision 2020-07-01 14:49:59 +03:00
Henrik Grimler
d25ef2c156 termux-tools: add cmd wrapper as well
See https://github.com/termux/termux-api/issues/354.
2020-07-01 12:37:34 +02:00
Leonid Pliushch
3998a1692b termux-tools: add BFSU mirrors 2020-06-21 22:21:14 +03:00
Leonid Pliushch
0ce19ca522 termux-tools: remove check for /system/bin/killall
/system/bin/killall should be present on all devices running Android 7.0+.
2020-06-07 21:01:12 +03:00
Henrik Grimler
cc79632785 termux-tools: minor grammatical changes 2020-06-07 19:55:26 +02:00
Leonid Pliushch
aa225b374d termux-tools: fix message typo in termux-reset 2020-06-07 20:40:53 +03:00
Leonid Pliushch
b9a86e7836 termux-tools: add script for resetting Termux installation (#5377) 2020-06-07 20:05:11 +03:00
Leonid Pliushch
f8f367cfc3 termux-tools: bump revision 2020-06-01 20:28:17 +03:00
Leonid Pliushch
00545cf7b9 termux-tools: fix message in termux-setup-storage 2020-06-01 20:27:14 +03:00
Leonid Pliushch
ad8fa679cb termux-tools: ask user for confirmation before recreating ~/storage directory
Notify user about potential data loss if files were placed to
the root of ~/storage directory during execution of termux-setup-storage.
2020-06-01 20:23:30 +03:00
Leonid Pliushch
1fa297a587 termux-tools: update mirror list for termux-change-repo 2020-04-19 23:05:34 +03:00
Leonid Pliushch
3d371241d1 termux-tools: depend on util-linux and bump revision 2020-03-30 15:19:14 +03:00
Leonid Pliushch
df1c86646f termux-tools: use getopt from util-linux 2020-03-30 15:18:06 +03:00
Leonid Pliushch
6fb2bb2fbf termux-tools: avoid busybox usage 2020-03-30 15:15:59 +03:00
Leonid Pliushch
846ed3a780 chmod 755 termux-change-repo 2020-03-30 15:13:47 +03:00
Leonid Pliushch
cf701debba termux-tools: fix repo component names for "x11" & "unstable" 2020-03-29 21:30:25 +03:00
Henrik Grimler
c2dc8dfe5c termux-tools: remove backticks 2020-03-29 20:30:10 +02:00
Henrik Grimler
e15f8c42be termux-tools: fix copy-paste error in x11-packages url
Also run apt update after changing repositories
2020-03-29 20:26:30 +02:00
Henrik Grimler
9415f71929 termux-tools: add termux-change-repo script (#5069)
* termux-tools: add termux-change-repo script

Simplifies changing repositories to a mirror, useful when Bintray downloads hit the roof

* *-repo: add etc/apt/sources.list.d/* to TERMUX_PKG_CONFFILES
2020-03-24 07:14:42 +01:00
Leonid Pliushch
dc14c12940 apt: prevent usage of certain commands as root
Usage of package manager as root has certain bad effects in Termux such as
messed up SELinux contexts and ownership. Root checks done in 'pkg' wrapper
are not reliable because one can execute 'apt' directly or with third-party
script downloaded from the Internet.

This commit adds user id check and if it found that uid is 0, apt will
refuse to do any work in root session. These checks done in such way so
they cannot be bypassed in any way unless command is executed as non-root
user.

Those who use Termux via ADB root shell should be able to switch to Termux
user id with command 'su' in order to have package manager working.

---

This change also affects the 'termux-info' utility:

 * It will no longer use 'apt policy' to detect subscribed repositories. Each
   source will be checked by script manually.

 * Information will be copied to clipboard only if 'termux-api' is installed.

 * Syntax error in timeout command is fixed: 'timeout' doesn't understand the
   argument '-t'.

 * Minor information entries reordering.
2019-11-13 16:38:40 +02:00
Efreak
63733da336 Don't run apt update if it's been run recently (#4135)
When installing or searching for packages, the `apt update` will run only if it
was not executed within the last 5 minutes. Command `pkg upgrade` will
always execute `apt update` to ensure that latest package versions were
picked during upgrade.
2019-11-10 16:29:05 +02:00
Fredrik Fornwall
8bb0f44ad7 termux-tools: bump version 2019-10-06 10:00:12 +02:00
Fredrik Fornwall
8223845be1 termux-tools: Add /sbin to su path (fixes #4345) 2019-10-06 01:26:36 +02:00
Leonid Pliushch
f72f7bec3b termux-tools: bump version 2019-09-20 00:17:45 +03:00
Leonid Pliushch
ccb9ab922a termux-tools: use @TERMUX_PREFIX@ instead of path in sources
Ensure that scripts always use correct prefix-specific path.
2019-09-20 00:16:26 +03:00
Leonid Pliushch
51cdbe0073 termux-tools: use default shebang in sources
This will allow build system to set shebang according to the
current TERMUX_PREFIX.
2019-09-19 23:41:31 +03:00
Leonid Pliushch
4d3a6658d4 termux-tools: do not print motd on OpenSSH login when config PrintMotd=no
Now OpenSSH will not print motd on its own which may result in duplicate.
Instead it will control the login script via environment variable.

Fixes https://github.com/termux/termux-packages/issues/3941.
2019-09-06 01:59:07 +03:00
Leonid Pliushch
8701462951 add new linter script & fix packages where needed
Linter will check packages submitted for CI build. If error was found,
build will not be allowed.

To ensure that all build.sh scripts are consistent and have at least
minimal allowed quality, linter is permanently enabled for all branches
and pull requests.
2019-08-14 14:27:55 +03:00
Leonid Pliushch
c352216c63 packages: standardize values of several control variables for build.sh
Variables

 TERMUX_PKG_PLATFORM_INDEPENDENT
 TERMUX_DEBUG
 TERMUX_PKG_HAS_DEBUG
 TERMUX_PKG_ESSENTIAL
 TERMUX_SUBPKG_ESSENTIAL
 TERMUX_PKG_NO_STATICSPLIT
 TERMUX_PKG_BUILD_IN_SRC
 TERMUX_PKG_FORCE_CMAKE
 TERMUX_PKG_HOSTBUILD

should not accept arbitrary values for marking them "enabled". Instead
they should accept boolean values which makes them easier to handle and
also makes their meaning clear.

build-package.sh should make decision based on variable's value but not on
whether it is set or empty.

%ci:no-build
2019-08-12 18:49:13 +03:00
Leonid Pliushch
b563281d63 undo "Unsplit essential packages"
Seems it is not possible to unsplit these packages currently.

%ci:reset-backlog
2019-08-11 19:44:55 +03:00
Leonid Pliushch
eefe9fbe26 xz-utils: unsplit from liblzma
Same reason as for curl and bzip2.
2019-08-11 17:40:39 +03:00
Leonid Pliushch
864a138534 unsplit bzip2 from libbz2
Same reason as for 'curl'.
2019-08-11 17:40:39 +03:00
Leonid Pliushch
f9b5f96b5a libcurl: unsplit 'curl' subpackage
Both packages are essential and expect to be in bootstrap installation so
splitting is quite useless here.
2019-08-11 17:40:39 +03:00
Leonid Pliushch
e37b3fd5c4 termux-tools: add core packages to dependencies
Some packages are not getting installed after busybox was replaced by separate
packages. This commit should fix that by specifying core packages as dependencies
of the "termux-tools".
2019-08-05 13:46:51 +03:00
Leonid Pliushch
026ebfd1c1 termux-exec should be a dependency of termux-tools
Because it is used by login script and termux-tools is essential anyway.
2019-07-22 02:05:02 +03:00
Leonid Pliushch
4832078d86 reformat build.sh for some packages
* Packages where dependencies were sorted are bumped.
2019-07-22 01:51:28 +03:00