Skip to content
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

Fixed command line options parsing #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SurinameClubcard
Copy link

@SurinameClubcard SurinameClubcard commented Aug 10, 2024

On LMDE6, I have backports configured. I noticed that apt -t bookworm-backports install qemu fails with a strange looking error:

root@lmde:~# apt -t bookworm-backports install qemu
Reading package lists... Done
E: The value 'qemu' is invalid for APT::Default-Release as such a release is not available in the sources

This boils down to how /usr/local/bin/apt is parsing command line options. In above example, that Python code makes a good effort in switching the -t with install but that leaves the system with apt install bookworm-backports -t qemu which ofc produces the same error. This PR implements a simple rotation that will keep putting options on the back of the arguments until finished.

Needless to say that apt install qemu -t bookworm-backports works already without this modification.

I did notice this:

root@lmde:~# /usr/local/bin/apt help install
"apt install " is equivalent to "/usr/bin/apt install"

So it could be by design. But in that case, just throw an error if the first argument is not a valid command?

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.

1 participant