aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.58k stars 375 forks source link

How can i filter out multiple packages? #1176

Open virtualdreams opened 1 year ago

virtualdreams commented 1 year ago

Version: 1.5.0

I want to filter out some packages of an mirror. But it is impossible get a result.

What i have tried:

Not working

./aptly -config aptly.conf mirror edit -filter="!python3-impacket"  debian-bookworm-main
./aptly -config aptly.conf mirror edit -filter="!python3-impacket | !ettercap-common"  debian-bookworm-main
./aptly -config aptly.conf mirror edit -filter="python3-impacket | ettercap-common"  debian-bookworm-main
./aptly -config aptly.conf mirror edit -filter="python3-impacket, ettercap-common"  debian-bookworm-main
./aptly -config aptly.conf mirror edit -filter="!Name (python3-impacket) | !Name (ettercap-common)"  debian-bookworm-main

Working

./aptly -config aptly.conf mirror edit -filter '!Name (% ettercap-*)' debian-bookworm-main

But this not

./aptly -config aptly.conf mirror edit -filter '!Name (% ettercap-common*)' debian-bookworm-main

What's wrong with this software?

The help for package queries (https://www.aptly.info/doc/feature/query/) is a massive fuck up!

Whether the filter works or not, it keeps trying to download the files. But this is denied by the proxy, because the files supposedly contain a virus. Unfortunately, I cannot whitelist the files in question. Mirror Update is considered incomplete in any case.

neolynx commented 1 month ago

H @virtualdreams,

thanks for reporting!

You can mayube use regex: "! Name (~ .*py.*)". Something like this should work for you case. You might also wanna try latest CI Build, as 1.5.0 is a bit older and many bugs have been fied. See https://github.com/aptly-dev/aptly/discussions/1345.

Agree, the documentation could be better, this software needs more contributions also in documentation.

BearKiss commented 1 month ago

If the numer of packages is not too much, then

-filter='! ( thispackage | thatpackage | anotherpackage )'

virtualdreams commented 1 month ago

Thank you all, i will try that.