André Draszik | 24 Jun 14:18 2016
Picon

[PATCH] release: fix implicit declaration of release_get_sha256()

| ../../opkg-0.3.2/libopkg/release.c: In function ‘release_verify_file’:
| ../../opkg-0.3.2/libopkg/release.c:120:26: warning: implicit declaration of function
‘release_get_sha256’ [-Wimplicit-function-declaration]
|      const char *sha256 = release_get_sha256(release, pathname);
|                           ^
| ../../opkg-0.3.2/libopkg/release.c:120:26: warning: initialization makes pointer from integer
without a cast [-Wint-conversion]
| ../../opkg-0.3.2/libopkg/release.c: At top level:
| ../../opkg-0.3.2/libopkg/release.c:324:13: error: conflicting types for ‘release_get_sha256’
|  const char *release_get_sha256(release_t * release, const char *pathname)
|              ^
| ../../opkg-0.3.2/libopkg/release.c:120:26: note: previous implicit declaration of
‘release_get_sha256’ was here
|      const char *sha256 = release_get_sha256(release, pathname);
|                           ^

At the same time, make it static, too, similar to
release_get_md5().

Signed-off-by: André Draszik <adraszik@...>
---
 libopkg/release.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/libopkg/release.c b/libopkg/release.c
index b6aceb4..7db0bd4 100644
--- a/libopkg/release.c
+++ b/libopkg/release.c
 <at>  <at>  -109,6 +109,20  <at>  <at>  static const char *release_get_md5(release_t * release, const char *pathname)
     return '\0';
(Continue reading)

Joshua DeWeese | 23 Jun 22:33 2016
Picon

building data.tar.gz for *.ipk files with less fuss

I thought this might be useful for others and worth bringing up here. It seems like nobody has figured out a decent way to build the data.tar.gz file inside of pkg files without alot of fuss (at least from my searching when trying to make pkgs for angstrom and poky). So I thought I'd take a whack at it. Attached is a script which builds tar files with the desired permissions/ownership and a sample control file showing how the output is controlled. It was made in about an hour, and I am already thinking of a better way to implement it in c or python where the tar file could be constructed directly using tar libraries rather in in /tmp as I have done here in shell script. Let me know what you think. If there is interest I will start a proper project.

--
You received this message because you are subscribed to the Google Groups "opkg-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opkg-devel+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Attachment (mktar): application/octet-stream, 1665 bytes
Attachment (cntrl_file): application/octet-stream, 104 bytes
Michael Hansen | 21 Jun 20:48 2016
Picon

[PATCH] Check installed status for actual package, not its abstract parent.

This fixes the inverse-case regression caused by my initial fix for 9802.

Signed-off-by: Michael Hansen <michael.j.hansen@...>
---
 libopkg/pkg_hash.c          |  4 ++--
 tests/Makefile              |  1 +
 tests/regress/issue9802b.py | 25 +++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 tests/regress/issue9802b.py

diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index 9d731f0..3761514 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
 <at>  <at>  -444,8 +444,8  <at>  <at>  pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                     opkg_msg(DEBUG, "%s %s wins by priority.\n",
                              good_pkg_by_name->name, good_pkg_by_name->version);
             } else if (good_pkg_by_name && prefer_installed) {
-                int is_installed = good_pkg_by_name->parent->state_status == SS_INSTALLED
-                                   || good_pkg_by_name->parent->state_status == SS_UNPACKED;
+                int is_installed = good_pkg_by_name->state_status == SS_INSTALLED
+                                   || good_pkg_by_name->state_status == SS_UNPACKED;
                 if (!is_installed)
                     good_pkg_by_name = matching;
             } else
diff --git a/tests/Makefile b/tests/Makefile
index 27d7af1..709e91d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
 <at>  <at>  -67,6 +67,7  <at>  <at>  REGRESSION_TESTS := core/01_install.py \
 		    regress/issue9218.py \
 		    regress/issue9533.py \
 		    regress/issue9802.py \
+		    regress/issue9802b.py \
 		    misc/filehash.py \
 		    misc/update_loses_autoinstalled_flag.py
 RUN_TESTS := $(REGRESSION_TESTS:%.py=run-%.py)
diff --git a/tests/regress/issue9802b.py b/tests/regress/issue9802b.py
new file mode 100644
index 0000000..183320e
--- /dev/null
+++ b/tests/regress/issue9802b.py
 <at>  <at>  -0,0 +1,25  <at>  <at> 
