summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-02 12:04:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-07 20:05:31 +0000
commit2345af9b4829ed3eed5abf60f2483055649f8af7 (patch)
tree96a9a31e4b1957b93c4fe3eb669117d2752caf0d /meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
parentc4901328fe5cf912c0965e5b011b64a95a9bcb9d (diff)
downloadpoky-uninative-1.5.tar.gz
recipes: Move out stale GPLv2 versions to a seperate layeruninative-1.5
These are recipes where the upstream has moved to GPLv3 and these old versions are the last ones under the GPLv2 license. There are several reasons for making this move. There is a different quality of service with these recipes in that they don't get security fixes and upstream no longer care about them, in fact they're actively hostile against people using old versions. The recipes tend to need a different kind of maintenance to work with changes in the wider ecosystem and there needs to be isolation between changes made in the v3 versions and those in the v2 versions. There are probably better ways to handle a "non-GPLv3" system but right now having these in OE-Core makes them look like a first class citizen when I believe they have potential for a variety of undesireable issues. Moving them into a separate layer makes their different needs clearer, it also makes it clear how many of these there are. Some are probably not needed (e.g. mc), I also wonder whether some are useful (e.g. gmp) since most things that use them are GPLv3 only already. Someone could now more clearly see how to streamline the list of recipes here. I'm proposing we mmove to this separate layer for 2.3 with its future maintinership and testing to be determined in 2.4 and beyond. (From OE-Core rev: 19b7e950346fb1dde6505c45236eba6cd9b33b4b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch')
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch101
1 files changed, 0 insertions, 101 deletions
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
deleted file mode 100644
index 88f61fa108..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
+++ /dev/null
@@ -1,101 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3The install command doesn't over write the dangling symlink, for
4example:
5
6$ install fileA /tmp/fileA
7
8If /tmp/fileA is a dangling symlink, there would be an error:
9
10install: cannot create regular file '/tmp/fileA': File exists
11
12This is because of the following code in copy.c:
13
14 if (!new_dst)
15 {
16 if (XSTAT (x, dst_name, &dst_sb) != 0)
17 {
18 if (errno != ENOENT)
19 {
20 error (0, errno, _("cannot stat %s"), quote (dst_name));
21 return false;
22 }
23 else
24 {
25 new_dst = true;
26 }
27 }
28
29XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
30install.c invokes it, and stat will set errno to ENOENT, and then
31new_dst will be set to true which means that /tmp/fileA doesn't exist,
32then we will create /tmp/fileA without remove it first, so the error
33comes.
34
35This is fixed in a way which adds the member cmd_install in
36struct cp_options to make sure my change only affected to the install
37command and use lstat to fix the problem.
38
39Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
40Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
41
42---
43 src/copy.c | 10 +++++++++-
44 src/copy.h | 3 +++
45 src/install.c | 1 +
46 3 files changed, 13 insertions(+), 1 deletions(-)
47
48diff --git a/src/copy.c b/src/copy.c
49--- a/src/copy.c
50+++ b/src/copy.c
51@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
52 bool delayed_ok;
53 bool copied_as_regular = false;
54 bool preserve_metadata;
55+ int dst_stat_result;
56
57 if (x->move_mode && rename_succeeded)
58 *rename_succeeded = false;
59@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
60
61 if (!new_dst)
62 {
63- if (XSTAT (x, dst_name, &dst_sb) != 0)
64+ if ( x->cmd_install && ( x->backup_type == no_backups))
65+ dst_stat_result = lstat (dst_name, &dst_sb);
66+ else
67+ {
68+ dst_stat_result = XSTAT (x, dst_name, &dst_sb);
69+ }
70+
71+ if (dst_stat_result != 0)
72 {
73 if (errno != ENOENT)
74 {
75diff --git a/src/copy.h b/src/copy.h
76--- a/src/copy.h
77+++ b/src/copy.h
78@@ -114,6 +114,9 @@ struct cp_options
79 If that fails, then resort to copying. */
80 bool move_mode;
81
82+ /* For the install command */
83+ bool cmd_install;
84+
85 /* Whether this process has appropriate privileges to chown a file
86 whose owner is not the effective user ID. */
87 bool chown_privileges;
88diff --git a/src/install.c b/src/install.c
89--- a/src/install.c
90+++ b/src/install.c
91@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
92 x->hard_link = false;
93 x->interactive = I_UNSPECIFIED;
94 x->move_mode = false;
95+ x->cmd_install = true;
96 x->chown_privileges = chown_privileges ();
97 x->one_file_system = false;
98 x->preserve_ownership = false;
99--
1001.7.0.1
101