AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

arch: AVAILABLE_ARCH support #84

Closed MingcongBai closed 8 years ago

MingcongBai commented 8 years ago

Proposing support for listing on what arch the package will build, and those not on the list will not. For example:

AVAILABLE_ARCH="amd64"

Then, when running with ARCH=amd64, the build goes on as usual. If running on ARCH=armel, then...

[ERROR] Specified package cannot be built on arch: armel.

When AVAILABLE_ARCH is left blank, then all architectures are free to build this package.

Artoria2e5 commented 8 years ago

Added a blacklist scheme.

# foo/defines
arch_exclude 'arm*'
MingcongBai commented 8 years ago

Can this still be factor'd into a variable? That would really make life easier...

Artoria2e5 commented 8 years ago

Ugh, why a variable…

MingcongBai commented 8 years ago

Ugh, why a variable…

Imagine out of nowhere comes a scheme-like command...

Artoria2e5 commented 8 years ago

Hmm…… I can move this to defines actually.

With a single extglob… Right.

Artoria2e5 commented 8 years ago

But still I have to say I prefer blacklisting so…

MingcongBai commented 8 years ago

Well simply assume whenever a file is sourced with extglob...

MingcongBai commented 8 years ago

But still I have to say I prefer blacklisting so…

Fine by me.

Artoria2e5 commented 8 years ago

With the negate glob operator, you can do something like !(amd64|armel).

MingcongBai commented 8 years ago

Why would I want that...?

Artoria2e5 commented 8 years ago

Because not(not(amd64 or armel)) is amd64 or armel, and that's what available means.

MingcongBai commented 8 years ago

(God... I am always mixing this up with "given that") Don't mind me.