+#!/usr/bin/env python
+
+import os
+import opk, cfg, opkgcl
+
+opk.regress_init()
+
+o = opk.OpkGroup()
+o.add(Package="a", Depends="b")
+o.add(Package="b", Version="1.0")
+o.add(Package="b", Version="2.0")
+o.write_opk()
+o.write_list()
+
+opkgcl.update()
+
+opkgcl.install("b_2.0_all.opk")
+if not opkgcl.is_installed("b", "2.0"):
+    opk.fail("Package 'b' failed to install")
+
+opkgcl.install("a")
+if not opkgcl.is_installed("a"):
+    opk.fail("Package 'a' failed to install")
+if not opkgcl.is_installed("b", "2.0"):
+    opk.fail("Package 'b' downgraded but downgrade was not necessary")
--

-- 
2.6.5

jatin jain | 21 Jun 14:28 2016
Picon

How to differentiate between network error and invalid url error while using "opkg update" command...?

Hello,

I am using "opkg update" command to download package file. If i get en 
error while doing this then how to know that error came due to network 
issue or due to invalid source url...? Are there some error codes defined 
in opkg..?

Thanks and Regards
Jatin

Michael Hansen | 21 Jun 01:22 2016
Picon

[PATCH] Regression: Don't print Installing message when --download-only is used

Signed-off-by: Michael Hansen <michael.j.hansen@...>
---
 libopkg/solvers/internal/opkg_install_internal.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libopkg/solvers/internal/opkg_install_internal.c b/libopkg/solvers/internal/opkg_install_internal.c
index 7bea861..d93787a 100644
--- a/libopkg/solvers/internal/opkg_install_internal.c
+++ b/libopkg/solvers/internal/opkg_install_internal.c
 <at>  <at>  -182,8 +182,10  <at>  <at>  int opkg_execute_install(pkg_t *pkg, pkg_vec_t *pkgs_to_install, pkg_vec_t *repl
                         dependency->state_status == SS_UNPACKED)
             continue;

-        opkg_msg(NOTICE, "%s %s (%s) on %s.\n", from_upgrade ? "Upgrading" : "Installing",
-                 dependency->name, dependency->version, dependency->dest->name);
+        if (!opkg_config->download_only) {
+            opkg_msg(NOTICE, "%s %s (%s) on %s.\n", from_upgrade ? "Upgrading" : "Installing",
+                     dependency->name, dependency->version, dependency->dest->name);
+        }

         /* Set all pkgs to auto_installed except the top level */
         if (dependency != pkg)
--

-- 
2.6.5

Michael Hansen | 20 Jun 20:57 2016
Picon

[PATCH] Fix 9802 by preferring installed versions when looking for satisfied deps

Signed-off-by: Michael Hansen <michael.j.hansen@...>
---
 libopkg/opkg_download.c                          |  1 +
 libopkg/pkg_hash.c                               |  9 +++++++--
 libopkg/pkg_hash.h                               |  2 +-
 libopkg/solvers/internal/opkg_install_internal.c |  1 +
 libopkg/solvers/internal/pkg_depends_internal.c  |  3 +++
 tests/Makefile                                   |  1 +
 tests/regress/issue9802.py                       | 25 ++++++++++++++++++++++++
 7 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 tests/regress/issue9802.py

diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
index 44efe33..d922ad3 100644
--- a/libopkg/opkg_download.c
+++ b/libopkg/opkg_download.c
 <at>  <at>  -455,6 +455,7  <at>  <at>  int opkg_prepare_url_for_install(const char *url, char **namep)
                         ab_pkg,
                         pkg_constraint_satisfied,
                         dependence_to_satisfy,
+                        0,
                         1);

                 free(dependence_to_satisfy);
diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index f0321f8..9d731f0 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
 <at>  <at>  -276,7 +276,7  <at>  <at>  abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name)

 pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                                                   int (*constraint_fcn) (pkg_t * pkg, void *cdata),
-                                                  void *cdata, int quiet)
+                                                  void *cdata, int prefer_installed, int quiet)
 {
     unsigned int i, j;
     unsigned int nprovides = 0;
 <at>  <at>  -443,6 +443,11  <at>  <at>  pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                 } else
                     opkg_msg(DEBUG, "%s %s wins by priority.\n",
                              good_pkg_by_name->name, good_pkg_by_name->version);
+            } else if (good_pkg_by_name && prefer_installed) {
+                int is_installed = good_pkg_by_name->parent->state_status == SS_INSTALLED
+                                   || good_pkg_by_name->parent->state_status == SS_UNPACKED;
+                if (!is_installed)
+                    good_pkg_by_name = matching;
             } else
                 good_pkg_by_name = matching;
         }
 <at>  <at>  -574,7 +579,7  <at>  <at>  pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(const char *name)
     if (!apkg)
         return NULL;

