Alejandro del Castillo | 3 May 01:11 2016

[PATCH] opkg-build: return error if Version is missing

If Version is missing in a control file, opkg-build reports an error to
stdout, but returns 0. Fix condition on pkg_appears_sane to properly
return an error if Version is missing.

Suggested-by: Thomas de Schampheleire <patrickdepinguin@...>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
---
 opkg-build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/opkg-build b/opkg-build
index 82a0a51..ebbf5a3 100755
--- a/opkg-build
+++ b/opkg-build
 <at>  <at>  -86,8 +86,9  <at>  <at>  You probably want to chown these to a system user: " >&2
 	pkg=`required_field Package`
 	[ "$?" -ne 0 ] && PKG_ERROR=1

-	version=`required_field Version | sed 's/Version://; s/^.://g;'`
+	version=`required_field Version`
 	[ "$?" -ne 0 ] && PKG_ERROR=1
+	version=`echo $version | sed 's/Version://; s/^.://g;'`

 	arch=`required_field Architecture`
 	[ "$?" -ne 0 ] && PKG_ERROR=1
--

-- 
1.9.1

Alejandro del Castillo | 28 Apr 01:01 2016

[PATCH] solvers/internal: skip dependencies that have a provider installed

During dependency processing, check if the dependency being processed
has a Provider already installed. If so, skip.

Fixes issue 9059.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
---
 libopkg/solvers/internal/opkg_install_internal.c | 10 ++++----
 libopkg/solvers/internal/opkg_solver_internal.c  | 32 ++++++++++++++++++++++++
 libopkg/solvers/internal/pkg_depends_internal.c  |  2 +-
 libopkg/solvers/internal/pkg_depends_internal.h  |  1 +
 4 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/libopkg/solvers/internal/opkg_install_internal.c b/libopkg/solvers/internal/opkg_install_internal.c
index f737e45..76f765c 100644
--- a/libopkg/solvers/internal/opkg_install_internal.c
+++ b/libopkg/solvers/internal/opkg_install_internal.c
 <at>  <at>  -195,12 +195,9  <at>  <at>  int opkg_install_by_name(const char *pkg_name)
     orphans = pkg_vec_alloc();

     r = internal_solver_solv(SOLVER_TRANSACTION_INSTALL, pkg, pkgs_to_install, replacees, orphans);
-    if (r < 0)
-        goto cleanup;
+    if (r == 0)
+        r = opkg_execute_install(pkg, pkgs_to_install, replacees, orphans, 0);

-    r = opkg_execute_install(pkg, pkgs_to_install, replacees, orphans, 0);
-
-cleanup:
     pkg_vec_free(pkgs_to_install);
(Continue reading)

Alejandro del Castillo | 28 Apr 00:59 2016

[PATCH 0/2] Fix for issue 9533

First patch implements fix for bugzilla issue 9533. Second patch improves
the logic used to detect conflicts.

Alejandro del Castillo (2):
  __pkg_hash_fetch_conflicts: prevent installation of pkg that    
    Provides/Conflicts an installed pkg
  __pkg_hash_fetch_conflictees: fix conflict logic

 libopkg/solvers/internal/pkg_depends_internal.c |  3 +-
 tests/Makefile                                  |  1 +
 tests/regress/issue9533.py                      | 37 +++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100755 tests/regress/issue9533.py

--

-- 
1.9.1

Stefan Agner | 21 Apr 00:17 2016
Picon

opkg tries to remove package twice

Hi,

While using the Ångström distribution we see issues when upgrading some
packages. Specifically, libjpeg8 seems to get handled strange: opkg
tries to remove the old package twice! I looked at the package metadata,
it doesn't seem to have anything unusual:

Package: libjpeg8
Version: 8d+1.4.1-r0.6
Depends: libc6 (>= 2.22)
Provides: libjpeg-turbo, jpeg
Replaces: jpeg
Conflicts: jpeg
Section: base
Architecture: armv7at2hf-vfp-neon
Maintainer: Angstrom Developers <angstrom-distro-devel@...>
MD5Sum: a7b348f7dd4a347d0f636ff9ada3a0ed
Size: 195454
Filename: libjpeg8_8d+1.4.1-r0.6_armv7at2hf-vfp-neon.ipk
Description:  libjpeg-turbo version 8d+1.4.1-r0  libjpeg-turbo is a
derivative of
 libjpeg that uses SIMD instructions   (MMX, SSE2, NEON) to accelerate
 baseline JPEG compression and   decompression
OE: libjpeg-turbo
HomePage: http://libjpeg-turbo.org/
License: BSD-3-Clause
Priority: optional

However, when this package gets upgraded, opkg tries to remove the old
package twice, and the second remove fails due to missing rm scripts
(Continue reading)

Stefan Agner | 20 Apr 20:23 2016
Picon

[PATCH] libopkg: fix compare-versions for equal versions

When comparing equal versions, the last descision of last resort
is the force_reinstall field of a package. However, when using
the compare-versions command, this field is not initialized
leading to random results. Initialize the package structs in
opkg_compare_versions_cmd makes sure that any field which might
be used during the version compare process is initialized with
zero and hence equal.

Signed-off-by: Stefan Agner <stefan@...>
---
 libopkg/opkg_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index 4aadbd5..45f2d73 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
 <at>  <at>  -1072,7 +1072,7  <at>  <at>  static int opkg_compare_versions_cmd(int argc, char **argv)
 {
     if (argc == 3) {
         /* this is a bit gross */
-        struct pkg p1, p2;
+        struct pkg p1 = {}, p2 = {};
         parse_version(&p1, argv[0]);
         parse_version(&p2, argv[2]);
         return pkg_version_satisfied(&p1, &p2, argv[1]);
--

-- 
2.8.0

(Continue reading)

Denys Dmytriyenko | 12 Apr 18:09 2016
Gravatar

[PATCH] opkg-build: re-do find/ls code to not fail on filenames with spaces

From: Denys Dmytriyenko <denys@...>

Signed-off-by: Denys Dmytriyenko <denys@...>
---
 opkg-build | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/opkg-build b/opkg-build
index a9ccad2..82a0a51 100755
--- a/opkg-build
+++ b/opkg-build
 <at>  <at>  -6,7 +6,6  <at>  <at> 
 # 2003-04-25 rea@...
 #   Updated to work on Familiar Pre0.7rc1, with busybox tar.
 #   Note it Requires: binutils-ar (since the busybox ar can't create)
-#   For UID debugging it needs a better "find".
 set -e

 version=1.0
 <at>  <at>  -47,12 +46,12  <at>  <at>  pkg_appears_sane() {

 	PKG_ERROR=0

-	tilde_files=`find . -name '*~'`
+	tilde_files=`find . -name '*~' -ls -printf '\\\n'`
 	if [ -n "$tilde_files" ]; then
 	    if [ "$noclean" = "1" ]; then
 		echo "*** Warning: The following files have names ending in '~'.
 You probably want to remove them: " >&2
-		ls -ld $tilde_files
(Continue reading)

jatin jain | 12 Apr 07:44 2016
Picon

Getting "unrecognized option" error while using command opkg update

Hello,

I am using command    "opkg update" and i am going the following error -

wget: server returned error: HTTP/1.1 403 Forbidden
Collected errors:
 * opkg_conf_set_option: Unrecognized option: ssl_key=/home/key
 * opkg_conf_set_option: Unrecognized option: ssl_key_type=PEM
 * opkg_conf_set_option: Unrecognized option: ssl_cert=/home/cert
 * opkg_conf_set_option: Unrecognized option: ssl_cert_type=PEM
 * opkg_conf_set_option: Unrecognized option: ssl_key_passwd=home/pass
 * opkg_conf_set_option: Unrecognized option: ssl_ca_file=/home/ca_file/ca.pem
 * opkg_conf_set_option: Unrecognized option: ssl_ca_path=/home/ca_file

i have build opkg with folllowing configure options


./configure --prefix=/usr --enable-sha256=yes --enable-openssl=yes --enable-ssl-curl=yes 


and in opkg.conf file i have done following setting

dest root /
option lists_dir /opt//snapshot
option cache_dir /opt//download
option ssl_key /home/key
option ssl_key_type PEM
option ssl_cert /home/cert
option ssl_cert_type PEM
option ssl_key_passwd home/pass
option ssl_ca_file /home/ca_file/ca.pem
option ssl_ca_path /home/ca_file
src remote https://172.231.56.89:/home


Regards
Jatin Jain

--
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.
Aníbal Limón | 1 Apr 18:12 2016
Picon

[PATCH] opkg-build: Exit when fail to list files.

We have an issue when ls segfaults in some cases [1] so it's
better to detect the failure at this level instead of continue
the build process.

[YOCTO #8926]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0

Signed-off-by: Aníbal Limón <anibal.limon@...>
---
 opkg-build | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/opkg-build b/opkg-build
index 98008b6..a9ccad2 100755
--- a/opkg-build
+++ b/opkg-build
 <at>  <at>  -53,6 +53,10  <at>  <at>  pkg_appears_sane() {
 		echo "*** Warning: The following files have names ending in '~'.
 You probably want to remove them: " >&2
 		ls -ld $tilde_files
+		if [ $? -ne 0 ]; then
+			echo "*** Error: Fail to list files have names ending in '~'."
+			exit 1
+		fi
 		echo >&2
 	    else
 		echo "*** Removing the following files: $tilde_files"
 <at>  <at>  -66,6 +70,10  <at>  <at>  You probably want to remove them: " >&2
 		echo "*** Warning: The following files have a UID greater than 99.
 You probably want to chown these to a system user: " >&2
 		ls -ld $large_uid_files
+		if [ $? -ne 0 ]; then
+			echo "*** Error: Fail to list files have a UID greater than 99."
+			exit 1
+		fi
 		echo >&2
 	fi
 	    
-- 
2.1.4

--

-- 
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@...
For more options, visit https://groups.google.com/d/optout.

Alejandro del Castillo | 25 Mar 22:25 2016

[PATCH] opkg-utils: remove opkg-compare-versions implementations

Currently, there are three compare-versions implementations:

1) opkg-utils: opkg-compare-versions.c
2) opkg-utils: opkg-compare-versions.sh
3) opkg: internal

To avoid confusion and avoid maintaining three codebases, remove the
compare-versions functionality from opkg-utils and only keep the
implementation on the opkg binary.

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@...>
---
 Makefile                 |  16 ++---
 opkg-compare-versions.c  | 158 -----------------------------------------------
 opkg-compare-versions.sh |  77 -----------------------
 3 files changed, 6 insertions(+), 245 deletions(-)
 delete mode 100644 opkg-compare-versions.c
 delete mode 100755 opkg-compare-versions.sh

diff --git a/Makefile b/Makefile
index b045028..23aebbe 100644
--- a/Makefile
+++ b/Makefile
 <at>  <at>  -1,19 +1,15  <at>  <at> 
-UTILS = opkg-build opkg-unbuild opkg-compare-versions opkg-make-index opkg.py \
-        opkg-list-fields arfile.py opkg-buildpackage opkg-diff opkg-extract-file opkg-show-deps \
-        opkg-compare-indexes opkg-compare-versions.sh update-alternatives
+UTILS = opkg-build opkg-unbuild opkg-make-index opkg.py opkg-list-fields \
+	arfile.py opkg-buildpackage opkg-diff opkg-extract-file opkg-show-deps \
+	opkg-compare-indexes update-alternatives

 DESTDIR=
 PREFIX=/usr/local
 bindir=$(PREFIX)/bin

-all: opkg-compare-versions
+all:

-opkg-compare-versions: opkg-compare-versions.c
-	$(CC) $(CFLAGS) -o opkg-compare-versions opkg-compare-versions.c
-
-install: opkg-compare-versions
+install: 
 	install -d $(DESTDIR)$(bindir)
 	install -m 755 $(UTILS) $(DESTDIR)$(bindir)

-clean:
-	rm -rf opkg-compare-versions
+.PHONY: install all
diff --git a/opkg-compare-versions.c b/opkg-compare-versions.c
deleted file mode 100644
index 62851fa..0000000
--- a/opkg-compare-versions.c
+++ /dev/null
 <at>  <at>  -1,158 +0,0  <at>  <at> 
-/*
- * libdpkg - Debian packaging suite library routines
- * vercmp.c - comparison of version numbers
- *
- * Copyright (C) 1995 Ian Jackson <iwj10@...>
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2,
- * or (at your option) any later version.
- *
- * This is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with dpkg; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-# define _(Text) Text
-
-struct versionrevision {
-  unsigned long epoch;
-  char *version;
-  const char *revision;
-};  
-
-/* assume ascii; warning: evaluates x multiple times! */
-#define order(x) ((x) == '~' ? -1 \
-		: isdigit((x)) ? 0 \
-		: !(x) ? 0 \
-		: isalpha((x)) ? (x) \
-		: (x) + 256)
-
-static int
-verrevcmp(const char *val, const char *ref) {
-  if (!val) val= "";
-  if (!ref) ref= "";
-
-  while (*val || *ref) {
-    int first_diff= 0;
-
-    while ( (*val && !isdigit(*val)) || (*ref && !isdigit(*ref)) ) {
-      int vc= order(*val), rc= order(*ref);
-      if (vc != rc) return vc - rc;
-      val++; ref++;
-    }
-
-    while ( *val == '0' ) val++;
-    while ( *ref == '0' ) ref++;
-    while (isdigit(*val) && isdigit(*ref)) {
-      if (!first_diff) first_diff= *val - *ref;
-      val++; ref++;
-    }
-    if (isdigit(*val)) return 1;
-    if (isdigit(*ref)) return -1;
-    if (first_diff) return first_diff;
-  }
-  return 0;
-}
-
-int versioncompare(const struct versionrevision *version,
-                   const struct versionrevision *refversion) 
-{
-  int r;
-
-  if (version->epoch > refversion->epoch) return 1;
-  if (version->epoch < refversion->epoch) return -1;
-  r= verrevcmp(version->version,refversion->version);  if (r) return r;
-  r= verrevcmp(version->revision,refversion->revision); if (r) return r;
-  return r;
-}
-
-int versionsatisfied3(const struct versionrevision *it,
-                      const struct versionrevision *ref,
-                      const char *op) 
-{
-  int r;
-  r= versioncompare(it,ref);
-  if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0)
-    return r <= 0;
-  if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0)
-    return r >= 0;
-  if (strcmp(op, "<<") == 0)
-    return r < 0;
-  if (strcmp(op, ">>") == 0)
-    return r > 0;
-  if (strcmp(op, "=") == 0)
-    return r == 0;
-  fprintf(stderr, "unknown operator: %s", op);
-
-  exit(1);
-}
-
-const char *parseversion(struct versionrevision *rversion, const char *string) 
-{
-  char *hyphen, *colon, *eepochcolon;
-  unsigned long epoch;
-
-  if (!*string) return _("version string is empty");
-  
-  colon= strchr(string,':');
-  if (colon) {
-    epoch= strtoul(string,&eepochcolon,10);
-    if (colon != eepochcolon) return _("epoch in version is not number");
-    if (!*++colon) return _("nothing after colon in version number");
-    string= colon;
-    rversion->epoch= epoch;
-  } else {
-    rversion->epoch= 0;
-  }
-
-  rversion->revision = "";
-
-  rversion->version= malloc(strlen(string)+1);
-  strcpy(rversion->version, string);
-
-#if 0
-  fprintf(stderr,"Parsed version: %lu, %s\n",
-	  rversion->epoch,
-	  rversion->version);
-#endif
-	  
-  return 0;
-}
-
-int main(int argc, char *argv[]) 
-{
-  const char *err;
-  struct versionrevision ver, ref;
-
-  if (argc < 4) {
-    fprintf(stderr, "usage: %s: version op refversion\n", argv[0]);
-    return 2;
-  }
-
-  err = parseversion(&ver, argv[1]);
-  if (err) {
-    fprintf(stderr, "Invalid version `%s': %s\n", argv[1], err);
-    return 2;
-  }
-    
-  err = parseversion(&ref, argv[3]);
-  if (err) {
-    fprintf(stderr, "Invalid version `%s': %s\n", argv[3], err);
-    return 2;
-  }
-
-  return ! versionsatisfied3(&ver, &ref, argv[2]);
-}
-
-
diff --git a/opkg-compare-versions.sh b/opkg-compare-versions.sh
deleted file mode 100755
index 1f092d7..0000000
--- a/opkg-compare-versions.sh
+++ /dev/null
 <at>  <at>  -1,77 +0,0  <at>  <at> 
