summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg
diff options
context:
space:
mode:
authorAlejandro del Castillo <alejandro.delcastillo@ni.com>2019-06-24 14:27:06 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-27 12:20:36 +0100
commitf5379ec0d0942fff2f4c6a4ddceefc8a4fb2107d (patch)
tree1a48b0ca58f9b5e9036ee2e421c79768897ef911 /meta/recipes-devtools/opkg
parente58f930df5a22ee42c27cff0ca12bc9bf961b74b (diff)
downloadpoky-f5379ec0d0942fff2f4c6a4ddceefc8a4fb2107d.tar.gz
opkg: upgrade to version 0.4.1
- Drop 0001-libopkg-add-add-ignore-recommends-option.patch - Drop 0001-opkg-add-target-for-testsuite-installation.patch - Drop 0001-regress-issue72.py-resolve-paths-before-comparision.patch - Remove test binaries tests\libopkg_test, leftovers from make dist process (From OE-Core rev: b14c17e9b1992a7f6c9acfa9ee82037325163b31) Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg')
-rw-r--r--meta/recipes-devtools/opkg/opkg/0001-libopkg-add-add-ignore-recommends-option.patch259
-rw-r--r--meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch43
-rw-r--r--meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch31
-rw-r--r--meta/recipes-devtools/opkg/opkg_0.4.1.bb (renamed from meta/recipes-devtools/opkg/opkg_0.4.0.bb)17
4 files changed, 12 insertions, 338 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0001-libopkg-add-add-ignore-recommends-option.patch b/meta/recipes-devtools/opkg/opkg/0001-libopkg-add-add-ignore-recommends-option.patch
deleted file mode 100644
index 47d1b3c37e..0000000000
--- a/meta/recipes-devtools/opkg/opkg/0001-libopkg-add-add-ignore-recommends-option.patch
+++ /dev/null
@@ -1,259 +0,0 @@
1From 64aa98646a17c299bf37af2975b98daf5d7d30b4 Mon Sep 17 00:00:00 2001
2From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3Date: Thu, 31 Jan 2019 18:16:08 -0600
4Subject: [PATCH] libopkg: add --add-ignore-recommends option
5
6Add option to ignore specific recommended packages. On the libsolv
7backed, this feature will only work on libsolv version > 0.7.2 [1].
8
9[1] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openSUSE_libsolv_issues_254&d=DwIBaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wNcrL2akRn6jfxhHaKavUrJB_C9JAMXtynjLd8ZzgXQ&m=GObNHzFJpWpf_PripIrf-K2RhsktYdAUEieAJexXOKw&s=3G-meChUqClFggFPqsrAxIZBfLnRKIHm62Uuy1X6nQQ&e=
10
11Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
12
13Upstream-Status: Accepted
14---
15 libopkg/opkg_conf.c | 2 +
16 libopkg/opkg_conf.h | 1 +
17 .../solvers/internal/pkg_depends_internal.c | 3 +-
18 libopkg/solvers/libsolv/opkg_solver_libsolv.c | 21 ++++++-
19 man/opkg.1.in | 3 +
20 src/opkg.c | 6 ++
21 tests/Makefile | 1 +
22 tests/core/43_add_ignore_recommends.py | 62 +++++++++++++++++++
23 8 files changed, 97 insertions(+), 2 deletions(-)
24 create mode 100755 tests/core/43_add_ignore_recommends.py
25
26diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
27index 06880a1..f2330cd 100644
28--- a/libopkg/opkg_conf.c
29+++ b/libopkg/opkg_conf.c
30@@ -597,6 +597,7 @@ int opkg_conf_init(void)
31 pkg_dest_list_init(&opkg_config->tmp_dest_list);
32 nv_pair_list_init(&opkg_config->arch_list);
33 str_list_init(&opkg_config->exclude_list);
34+ str_list_init(&opkg_config->ignore_recommends_list);
35
36 return 0;
37 }
38@@ -938,6 +939,7 @@ void opkg_conf_deinit(void)
39 pkg_dest_list_deinit(&opkg_config->pkg_dest_list);
40 nv_pair_list_deinit(&opkg_config->arch_list);
41 str_list_deinit(&opkg_config->exclude_list);
42+ str_list_deinit(&opkg_config->ignore_recommends_list);
43
44 if (opkg_config->verbosity >= DEBUG) {
45 hash_print_stats(&opkg_config->pkg_hash);
46diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
47index eb56a29..316c500 100644
48--- a/libopkg/opkg_conf.h
49+++ b/libopkg/opkg_conf.h
50@@ -61,6 +61,7 @@ typedef struct opkg_conf {
51 pkg_dest_list_t tmp_dest_list;
52 nv_pair_list_t arch_list;
53 str_list_t exclude_list;
54+ str_list_t ignore_recommends_list;
55
56 int restrict_to_default_dest;
57 pkg_dest_t *default_dest;
58diff --git a/libopkg/solvers/internal/pkg_depends_internal.c b/libopkg/solvers/internal/pkg_depends_internal.c
59index cd56d84..5deee70 100644
60--- a/libopkg/solvers/internal/pkg_depends_internal.c
61+++ b/libopkg/solvers/internal/pkg_depends_internal.c
62@@ -228,7 +228,8 @@ int pkg_hash_fetch_unsatisfied_dependencies(pkg_t *pkg,
63 || compound_depend->type == SUGGEST)
64 && (satisfying_pkg->state_want == SW_DEINSTALL
65 || satisfying_pkg->state_want == SW_PURGE
66- || opkg_config->no_install_recommends);
67+ || opkg_config->no_install_recommends
68+ || str_list_contains(&opkg_config->ignore_recommends_list, satisfying_pkg->name));
69 if (ignore) {
70 opkg_msg(NOTICE,
71 "%s: ignoring recommendation for "
72diff --git a/libopkg/solvers/libsolv/opkg_solver_libsolv.c b/libopkg/solvers/libsolv/opkg_solver_libsolv.c
73index 2b27e3a..403e07b 100644
74--- a/libopkg/solvers/libsolv/opkg_solver_libsolv.c
75+++ b/libopkg/solvers/libsolv/opkg_solver_libsolv.c
76@@ -484,6 +484,7 @@ static void pkg2solvable(pkg_t *pkg, Solvable *solvable_out)
77 static void populate_installed_repo(libsolv_solver_t *libsolv_solver)
78 {
79 int i;
80+ Id what;
81
82 pkg_vec_t *installed_pkgs = pkg_vec_alloc();
83
84@@ -507,6 +508,15 @@ static void populate_installed_repo(libsolv_solver_t *libsolv_solver)
85 /* set solvable attributes */
86 pkg2solvable(pkg, solvable);
87
88+ /* if the package is in ignore-recommends-list, disfavor installation */
89+ if (str_list_contains(&opkg_config->ignore_recommends_list, pkg->name)) {
90+ opkg_message(NOTICE, "Disfavor package: %s\n",
91+ pkg->name);
92+ what = pool_str2id(libsolv_solver->pool, pkg->name, 1);
93+ queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE_NAME
94+ | SOLVER_DISFAVOR, what);
95+ }
96+
97 /* if the package is not autoinstalled, mark it as user installed */
98 if (!pkg->auto_installed)
99 queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE
100@@ -539,7 +549,7 @@ static void populate_available_repos(libsolv_solver_t *libsolv_solver)
101 {
102 int i;
103 Solvable *solvable;
104- Id solvable_id;
105+ Id solvable_id, what;
106
107 pkg_vec_t *available_pkgs = pkg_vec_alloc();
108
109@@ -608,6 +618,15 @@ static void populate_available_repos(libsolv_solver_t *libsolv_solver)
110 solvable = pool_id2solvable(libsolv_solver->pool, solvable_id);
111 pkg2solvable(pkg, solvable);
112
113+ /* if the package is in ignore-recommends-list, disfavor installation */
114+ if (str_list_contains(&opkg_config->ignore_recommends_list, pkg->name)) {
115+ opkg_message(NOTICE, "Disfavor package: %s\n",
116+ pkg->name);
117+ what = pool_str2id(libsolv_solver->pool, pkg->name, 1);
118+ queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE_NAME
119+ | SOLVER_DISFAVOR, what);
120+ }
121+
122 /* if the --force-depends option is specified make dependencies weak */
123 if (opkg_config->force_depends)
124 queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE
125diff --git a/man/opkg.1.in b/man/opkg.1.in
126index 27fa9c1..f192c3b 100644
127--- a/man/opkg.1.in
128+++ b/man/opkg.1.in
129@@ -162,6 +162,9 @@ priority \fIprio\fP. Lower priorities take precedence.
130 \fB\--add-exclude <\fIname\fP>\fR
131 Register package to be excluded from install
132 .TP
133+\fB\--add-ignore-recommends <\fIname\fP>\fR
134+Register package to be ignored as a recomendee
135+.TP
136 \fB\--prefer-arch-to-version\fR
137 Use the architecture priority package rather than the higher version
138 one if more than one candidate is found.
139diff --git a/src/opkg.c b/src/opkg.c
140index 650e278..3c93a3b 100644
141--- a/src/opkg.c
142+++ b/src/opkg.c
143@@ -51,6 +51,7 @@ enum {
144 ARGS_OPT_ADD_DEST,
145 ARGS_OPT_SIZE,
146 ARGS_OPT_ADD_EXCLUDE,
147+ ARGS_OPT_ADD_IGNORE_RECOMMENDS,
148 ARGS_OPT_NOACTION,
149 ARGS_OPT_DOWNLOAD_ONLY,
150 ARGS_OPT_NODEPS,
151@@ -112,6 +113,7 @@ static struct option long_options[] = {
152 {"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
153 {"size", 0, 0, ARGS_OPT_SIZE},
154 {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE},
155+ {"add-ignore-recommends", 1, 0, ARGS_OPT_ADD_IGNORE_RECOMMENDS},
156 {"test", 0, 0, ARGS_OPT_NOACTION},
157 {"tmp-dir", 1, 0, 't'},
158 {"tmp_dir", 1, 0, 't'},
159@@ -234,6 +236,9 @@ static int args_parse(int argc, char *argv[])
160 case ARGS_OPT_ADD_EXCLUDE:
161 str_list_append(&opkg_config->exclude_list, optarg);
162 break;
163+ case ARGS_OPT_ADD_IGNORE_RECOMMENDS:
164+ str_list_append(&opkg_config->ignore_recommends_list, optarg);
165+ break;
166 case ARGS_OPT_SIZE:
167 opkg_config->size = 1;
168 break;
169@@ -343,6 +348,7 @@ static void usage()
170 printf("\t--add-dest <name>:<path> Register destination with given path\n");
171 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
172 printf("\t--add-exclude <name> Register package to be excluded from install\n");
173+ printf("\t--add-ignore-recommends <name> Register package to be ignored as a recomendee\n");
174 printf("\t--prefer-arch-to-version Use the architecture priority package rather\n");
175 printf("\t than the higher version one if more\n");
176 printf("\t than one candidate is found.\n");
177diff --git a/tests/Makefile b/tests/Makefile
178index 8e5be08..799816d 100644
179--- a/tests/Makefile
180+++ b/tests/Makefile
181@@ -42,6 +42,7 @@ REGRESSION_TESTS := core/01_install.py \
182 core/40_arch.py \
183 core/41_info_fields.py \
184 core/42_info_description.py \
185+ core/43_add_ignore_recommends.py \
186 regress/issue26.py \
187 regress/issue31.py \
188 regress/issue32.py \
189diff --git a/tests/core/43_add_ignore_recommends.py b/tests/core/43_add_ignore_recommends.py
190new file mode 100755
191index 0000000..7da0096
192--- /dev/null
193+++ b/tests/core/43_add_ignore_recommends.py
194@@ -0,0 +1,62 @@
195+#! /usr/bin/env python3
196+#
197+# Create package 'a' (1.0) which Recommends 'c'.
198+# Install 'a' with --add-ignore-recommends 'c'.
199+# Check that only 'a' (1.0) is installed.
200+# Create package 'b' which Depends on 'c'.
201+# Install 'a' & 'b', with --add-ignore-recommends 'c'.
202+# Verify that 'a','b' & 'c' are installed.
203+# Uninstall 'b' & 'c'.
204+# Create package 'a' (2.0), which Recommends 'c'.
205+# Upgrade 'a' with --add-ignore-recommends 'c'
206+# Verify that only 'a' (2.0) is installed
207+#
208+
209+import os
210+import opk, cfg, opkgcl
211+
212+opk.regress_init()
213+o = opk.OpkGroup()
214+
215+o.add(Package='a', Recommends='c', Version='1.0')
216+o.add(Package='b', Depends='c')
217+o.add(Package='c')
218+o.write_opk()
219+o.write_list()
220+
221+opkgcl.update()
222+
223+opkgcl.install('a', '--add-ignore-recommends c')
224+
225+if not opkgcl.is_installed('a'):
226+ opk.fail("Package 'a' installed but reports as not installed.")
227+
228+if opkgcl.is_installed('c'):
229+ opk.xfail("[libsolv<0.7.3] Package 'c' should not have been installed since it was in --add-ignore-recommends.")
230+
231+opkgcl.remove('a')
232+opkgcl.install('a b', '--add-ignore-recommends c')
233+
234+if not opkgcl.is_installed('a'):
235+ opk.fail("Package 'a' installed but reports as not installed.")
236+
237+if not opkgcl.is_installed('b'):
238+ opk.fail("Package 'b' installed but reports as not installed.")
239+
240+if not opkgcl.is_installed('c'):
241+ opk.fail("Package 'c' should have been installed since 'b' depends on it.")
242+
243+opkgcl.remove('b c', '--force-depends')
244+o.add(Package='a', Recommends='c', Version='2.0')
245+o.write_opk()
246+o.write_list()
247+
248+opkgcl.update()
249+
250+opkgcl.upgrade('a', '--add-ignore-recommends c')
251+
252+if not opkgcl.is_installed('a', '2.0'):
253+ opk.fail("Package 'a (2.0)' installed but reports as not installed.")
254+
255+if opkgcl.is_installed('c'):
256+ opk.fail("Package 'c' should not have been installed since it was in --add-ignore-recommends.")
257--
2582.20.1
259
diff --git a/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch b/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch
deleted file mode 100644
index 951c186767..0000000000
--- a/meta/recipes-devtools/opkg/opkg/0001-opkg-add-target-for-testsuite-installation.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 8fb0364bd0e19f35c20616dd1ab10aa00e08fa8f Mon Sep 17 00:00:00 2001
2From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3Date: Wed, 10 Apr 2019 14:49:43 -0500
4Subject: [PATCH] opkg: add target for testsuite installation
5
6- Add target to install testsuite
7- Add override of opkg binary used during test via OPKG_PATH environment
8variable.
9
10Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
11---
12Upstream-Status: Submitted
13
14 Makefile.am | 5 +++++
15 tests/cfg.py | 2 +-
16 2 files changed, 6 insertions(+), 1 deletion(-)
17
18diff --git a/Makefile.am b/Makefile.am
19index 90cfcae..1f6a784 100644
20--- a/Makefile.am
21+++ b/Makefile.am
22@@ -18,3 +18,8 @@ run-tests:
23 $(MAKE) -C tests DATADIR=@datadir@ SYSCONFDIR=@sysconfdir@ VARDIR=@localstatedir@
24
25 check: run-tests
26+
27+install-ptest:
28+ cp -r $(srcdir)/tests $(DESTDIR)
29+ cp Makefile $(DESTDIR)
30+ sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
31diff --git a/tests/cfg.py b/tests/cfg.py
32index 4efaff6..ca59d03 100644
33--- a/tests/cfg.py
34+++ b/tests/cfg.py
35@@ -2,4 +2,4 @@ import os
36
37 opkdir = "/tmp/opk"
38 offline_root = "/tmp/opkg"
39-opkgcl = os.path.realpath("../src/opkg")
40+opkgcl = os.getenv('OPKG_PATH', os.path.realpath("../src/opkg"))
41--
422.20.1
43
diff --git a/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch b/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
deleted file mode 100644
index 75ecb5fb42..0000000000
--- a/meta/recipes-devtools/opkg/opkg/0001-regress-issue72.py-resolve-paths-before-comparision.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 5f005830eea7d03c02107a3a3fc58907b0a037bf Mon Sep 17 00:00:00 2001
2From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
3Date: Mon, 8 Apr 2019 11:14:56 -0500
4Subject: [PATCH] regress/issue72.py: resolve paths before comparision
5
6In systems that have a volatile /tmp, the test incorrectly fails since
7it doesn't resolve the real path in all cases.
8
9Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
10---
11Upstream-Status: Submitted
12
13 tests/regress/issue72.py | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/tests/regress/issue72.py b/tests/regress/issue72.py
17index 1626877..2f24dec 100755
18--- a/tests/regress/issue72.py
19+++ b/tests/regress/issue72.py
20@@ -56,7 +56,7 @@ if not os.path.lexists("{}/{}".format(cfg.offline_root, long_filename2)):
21 "not created.")
22
23 linky = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename2))
24-linky_dst = "{}/{}".format(cfg.offline_root, long_filename)
25+linky_dst = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename))
26 if linky != linky_dst:
27 opk.fail("symlink path truncated.")
28
29--
302.20.1
31
diff --git a/meta/recipes-devtools/opkg/opkg_0.4.0.bb b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
index e2305d096a..8c48d3097c 100644
--- a/meta/recipes-devtools/opkg/opkg_0.4.0.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.4.1.bb
@@ -14,14 +14,11 @@ PE = "1"
14SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ 14SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
15 file://opkg.conf \ 15 file://opkg.conf \
16 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ 16 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
17 file://0001-libopkg-add-add-ignore-recommends-option.patch \
18 file://0001-regress-issue72.py-resolve-paths-before-comparision.patch \
19 file://0001-opkg-add-target-for-testsuite-installation.patch \
20 file://run-ptest \ 17 file://run-ptest \
21" 18"
22 19
23SRC_URI[md5sum] = "ae51d95fee599bb4dce08453529158f5" 20SRC_URI[md5sum] = "ba0c21305fc93b26e844981ef100dc85"
24SRC_URI[sha256sum] = "f6c00515d8a2ad8f6742a8e73830315d1983ed0459cba77c4d656cfc9e7fe6fe" 21SRC_URI[sha256sum] = "45ac1e037d3877f635d883f8a555e172883a25d3eeb7986c75890fdd31250a43"
25 22
26# This needs to be before ptest inherit, otherwise all ptest files end packaged 23# This needs to be before ptest inherit, otherwise all ptest files end packaged
27# in libopkg package if OPKGLIBDIR == libdir, because default 24# in libopkg package if OPKGLIBDIR == libdir, because default
@@ -45,6 +42,16 @@ PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
45 42
46EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}" 43EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
47 44
45# Release tarball has unused binaries on the tests folder, automatically created by automake.
46# For now, delete them to avoid packaging errors (wrong architecture)
47do_unpack_append () {
48 bb.build.exec_func('remove_test_binaries', d)
49}
50
51remove_test_binaries () {
52 rm ${WORKDIR}/opkg-${PV}/tests/libopkg_test*
53}
54
48do_install_append () { 55do_install_append () {
49 install -d ${D}${sysconfdir}/opkg 56 install -d ${D}${sysconfdir}/opkg
50 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf 57 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf