Merge pull request #3151 from keszybz/pr3149-2
Assorted fixes #3149 + one commit tacked on top
This commit is contained in:
+2
-2
@@ -364,7 +364,7 @@ static int fd_copy_directory(
|
||||
q = fd_copy_symlink(dirfd(d), de->d_name, &buf, fdt, de->d_name);
|
||||
else if (S_ISFIFO(buf.st_mode))
|
||||
q = fd_copy_fifo(dirfd(d), de->d_name, &buf, fdt, de->d_name);
|
||||
else if (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode))
|
||||
else if (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode) || S_ISSOCK(buf.st_mode))
|
||||
q = fd_copy_node(dirfd(d), de->d_name, &buf, fdt, de->d_name);
|
||||
else
|
||||
q = -EOPNOTSUPP;
|
||||
@@ -396,7 +396,7 @@ int copy_tree_at(int fdf, const char *from, int fdt, const char *to, bool merge)
|
||||
return fd_copy_symlink(fdf, from, &st, fdt, to);
|
||||
else if (S_ISFIFO(st.st_mode))
|
||||
return fd_copy_fifo(fdf, from, &st, fdt, to);
|
||||
else if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))
|
||||
else if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode) || S_ISSOCK(st.st_mode))
|
||||
return fd_copy_node(fdf, from, &st, fdt, to);
|
||||
else
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
+17
-1
@@ -772,6 +772,19 @@ bool hidden_or_backup_file(const char *filename) {
|
||||
if (!p)
|
||||
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", ".foopkg.old" or ".foopkg~" instead.
|
||||
*/
|
||||
|
||||
return STR_IN_SET(p + 1,
|
||||
"rpmnew",
|
||||
"rpmsave",
|
||||
@@ -786,7 +799,10 @@ bool hidden_or_backup_file(const char *filename) {
|
||||
"ucf-new",
|
||||
"ucf-old",
|
||||
"ucf-dist",
|
||||
"swp");
|
||||
"swp",
|
||||
"bak",
|
||||
"old",
|
||||
"new");
|
||||
}
|
||||
|
||||
bool is_device_path(const char *path) {
|
||||
|
||||
Reference in New Issue
Block a user