Skip to content

Getting termux-tools ready for apt 3.0.0 #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TomJo2000
Copy link
Member

Apt 3.0.0 makes the "multiline" deb822 format the standard for package sources.
This PR aims to introduce support for this repo source format in termux-tools.

This initial commit only adds support in pkg.
I plan to add support in termux-info tomorrow, however that turned into half a refactor and I'm tired.


The changes to pkg introduce two possible return values from has_repo.

  • deb822, the new standard format (determined by the .sources file extension)
  • legacy, the old oneline format (determined by the .list file extension)
    Support for the legacy oneline .list format isn't slated to be removed until 20291,
    so it is kept for backwards compatibility in the meantime.
  • An empty return string ("") indicates that the repo is not present in either format.

I also fixed a couple shellcheck warnings and some indentation.
I may do a more extensive refactor of pkg as part of this PR later.

Footnotes

  1. https://man.archlinux.org/man/sources.list.5#ONE-LINE-STYLE_FORMAT

@robertkirkman
Copy link

I tested this, and I think it is working for me. There is something strange-looking about the indentation in some places, but I think you might already have noticed, and will be able to resolve that.

@TomJo2000
Copy link
Member Author

There is something strange-looking about the indentation in some places, but I think you might already have noticed, and will be able to resolve that.

Haven't noticed anything of the sort.
There's some over-indenting from conditionals that could be turned into guard clauses, but the indentation as is seems correct to me.
If you have any specific examples please do point them out.

@robertkirkman
Copy link

@TomJo2000
Copy link
Member Author

That part was already lined up with the line above, it just used spaces instead of tabs for indentation, which doesn't match the rest of the script.

@robertkirkman
Copy link

yes I understand that, but all I am trying to explain is that it is no longer "lined up" after this. This is how it looks on my screen.

image

@TomJo2000
Copy link
Member Author

Looks fine on my device.
image
Probably an issue with your set tapstop?

@TomJo2000 TomJo2000 force-pushed the migrate-to-deb822-format branch from 924edb6 to 8caa682 Compare April 24, 2025 18:23
@TomJo2000
Copy link
Member Author

There's snapped it back to 3 tabs.

@robertkirkman
Copy link

The problem is also visible in your screenshot, but then you fixed it in a force push so I guess you are now able to see the problem with how it was before

@TomJo2000
Copy link
Member Author

The problem is also visible in your screenshot

Then I'm not seeing what you meant.

@robertkirkman
Copy link

image

I screenshotted your screenshot and drew a line on it, in my opinion the line should be straight BUT it is ok and does not matter very much because:

  • it is purely whitespace-related and does not affect the script operation at all
  • you already fixed it by force pushing a commit which makes the line straight

@TomJo2000
Copy link
Member Author

It was aligned with un*|rem*|rm|del*, so I kept it aligned that way when I fixed the indentation from spaces to tabs.
But yeah it should just be straight.

@robertkirkman
Copy link

On my screen, the current change does not change the straight shape of the "line", but this discrepancy can come as a side effect of the different settings of tab width for each user, like you mentioned.

image

@TomJo2000
Copy link
Member Author

Just finished testing the termux-info changes.
The new version does away with the previous special casing for the sources.list file outside the sources.list.d directory by consolidating the find into a for loop, glob and case for classification instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants