[Rpm-maint] [rpm-software-management/rpm] Add substring macro to expose lua's string.sub function (PR #2179)
Carl George
notifications at github.com
Sat Sep 10 04:42:22 UTC 2022
It is common for packagers to shell out to echo in order to do string splicing. There are currently 649 instances of this in Fedora just for creating a shorter commit identifier. Lua can do this easily, so create a convenience macro to expose the functionality to packagers.
TLDR; instead of this:
```
%global commit abc123abc123abc123abc123abc123abc123abc1
%global shortcommit %(c=%{commit}; echo ${c:0:7})
```
we can do this:
```
%global commit abc123abc123abc123abc123abc123abc123abc1
%global shortcommit %{substring %commit 1 7}
```
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2179
-- Commit Summary --
* Add substring macro to expose lua's string.sub function
-- File Changes --
M macros.in (17)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/2179.patch
https://github.com/rpm-software-management/rpm/pull/2179.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2179
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2179 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220909/f6179b54/attachment.html>
More information about the Rpm-maint
mailing list