termux / proot-distro

An utility for managing installations of the Linux distributions in Termux.
GNU General Public License v3.0
1.8k stars 208 forks source link

[Feature]: show distribution package size in the pd ls #449

Closed jerrychan7 closed 1 month ago

jerrychan7 commented 2 months ago

Feature description

Can the package size be shown when listing distribution (pd ls)? I use a metered network and showing the size would help me choose between different distributions.

Perhaps, going a step further, could the ls command list all supported CPU architectures rather than just a general comment?

Like this:

> pd ls

Supported distributions:

  * Alpine Linux

    Alias: alpine
    Installed: yes/no
    Comment: Rolling release branch (edge).
    Supported Arch:
        - aarch64 (2.61MB)
        - arm (2.49MB)
        - i686 (2.75 MB)
        - x86_64 (2.82 MB)
...
  * Ubuntu (24.04)

    Alias: ubuntu
    Installed: yes/no
    Comment: LTS release (noble). Not available for x86 32-bit (i686) CPUs.
    Supported Arch: aarch64 (23.8 MB), arm (23.5 MB), x86_64 (25.7 MB)
...
Biswa96 commented 2 months ago

You can see the file size in release page https://github.com/termux/proot-distro/releases. Alpine is the smallest one.

sylirre commented 2 months ago

Can the package size be shown when listing distribution (pd ls)?

This was requested previously but will not be implemented. Proot Distro supposed to not query remotes while listing the distributions.

could the ls command list all supported CPU architectures rather than just a general comment?

Can be added.

Biswa96 commented 2 months ago

Please add those extra info under --verbose option or something similar. pd ls already shows ton of information.

jerrychan7 commented 1 month ago

@sylirre This was requested previously but will not be implemented. Proot Distro supposed to not query remotes while listing the distributions.

Can we learn from the system package manager and only pull down the latest size after a command like pd ls --update?

@Biswa96 You can see the file size in release page https://github.com/termux/proot-distro/releases.

I know I can find it here, and that's where the data in my examples comes from. But is there any place that gives me an overview of all the package sizes, rather than manually looking for them one by one?

@Biswa96 Please add those extra info under --verbose option or something similar. pd ls already shows ton of information.

As an idea, is it possible to consider a progressive display? Considering that users are not interested in all systems, they will only pay attention to the systems they are familiar with, so information about other systems is useless to them. For example, pd ls only shows the most minimal information, ps ls --verbose to list all, and pd ls <alias> shows more detailed information for some distributions:

> pd ls

Supported distributions, in format DistributionName <alias>:

  * Alpine Linux <alpine>
    Installed alias:
      - alpine
      - alpine-test
  * Arch Linux <archlinux>
  * Artix Linux <artix>
  * Debian (bookworm) <debian>
  * Debian (bullseye) <debian-oldstable>
  * deepin <deepin>
  * Fedora <fedora>
  * Manjaro <manjaro>
  * OpenKylin <openkylin>
  * OpenSUSE <opensuse>
  * Pardus <pardus>
  * Ubuntu (24.04) <ubuntu>
    Installed alias:
      - ubuntu
      - ubuntu24
  * Ubuntu (22.04) <ubuntu-oldlts>
  * Void Linux <void>

Install selected one with: proot-distro install <alias>

> pd ls ubuntu

Supported distributions:

 * Ubuntu (24.04)

    Alias: ubuntu
    Installed: yes/no
    Comment: LTS release (noble). Not available for x86 32-bit (i686) CPUs.
    Supported Arch:
        - aarch64 (23.8 MB)
        - arm (23.5 MB)
        - x86_64 (25.7 MB)

  * Ubuntu (22.04)

    Alias: ubuntu-oldlts
    Installed: yes/no
    Comment: Previous LTS release (jammy). Not available for x86 32-bit (i686) CPUs.
    Supported Arch:
        - aarch64 (24 MB)
        - arm (23.8 MB)
        - x86_64 (26 MB)

Install selected one with: proot-distro install <alias>
sylirre commented 1 month ago

Can we learn from the system package manager and only pull down the latest size after a command like pd ls --update?

I think you misunderstand how things work.

proot-distro has nothing to do with system package manager at all.

It gets information from *.sh files in $PREFIX/etc/proot-distro. These files are called "distribution plugins" and define information such as Name, Comment, URL, SHA-256. An example is given in repository README file. They are like configuration files.

The configuration files are not supposed to be information source of file size or something like.

But is there any place that gives me an overview of all the package sizes

There is only one place: GitHub Releases page.

and pd ls shows more detailed information for some distributions

Alias is unique and matches the single distribution only. Basically it is a name of distribution plugin file excluding the extension ($PREFIX/etc/proot-distro/<ALIAS>.sh).

pd ls ubuntu will show only information from $PREFIX/etc/proot-distro/ubuntu.sh. It won't read definitions for other Ubuntu versions.

Minimized format for pd ls and full for pd ls --verbose can be implemented.

sylirre commented 1 month ago

Changes that going to be added into v4.17.0:

proot-distro list:

Screenshot_20240930-010303_Termux

proot-distro list --verbose:

Screenshot_20240930-010335_Termux