[Rpm-maint] [rpm-software-management/rpm] Shell-like escaping support in %files (PR #1903)

Michal Domonkos notifications at github.com
Wed Apr 27 08:58:22 UTC 2022


@dmnks commented on this pull request.



>      rpmRC res = RPMRC_OK;
     int allow_relative = (RPMFILE_PUBKEY|RPMFILE_DOC|RPMFILE_LICENSE);
 
     t = buf;
-    while ((s = strtokWithQuotes(t, " \t\n")) != NULL) {

Having slept over this... I stand corrected, we *do* support multiple files on a single line, just not for regular files (it's an [artificial limitation](https://github.com/rpm-software-management/rpm/blob/bb36aac905cf8eb470f085574641d92c8d8ca20f/build/files.c#L2563)). For special files (e.g. `%doc`), there may and often actually are[1] multiple files on a line, and they can and often do[1] use globs, therefore escaping needs to be possible either with quotes or backslashes, ideally both, to allow for space & glob combinations.

[1]
```sh
$ cd rpmspecs/  # from https://pkgs.fedoraproject.org/repo/rpm-specs-latest.tar.xz
$ grep '%doc' *.spec | wc -l
31613
```

[2]
```sh
$ grep '%doc' zsh.spec
%doc README LICENCE Etc/BUGS Etc/CONTRIBUTORS Etc/FAQ FEATURES MACHINES
%doc NEWS Etc/zsh-development-guide Etc/completion-style-guide
%doc Doc/*.html
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1903#discussion_r859553820
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1903/review/954554494 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220427/ff5ebf80/attachment-0001.html>


More information about the Rpm-maint mailing list