mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-27 13:57:26 +03:00
path-util: document that we shouldn't add further entries to hidden_or_backup_file()
And let's add ".bak" as a generic suffix for backups, that people can use without having to register their stuff in our list.
This commit is contained in:
parent
e4196edfbf
commit
941060bf5e
@ -772,6 +772,19 @@ bool hidden_or_backup_file(const char *filename) {
|
|||||||
if (!p)
|
if (!p)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Please, let's not add more entries to the list below. If external projects think it's a good idea to come up
|
||||||
|
* with always new suffixes and that everybody else should just adjust to that, then it really should be on
|
||||||
|
* them. Hence, in future, let's not add any more entries. Instead, let's ask those packages to instead adopt
|
||||||
|
* one of the generic suffixes/prefixes for hidden files or backups, possibly augmented with an additional
|
||||||
|
* string. Specifically: there's now:
|
||||||
|
*
|
||||||
|
* The generic suffixes "~" and ".bak" for backup files
|
||||||
|
* The generic prefix "." for hidden files
|
||||||
|
*
|
||||||
|
* Thus, if a new package manager "foopkg" wants its own set of "foopkg-new", "foopkg-old", "foopkg-dist" or so
|
||||||
|
* registered, let's refuse that and ask them to use "foopkg-new.bak" or "foopkg-new~" instead.
|
||||||
|
*/
|
||||||
|
|
||||||
return STR_IN_SET(p + 1,
|
return STR_IN_SET(p + 1,
|
||||||
"rpmnew",
|
"rpmnew",
|
||||||
"rpmsave",
|
"rpmsave",
|
||||||
@ -786,7 +799,8 @@ bool hidden_or_backup_file(const char *filename) {
|
|||||||
"ucf-new",
|
"ucf-new",
|
||||||
"ucf-old",
|
"ucf-old",
|
||||||
"ucf-dist",
|
"ucf-dist",
|
||||||
"swp");
|
"swp",
|
||||||
|
"bak");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_device_path(const char *path) {
|
bool is_device_path(const char *path) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user