Disable automatic detection of RPM dependencies from shebangs (for some files only?)
Hi all, TL;DR: Ist it possible to disable the automatic detection of RPM dependencies from shebangs? Maybe only for some files? Ansible is now including lots of collections, most of them are using a "#!/usr/bin/python" or "#!/usr/bin/python3" shebang. I modified the shebang for all of them to not have python2 as a dependency for the ansible package. Turns out, some of those python files in the collections need to have a python shebang (not python3), e.g. the zypper module. If I change that to python3, it does not work when managing SLES12 targets (as the python3 is too old on SLES12). But python2 is working for SLES12 targets. If I do not modify the shebang, the ansible package wants to install python2 as a dependency due to the automatic detection Can I override this? Can I somehow only ignore the dependency for python2 aka python? And leave all other dependency detections in place? Or maybe just ignore some files during dependency detection? Thanks in advance, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On Fri, Dec 16, 2022 at 12:45 PM Johannes Kastl <kastl@b1-systems.de> wrote:
Hi all,
TL;DR: Ist it possible to disable the automatic detection of RPM dependencies from shebangs? Maybe only for some files?
Ansible is now including lots of collections, most of them are using a "#!/usr/bin/python" or "#!/usr/bin/python3" shebang.
I modified the shebang for all of them to not have python2 as a dependency for the ansible package.
Turns out, some of those python files in the collections need to have a python shebang (not python3), e.g. the zypper module. If I change that to python3, it does not work when managing SLES12 targets (as the python3 is too old on SLES12). But python2 is working for SLES12 targets. If I do not modify the shebang, the ansible package wants to install python2 as a dependency due to the automatic detection
Can I override this? Can I somehow only ignore the dependency for python2 aka python? And leave all other dependency detections in place? Or maybe just ignore some files during dependency detection?
There's an RPM feature to filter out dependency generation in certain file/folder locations: https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndReq... -- 真実はいつも一つ!/ Always, there's only one truth!
Hi Neal, On 16.12.22 at 18:47 Neal Gompa wrote:
There's an RPM feature to filter out dependency generation in certain file/folder locations: https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndReq...
Thanks, that seems to have done the trick. Merry Christmas everyone! Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
RPM only records dependencies for executable scripts. If you remove the executable bit from the installed file, and add it back via %attr in the file list, the interpreter dependency will be skipped for this file. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Hi Andreas, On 19.12.22 at 10:13 Andreas Schwab wrote:
RPM only records dependencies for executable scripts. If you remove the executable bit from the installed file, and add it back via %attr in the file list, the interpreter dependency will be skipped for this file.
Ah, nice to know. In my case, it is easier to exclude the whole directory, as it contains a lot of files... Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
participants (3)
-
Andreas Schwab
-
Johannes Kastl
-
Neal Gompa