diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-29 10:17:43 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-29 10:21:07 -0400 |
commit | 94a0ef6e572896140b8f28f688e881e198e2f2ab (patch) | |
tree | 3f45c4d3d91eebec00fbe397167c2d70d85424da /src | |
parent | 2397bc4312f6d1fbdf97bf826a1ca6ad409aabf3 (diff) |
path-util: also support ".old" and ".new" suffixes and recommend them
~ suffix works fine, but looks to much like it the file is supposed to be
automatically cleaned up. For new versions of configuration files installers
might want to using something that looks more permanent like foobar.new.
So let's add treat ".old" and ".new" as special.
Update test to match.
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/path-util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index bcf72913df..b2fa81a294 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -781,8 +781,8 @@ bool hidden_or_backup_file(const char *filename) { * 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. + * 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", ".foopkg.old" or ".foopkg~" instead. */ return STR_IN_SET(p + 1, @@ -800,7 +800,9 @@ bool hidden_or_backup_file(const char *filename) { "ucf-old", "ucf-dist", "swp", - "bak"); + "bak", + "old", + "new"); } bool is_device_path(const char *path) { |