1 |
commit: 2f72902c1d4bebe3b907a14edfd9082dadb30edb |
2 |
Author: Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr> |
3 |
AuthorDate: Mon Dec 28 14:15:32 2020 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 28 14:15:32 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f72902c |
7 |
|
8 |
app-portage/conf-update: Port to EAPI 7 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/706684 |
11 |
Package-Manager: Portage-3.0.9, Repoman-3.0.1 |
12 |
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr> |
13 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
14 |
|
15 |
.../conf-update/conf-update-1.0.3-r1.ebuild | 28 ++++++---- |
16 |
.../files/conf-update-1.0.3-fno-common.patch | 64 ++++++++++++++++++++++ |
17 |
2 files changed, 80 insertions(+), 12 deletions(-) |
18 |
|
19 |
diff --git a/app-portage/conf-update/conf-update-1.0.3-r1.ebuild b/app-portage/conf-update/conf-update-1.0.3-r1.ebuild |
20 |
index b599d25db4b..e45068f6d28 100644 |
21 |
--- a/app-portage/conf-update/conf-update-1.0.3-r1.ebuild |
22 |
+++ b/app-portage/conf-update/conf-update-1.0.3-r1.ebuild |
23 |
@@ -1,9 +1,9 @@ |
24 |
-# Copyright 1999-2016 Gentoo Foundation |
25 |
+# Copyright 1999-2020 Gentoo Authors |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
|
28 |
-EAPI=5 |
29 |
+EAPI=7 |
30 |
|
31 |
-inherit eutils toolchain-funcs |
32 |
+inherit toolchain-funcs |
33 |
|
34 |
DESCRIPTION="${PN} is a ncurses-based config management utility" |
35 |
HOMEPAGE="https://gitweb.gentoo.org/proj/conf-update.git/" |
36 |
@@ -14,18 +14,22 @@ SLOT="0" |
37 |
KEYWORDS="amd64 ppc x86" |
38 |
IUSE="colordiff libressl" |
39 |
|
40 |
-RDEPEND=">=dev-libs/glib-2.6 |
41 |
- sys-libs/ncurses:0 |
42 |
- !libressl? ( dev-libs/openssl:0 ) |
43 |
- libressl? ( dev-libs/libressl ) |
44 |
- colordiff? ( app-misc/colordiff )" |
45 |
-DEPEND="virtual/pkgconfig |
46 |
- ${RDEPEND}" |
47 |
+RDEPEND=" |
48 |
+ dev-libs/glib |
49 |
+ sys-libs/ncurses:0 |
50 |
+ colordiff? ( app-misc/colordiff ) |
51 |
+ !libressl? ( dev-libs/openssl:0= ) |
52 |
+ libressl? ( dev-libs/libressl:0= )" |
53 |
+DEPEND="${RDEPEND}" |
54 |
+BDEPEND="virtual/pkgconfig" |
55 |
+ |
56 |
+PATCHES=( "${FILESDIR}"/${P}-fno-common.patch ) |
57 |
|
58 |
src_prepare() { |
59 |
- sed -i -e "s/\$Rev:.*\\$/${PVR}/" "${S}"/"${PN}".h || die |
60 |
+ default |
61 |
+ sed -i -e "s/\$Rev:.*\\$/${PVR}/" ${PN}.h || die |
62 |
if use colordiff ; then |
63 |
- sed -i -e "s/diff_tool=diff/diff_tool=colordiff/" ${PN}.conf \ die 'colordiff-sed failed' |
64 |
+ sed -i -e "s/diff_tool=diff/diff_tool=colordiff/" ${PN}.conf || die |
65 |
fi |
66 |
tc-export PKG_CONFIG |
67 |
} |
68 |
|
69 |
diff --git a/app-portage/conf-update/files/conf-update-1.0.3-fno-common.patch b/app-portage/conf-update/files/conf-update-1.0.3-fno-common.patch |
70 |
new file mode 100644 |
71 |
index 00000000000..04c72687dde |
72 |
--- /dev/null |
73 |
+++ b/app-portage/conf-update/files/conf-update-1.0.3-fno-common.patch |
74 |
@@ -0,0 +1,64 @@ |
75 |
+--- a/config.c |
76 |
++++ b/config.c |
77 |
+@@ -1,5 +1,7 @@ |
78 |
+ #include "conf-update.h" |
79 |
+ |
80 |
++struct configuration config; |
81 |
++ |
82 |
+ bool get_boolean(GKeyFile *conffile, const char *key, bool default_value) { |
83 |
+ GError *error = NULL; |
84 |
+ bool value, invalid_value, key_not_found; |
85 |
+@@ -26,7 +28,6 @@ char *get_string(GKeyFile *conffile, const char *key, char *default_value) { |
86 |
+ } |
87 |
+ |
88 |
+ void read_config() { |
89 |
+- extern struct configuration config; |
90 |
+ GKeyFile *conffile; |
91 |
+ |
92 |
+ // set reasonable defaults |
93 |
+--- a/config.h |
94 |
++++ b/config.h |
95 |
+@@ -8,6 +8,8 @@ struct configuration { |
96 |
+ char *diff_tool; |
97 |
+ char *merge_tool; |
98 |
+ char *edit_tool; |
99 |
+-} config; |
100 |
++}; |
101 |
++ |
102 |
++extern struct configuration config; |
103 |
+ |
104 |
+ void read_config(); |
105 |
+--- a/core.c |
106 |
++++ b/core.c |
107 |
+@@ -1,5 +1,7 @@ |
108 |
+ #include "conf-update.h" |
109 |
+ |
110 |
++extern struct configuration config; |
111 |
++ |
112 |
+ char *get_real_filename(const char *update) { |
113 |
+ char *file = (char *)calloc(strlen(update) + 1 - strlen("._cfg????_"), sizeof(char)); |
114 |
+ strncpy(file, update, strrchr(update, '/') - update + 1); |
115 |
+@@ -73,7 +75,6 @@ void merge(char *update, char **index) { |
116 |
+ } |
117 |
+ |
118 |
+ int show_diff(char *update) { |
119 |
+- extern struct configuration config; |
120 |
+ char *realfile = get_real_filename(update); |
121 |
+ char *esc_realfile = g_shell_quote(realfile); |
122 |
+ char *esc_update = g_shell_quote(update); |
123 |
+@@ -98,7 +99,6 @@ int show_diff(char *update) { |
124 |
+ } |
125 |
+ |
126 |
+ int edit_update(char *update) { |
127 |
+- extern struct configuration config; |
128 |
+ char *esc_update = g_shell_quote(update); |
129 |
+ char *cmd = calloc(strlen(config.edit_tool) + strlen(" ") + strlen(esc_update), sizeof(char)); |
130 |
+ int ret; |
131 |
+@@ -116,7 +116,6 @@ int edit_update(char *update) { |
132 |
+ char **merge_interactively(char *update, char **index) { |
133 |
+ // customized versions are ._cfg????- with a minus instead of a underscore |
134 |
+ // that way get_real_filename() works without modification |
135 |
+- extern struct configuration config; |
136 |
+ char *realfile = get_real_filename(update); |
137 |
+ char *esc_realfile = g_shell_quote(realfile); |
138 |
+ char *esc_update = g_shell_quote(update); |