aboutsummaryrefslogtreecommitdiffstats
path: root/brp-mangle-shebangs
Commit message (Collapse)AuthorAgeFilesLines
* brp-mangle-shebangs: do not exit if read has a non-zero statusJani Välimaa2019-12-241-1/+1
| | | | | | | | | At least building texlive-texmf fails without this because brp-mangle-shebangs has -e in its shebang. -e Exit immediately if a command exits with a non-zero status. $ read shebang_line < BUILD/texlive-20190410-texmf/texmf-dist/doc/generic/pst-mirror/createEPS/test.sh $ echo $? 1
* brp-mangle-shebangs: do not stat / touch files needlesslyDenys Vlasenko2019-12-231-3/+5
| | | | | | | Run "stat" to get mtime, and "touch -d $saved_mtime" only if we indeed modify file's shebang. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* brp-mangle-shebangs: fix unsafe/incorrect command expansionDenys Vlasenko2019-12-231-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | trim() { printf '%s' "$*" } ... read shebang_line < "$f" || : orig_shebang=$(trim $(echo "$shebang_line" | grep -Po "#!\K.*" || echo)) The "trimming", i.e. replacement of multiple spaces and removal of leading and trailing spaces, is achieved because "trim $(cmd)" construct has an unquoted $(), which is subject to word splitting. This works, yes. BUT. It is also subject to glob expansion - any ?s and *s will be attempted to be expanded as well - definitely NOT what we want! This change replaces this trick with code which avoids the expansion issue, and which does not spawn any subprocesses for string manipulations - this is ~3 times faster (fork+execs are expensive). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* brp-mangle-shebangs: speed up finding of "text executables" (scripts)Denys Vlasenko2019-12-231-3/+12
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Make ambiguous python shebangs errorThierry Vignaud2019-12-231-0/+1
|
* do not fail when python call is ambiguousThierry Vignaud2018-09-241-1/+0
|
* add __brp_mangle_shebangs from FC in order to:Thierry Vignaud2018-09-241-0/+142
- fix /bin -> /usr/bin - resolve "env foobar" -> "foobar" install it in /usr/lib/rpm/redhat to make clear from where it comes