-#!/bin/sh
-set -e
-
-# This is a little experiment to see how expensive it would be to
-# compare versions in a shell script. This script is not done yet
-# and the nasiest part is still left undone, (the fact that in Debian
-# versions all letters compare less than all non-letters).
-#
-# It looks to me like version comprehension might be the feature that pushes 
-# opkg from /bin/sh to compiled C code...
-
-if [ $# -lt 3 ]; then
-	echo "
-usage: opkg-compare-versions v1 op v2
-	where op in (<<, <=, =, >=, >>)
-Return value is 0 if v1 op v2 is satisfied, 1 otherwise"
-	exit 2
-fi
-
-v1=$1
-op=$2
-v2=$3
-
-# Debian has a little historical problem with operators...
-may_be_equal=0
-case $op in
-'>>')
-	op="-gt"
-;;
-'<<')
-	op="-lt"
-;;
-'>'|'>=')
-	op="-gt"
-	may_be_equal=1
-;;
-'<'|'<=')
-	op="-lt"
-	may_be_equal=1
-;;
-'=')
-	may_be_equal=1
-;;
-*)
-	echo "opkg_compare_versions: Invalid operator \`$op' valid operators are (<<, <=, =, >=, >>)"
-	exit 1
-;;
-esac
-
-if [ $may_be_equal == 1 -a $v1 == $v2 ]; then
-	exit 0;
-elif [ $op == '=' ]; then
-	exit 1;
-fi
-
-epoch1=`echo $v1 | sed -ne 's/:.*//p'`
-v1=`echo $v1 | sed -e 's/^[^:]*://'`
-epoch2=`echo $v2 | sed -ne 's/:.*//p'`
-v2=`echo $v2 | sed -e 's/^[^:]*://'`
-
-upstream1=`echo $v1 | sed -e '/-/s/\(.*\)-.*/\1/'`
-debian_rev1=`echo $v1 | sed -ne 's/.*-//p'`
-upstream2=`echo $v2 | sed -e '/-/s/\(.*\)-.*/\1/'`
-debian_rev2=`echo $v2 | sed -ne 's/.*-//p'`
-
-echo "$epoch1:$upstream1-$debian_rev1 $op $epoch2:$upstream2-$debian_rev2"
-
-exit 3
-
-[ -z $epoch1 ] && epoch1="0"
-[ -z $epoch2 ] && epoch2="0"
-
-if [ $epoch1 != $epoch2 ]; then
-	exit `[ $epoch1 $op $epoch2 ]`
-fi
-
-exit 3
--

-- 
1.9.1

Alejandro del Castillo | 25 Mar 21:17 2016

[PATCH] Allow opkg compare-versions to run as unprivileged user

This patch skips the conf file load on the compare-versions case. However, 
there is a broader problem of opkg requiring root access for all it's 
operations, not only for the ones that require installing/removing files.

Created bugzilla #9348 to allow unprivileged users run read-only opkg
operations.

Alejandro del Castillo (1):
  main: skip conf file load on compare-versions operation

 src/opkg.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--

-- 
1.9.1

mark.van.der.putten | 24 Mar 10:48 2016
Picon

orphaned, removing

Regarding opkg v0.2.4 and opkg v0.3.0.

opkg detects that a package is auto installed and is orphaned, then it deletes the package.

This happens with 
- opkg install <package>
- opkg upgrade

This could be a correct decision or not, but I would like to disable auto-removing. Can this be configured?

While using search engines, I can not find a yes or no to this question?  

Opkg Message:
coreutils was autoinstalled and is now orphaned, removing.


Gmane