Skip to content

Commit

Permalink
Make "minimal" file attr more clear
Browse files Browse the repository at this point in the history
Looks like people were confused by the fact that having a file attr not
matching anything was legal. Be more explicit what is expected to make
them actuaqlly useful.

Resolves: rpm-software-management#2951
  • Loading branch information
ffesti committed Jul 19, 2024
1 parent 184475d commit 0d6c5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/manual/dependency_generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A file attribute is represented by a macro file in `%{_fileattrsdir}` (typically
%__NAME_protocol
```

NAME needs to be replaced by the name choosen for the file attribute and needs to be the same as the file name of the macro file itself (without the `.attr` suffix). While technically all of them are optional, typically two or more of them are present to form a meaningul attribute. All the values are further macro-expanded on use, and additionally, the path and magic related values are interpreted as extended regular expressions.
NAME needs to be replaced by the name choosen for the file attribute and needs to be the same as the file name of the macro file itself (without the `.attr` suffix). While technically all of them are optional, typically at least two of them are present to form a meaninful attribute: `*_path` and/or `*_magic` to match any files at all and at least one generator. All the values are further macro-expanded on use, and additionally, the path and magic related values are interpreted as extended regular expressions.

The path REs are matched against the packaged path, without `%buildroot` - e.g. `/bin/bash`. The magic REs are matched against the result of libmagic (see `man file` and `man magic`), and some of them are also stored in the `FILECLASS` tag (try `rpm -q --fileclass PACKAGENAME` for example). To get compatible results with rpm, use `file -z -e tokens <file>` when determining appropriate file attribute magic REs. Matching is inclusive unless changed by flags: if path, magic or both match, the file is considered to have the attribute in question, unless there is a matching exclude pattern (also inclusive by default) or a flag which prevents the match.

Expand Down

0 comments on commit 0d6c5b3

Please sign in to comment.