Can I use the Bash functions in the RPM specification file?

A search for open source projects shows that spec files in the wild use bash constructors, such as cat info|while read .

But is it really safe? The rpm documentation tells me that I can count on the %build section executed by Bash ?

+4
source share
2 answers

By default, the shell invoked for each of the specification stanzas is set to %_buildshell . The default value is /bin/sh , but can be overridden either globally or based on each line.

+4
source

Short answer: yes

Long answer: although bash has become the de facto Linux shell standard, and in practice you can rely on bash, it doesn’t hurt to point %_buildshell to /bin/bash , as mentioned in @ Ignacio Vasquez-Abrams answers

0
source

All Articles