-    return pkg_hash_fetch_best_installation_candidate(apkg, NULL, NULL, 0);
+    return pkg_hash_fetch_best_installation_candidate(apkg, NULL, NULL, 0, 0);
 }

 pkg_t *pkg_hash_fetch_by_name_version(const char *pkg_name, const char *version)
diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h
index 897a774..e353d10 100644
--- a/libopkg/pkg_hash.h
+++ b/libopkg/pkg_hash.h
 <at>  <at>  -45,7 +45,7  <at>  <at>  pkg_t *pkg_hash_fetch_by_name_version(const char *pkg_name,
 abstract_pkg_t *abstract_pkg_fetch_by_name(const char *pkg_name);
 pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
                                                   int (*constraint_fcn)(pkg_t * pkg, void *data),
-                                                  void *cdata, int quiet);
+                                                  void *cdata, int prefer_installed, int quiet);
 pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(const char *name);
 pkg_t *pkg_hash_fetch_installed_by_name(const char *pkg_name);
 pkg_t *pkg_hash_fetch_installed_by_name_dest(const char *pkg_name,
diff --git a/libopkg/solvers/internal/opkg_install_internal.c b/libopkg/solvers/internal/opkg_install_internal.c
index 92a5f8b..7bea861 100644
--- a/libopkg/solvers/internal/opkg_install_internal.c
+++ b/libopkg/solvers/internal/opkg_install_internal.c
 <at>  <at>  -86,6 +86,7  <at>  <at>  static int opkg_prepare_install_by_name(const char *pkg_name, pkg_t **pkg)
                 ab_pkg,
                 pkg_constraint_satisfied,
                 dependence_to_satisfy,
+                0,
                 1);

         free(dependence_to_satisfy);
