Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | brp-mangle-shebangs: do not stat / touch files needlessly | Denys Vlasenko | 2019-12-23 | 1 | -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 expansion | Denys Vlasenko | 2019-12-23 | 1 | -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 Vlasenko | 2019-12-23 | 1 | -3/+12 |
| | | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com> | ||||
* | Make ambiguous python shebangs error | Thierry Vignaud | 2019-12-23 | 1 | -0/+1 |
| | |||||
* | do not fail when python call is ambiguous | Thierry Vignaud | 2018-09-24 | 1 | -1/+0 |
| | |||||
* | add __brp_mangle_shebangs from FC in order to: | Thierry Vignaud | 2018-09-24 | 1 | -0/+142 |
- fix /bin -> /usr/bin - resolve "env foobar" -> "foobar" install it in /usr/lib/rpm/redhat to make clear from where it comes |