Proposal: advanced grammar "not"

It would be nice for advanced grammar to support a “not” keyword to allow for doing things like this:

  - on not armhf to armhf: ["some-package:armhf"]
  - on not i386 to i386: ["some-package:i386"]
  - else: ["some-package"]

I don’t understand what you’re trying to achieve there :slight_smile: Negatives make this confusing.

“On non armhf systems, install an armhf package” “On non i386 systems, install an i386 packge”

Do you have a real-world example where this might be useful, which may explain it better?

Yeah, well basically the thought process is that if you are cross compiling then you have to specify the architecture of the package you want to use. Whereas if you are not cross compiling then you do not.

For example if you are coming for armhf on an armhf device you can install packages like,

apt-get install somepackage

But if you want to install the same package on an x86 host for the purposes of cross compiling then you need to specify the arch, otherwise you will get the package for the native arch.

apt-get install somepackage:armhf

If I wanted to express my example in the first post without the “not” keyword it would have to look something like this:

  - on amd64 to armhf: ["some-package:armhf"]
  - on i386 to armhf: ["some-package:armhf"]
  - on arm64 to armhf: ["some-package:armhf"]
  # ...and more entries "on xxx to armhf"
  - on arm to i386: ["some-package:i386"]
  # ...likewise, many more combinations
  - else: ["some-package"] # to cover native compilation. on amd64 to amd64, on armhf to armhf, etc.
1 Like

Can’t you use something like :

  -  to armhf: ["some-package:armhf"]
  -  to i386: ["some-package:i386"]

(note I haven’t tried this, so I don’t know if it works, but I think it should)

Oh, I realize now that it is unnecessary but it is okay to specify the architecture for a package for the native architecture.

My mistake, ignore this post.

1 Like