how to add requires from the same channel as current package?
See original GitHub issueHi,
sorry for may be stupid question, I’ve read docs and source code, but unfortunately I can’t understand how can I add requires from the same channel as current package.
let me explain. for instance, I currently have OpenSSL package, which depends on two other packages - nasm_installer & ActivePerl_installer. so I have the following code:
self.requires.add("ActivePerl_installer/5.24.0.2400@sse4/testing", private=True)
self.requires.add("nasm_installer/2.12.02@sse4/testing", private=True)
I have many other packaging with complex dependency hierarchy. so, once I decide to make new channel for well-tested and stable packages, I will probably end-up with patching lots of my receipts like this:
self.requires.add("ActivePerl_installer/5.24.0.2400@sse4/stable", private=True)
self.requires.add("nasm_installer/2.12.02@sse4/stable", private=True)
which is pretty boring and annoying. same situation if my college wants to fork package hierarchy and change to his username. ideally, I would want to write something like these:
self.requires.add("ActivePerl_installer/5.24.0.2400@%s/%s" % (self.username, self.channel), private=True)
self.requires.add("nasm_installer/2.12.02@%s/%s" % (self.username, self.channel), private=True)
therefore all packages in hierarchy are from the same channel. is it somehow possibly to do something like that? P.S. I’ve seen approach with environment variables, but it’s external to conanfile, but I want to get information from the current file, which is much more transparent and less error prone.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
@memsharded yes, requirements() method is perfect place to define requirements 😃 I’ll try your proposal tomorrow and let you know how does it work.
@memsharded I confirm your branch works as expected, thanks a lot for your effort!