diff --git a/libopkg/solvers/internal/pkg_depends_internal.c b/libopkg/solvers/internal/pkg_depends_internal.c
index ad0a3c2..75a4de7 100644
--- a/libopkg/solvers/internal/pkg_depends_internal.c
+++ b/libopkg/solvers/internal/pkg_depends_internal.c
 <at>  <at>  -198,6 +198,7  <at>  <at>  int pkg_hash_fetch_unsatisfied_dependencies(pkg_t *pkg,
                     satisfying_apkg,
                     pkg_installed_and_constraint_satisfied,
                     dependence_to_satisfy,
+                    0,
                     1);
             opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
             if (satisfying_pkg != NULL) {
 <at>  <at>  -216,6 +217,7  <at>  <at>  int pkg_hash_fetch_unsatisfied_dependencies(pkg_t *pkg,
                         satisfying_apkg,
                         pkg_constraint_satisfied,
                         dependence_to_satisfy,
+                        0,
                         1);
                 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
                 if (!satisfying_pkg)
 <at>  <at>  -366,6 +368,7  <at>  <at>  pkg_vec_t *pkg_hash_fetch_satisfied_dependencies(pkg_t *pkg)
             pkg_t *satisfying_pkg = pkg_hash_fetch_best_installation_candidate(satisfying_apkg,
                                                            pkg_constraint_satisfied,
                                                            dependence_to_satisfy,
+                                                           1,
                                                            0);
             int need_to_insert = satisfying_pkg != NULL
                     && satisfying_pkg != pkg
diff --git a/tests/Makefile b/tests/Makefile
index 79d89b9..27d7af1 100644
--- a/tests/Makefile
+++ b/tests/Makefile
 <at>  <at>  -66,6 +66,7  <at>  <at>  REGRESSION_TESTS := core/01_install.py \
 		    regress/issue9059.py \
 		    regress/issue9218.py \
 		    regress/issue9533.py \
+		    regress/issue9802.py \
 		    misc/filehash.py \
 		    misc/update_loses_autoinstalled_flag.py
 RUN_TESTS := $(REGRESSION_TESTS:%.py=run-%.py)
diff --git a/tests/regress/issue9802.py b/tests/regress/issue9802.py
new file mode 100644
index 0000000..b85e8f5
--- /dev/null
+++ b/tests/regress/issue9802.py
 <at>  <at>  -0,0 +1,25  <at>  <at> 
+#!/usr/bin/env python
+
+import os
+import opk, cfg, opkgcl
+
+opk.regress_init()
+
+o = opk.OpkGroup()
+o.add(Package="a", Depends="b")
+o.add(Package="b", Version="1.0")
+o.add(Package="b", Version="2.0")
+o.write_opk()
+o.write_list()
+
+opkgcl.update()
+
+opkgcl.install("b_1.0_all.opk")
+if not opkgcl.is_installed("b", "1.0"):
+    opk.fail("Package 'b' failed to install")
+
+opkgcl.install("a")
+if not opkgcl.is_installed("a"):
+    opk.fail("Package 'a' failed to install")
+if not opkgcl.is_installed("b", "1.0"):
+    opk.fail("Package 'b' upgraded but upgrade was not necessary")
--

-- 
2.6.5

Alejandro del Castillo | 15 Jun 21:30 2016

Opkg-0.3.2 release

Hi all,

I am pleased to announce the release of opkg-0.3.2. The release is available at
the yocto project download page:

http://downloads.yoctoproject.org/releases/opkg/

On 0.3.2 libsolv support has proven to be stable enough to be promoted from
experimental to production quality. I am hoping more and more developers will
start using it as the solver backend, as my plan is to prioritize libsolv
support over the internal solver, moving forward.

Release notes for opkg-0.3.2
==========

- Remove configure script --enable-solver. To enable libsolv, add config option
  --with-libsolv.

- Add version constrain support for Replaces (issue 8931)

- Add targeted install support, enabling installation of a specific version of
  a package when multiple available (issue 76).

- Remove functions no longer used.

- Fix compare-version functionality (issue 166).

- Add disable_intercepts option (issue 8837)

- Add support for UTF-8 Package files (issue 9557)

Libsolv:

- Add pkg-config support

- Add --download-first option

- Fix crash when using more than 4 arch config options.

Internal Solver:

- Split internal solver from install/upgrade/remove transactions. Solving now
  happens first, instead of at the same time as installation/removal. New
  architecture fix issues 156 and 162.

- Abort installation if pkg A B is installed, and pkg A (Provides B,
  Conflicts B) is set to be installed (issue 9533)

- Skip dependency if a Provider is already installed (issue 9059)

- Fix status file corruption (issue 8601)

- Mark top level package as not AutoInstalled, when circular dependencies are
  present (issue 167)

--

-- 
Cheers,

Alejandro

Alejandro del Castillo | 15 Jun 00:51 2016

[PATCH 0/3] updates for 0.3.2 release

Final updates before release.

Alejandro del Castillo (3):
  opkg.conf.5: remove gpg_dir and gpg_trust_level help
  NEWS: update to v0.3.2
  configure.ac: bump version to 0.3.2

 NEWS               | 45 +++++++++++++++++++++++++++++++++++++++++++++
 configure.ac       |  2 +-
 man/opkg.conf.5.in | 13 -------------
 3 files changed, 46 insertions(+), 14 deletions(-)

--

-- 
1.9.1

Ankur Tank | 7 Jun 18:31 2016

Query regarding progress of installation in opkg install

Hello,

 

We are using opkg in or AM335x based custom board, We use opkg to upgrade the software of the board.

We need to know the progress of the installation and update the same to Web interface.

 

I learnt below from Alejandro in another mail conversion, (in quotes)

“opkg has an API that was created to do just that. You enable it via a configure option (--enable-libopkg-api), you can find the interface on libopkg/opkg.h.

The API is deprecated since it wasn't very well designed (layering violations between what belongs int the lbirary and what belongs to the frontend).

I haven't used it personally, but if you are willing to wrestle with it, I think it can do what you want.

I am writing this mail to

a.       To put conversion with Alejandro on the mailing list so that anyone with same question can benefit from it.

b.      If anyone has used above option and can give more details on how it works and all, that will help.

 

Meanwhile I will carry out test on my board and give an update about this.

 

Thank you,

 

Regards,

Ankur

 

L&T Technology Services Ltd

www.LntTechservices.com

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

--
You received this message because you are subscribed to the Google Groups "opkg-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opkg-devel+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Alejandro del Castillo | 3 Jun 23:51 2016

[opkg-utils PATCH] arfile.py: remove dependency on python-future

Python-future provides a python2 compatible object class (provides next
method). Since method is not used, remove dependency.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
---
 arfile.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arfile.py b/arfile.py
index 4bab526..1c42bc7 100644
--- a/arfile.py
+++ b/arfile.py
 <at>  <at>  -7,7 +7,6  <at>  <at>  of GNU General Public License v2 or later.
 """
 from __future__ import absolute_import
 from __future__ import print_function
-from builtins import object
 import sys
 import os
 import tarfile 
--

-- 
1.9.1

Alejandro del Castillo | 2 Jun 21:13 2016

Opkg 0.3.2 release plan

Hi all,

As I mentioned on a previous email, I plan to release opkg twice a year: on June
and on December. For the 0.3.2 release, I am planning on releasing on June 15.
While I have been testing the release, I would really appreciate community
testing to help make sure the release is solid.

This contributions on this release cycle:

Bryan Krause (2)
Ross Burton (3)
Simon Aittamaa (1)
Haris Okanovic (3)
Alejandro del Castillo (75)

--

-- 
Cheers,

Alejandro


Gmane