aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/opkg/files
diff options
context:
space:
mode:
authorGraham Gower <graham.gower@gmail.com>2010-06-29 18:54:00 +0000
committerKhem Raj <raj.khem@gmail.com>2010-08-03 13:02:24 -0700
commit11d08db8106e173599cf5efec58d2710c66bba51 (patch)
tree8319aa1b07152198f386fb8707d2b137734caf12 /recipes/opkg/files
parent060285f9fdb9bc0065f119a41edb15e0182c069c (diff)
downloadopenembedded-11d08db8106e173599cf5efec58d2710c66bba51.tar.gz
opkg recipe overhaul - removal of opkg-nogpg and opkg-nogpg-nocurl.
None of the distros in OE appear to want/need gpg or curl support in opkg; so have opkg.inc remove them by default. This diff makes things more consistent across all distros/tasks/images. The slugos recipe is kept intact and further divided from the more modern recipes. The opkg-native recipe is the sane-srcrev version even when building slugos, which should allow for changes to opkg related bbclasses without breaking the slugos build. Build tested for qemumipsel/minimal-image and nslu2/slugos-image. minimal-image builds 10% quicker in my setup and is 1mb smaller. Signed-off-by: Graham Gower <graham.gower@gmail.com> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes/opkg/files')
-rw-r--r--recipes/opkg/files/fix_endianness.patch12
-rw-r--r--recipes/opkg/files/isatty.patch64
-rw-r--r--recipes/opkg/files/opkg-intercept-cleanup.patch47
-rw-r--r--recipes/opkg/files/opkg-libdir.patch11
4 files changed, 111 insertions, 23 deletions
diff --git a/recipes/opkg/files/fix_endianness.patch b/recipes/opkg/files/fix_endianness.patch
deleted file mode 100644
index 8632ce5658..0000000000
--- a/recipes/opkg/files/fix_endianness.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN opkg.orig/configure.ac opkg/configure.ac
---- opkg.orig/configure.ac 2008-03-20 13:29:09.000000000 +0100
-+++ opkg/configure.ac 2008-03-25 09:39:52.000000000 +0100
-@@ -94,7 +94,7 @@
- AC_CHECK_MEMBERS([struct stat.st_rdev])
-
- # Checks endianness
--AC_C_BIGENDIAN(ENDIAN_CFLAGS="-DWORDS_BIGENDIAN=1",)
-+AC_C_BIGENDIAN(BIGENDIAN_CFLAGS="-DWORDS_BIGENDIAN=1",)
- AC_SUBST(BIGENDIAN_CFLAGS)
-
- # Don't do annoying tests that don't work when cross-compiling, just trust them.
diff --git a/recipes/opkg/files/isatty.patch b/recipes/opkg/files/isatty.patch
new file mode 100644
index 0000000000..c935f153d1
--- /dev/null
+++ b/recipes/opkg/files/isatty.patch
@@ -0,0 +1,64 @@
+Copyright (c) 2009 MontaVista Software, Inc. All rights reserved.
+
+Don't prompt for user input from stdin if it's not a tty. Fixes a minor
+memory leak while we're at it, as the code was strdup'ing the malloc'd string
+read from stdin without ever freeing the original.
+---
+ libopkg/libopkg.c | 13 ++++++++-----
+ libopkg/opkg_install.c | 3 +++
+ libopkg/user.c | 10 +++++++---
+ 3 files changed, 18 insertions(+), 8 deletions(-)
+
+--- trunk.orig/libopkg/libopkg.c
++++ trunk/libopkg/libopkg.c
+@@ -71,11 +71,14 @@ int default_opkg_status_callback(char *n
+ char* default_opkg_response_callback(char *question)
+ {
+ char *response = NULL;
+- printf("%s",question);
+- fflush(stdout);
+- do {
+- response = (char *)file_read_line_alloc(stdin);
+- } while (response == NULL);
++ if (isatty(fileno(stdin)))
++ {
++ printf("%s",question);
++ fflush(stdout);
++ do {
++ response = (char *)file_read_line_alloc(stdin);
++ } while (response == NULL);
++ }
+ return response;
+ }
+
+--- trunk.orig/libopkg/user.c
++++ trunk/libopkg/user.c
+@@ -44,9 +44,13 @@ char *get_user_response(const char *form
+ len = vsnprintf(question,question_len,format,ap);
+ va_end(ap);
+ } while (len > question_len);
+- response = strdup(opkg_cb_response(question));
+- str_chomp(response);
+- str_tolower(response);
++
++ response = opkg_cb_response(question);
++ if (response)
++ {
++ str_chomp(response);
++ str_tolower(response);
++ }
+
+ return response;
+ }
+--- trunk.orig/libopkg/opkg_install.c
++++ trunk/libopkg/opkg_install.c
+@@ -1613,6 +1613,9 @@ static int user_prefers_old_conffile(con
+ " D : show the differences between the versions (if diff is installed)\n"
+ " The default action is to keep your current version.\n"
+ " *** %s (Y/I/N/O/D) [default=N] ? ", file_name, short_file_name);
++ if (!response)
++ return 1;
++
+ if (strcmp(response, "y") == 0
+ || strcmp(response, "i") == 0
+ || strcmp(response, "yes") == 0) {
diff --git a/recipes/opkg/files/opkg-intercept-cleanup.patch b/recipes/opkg/files/opkg-intercept-cleanup.patch
new file mode 100644
index 0000000000..12893e3852
--- /dev/null
+++ b/recipes/opkg/files/opkg-intercept-cleanup.patch
@@ -0,0 +1,47 @@
+---
+ libopkg/opkg_cmd.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- trunk.orig/libopkg/opkg_cmd.c
++++ trunk/libopkg/opkg_cmd.c
+@@ -19,6 +19,7 @@
+ #include "includes.h"
+ #include <dirent.h>
+ #include <glob.h>
++#include <unistd.h>
+
+ #include "opkg_conf.h"
+ #include "opkg_cmd.h"
+@@ -350,7 +351,6 @@ static opkg_intercept_t opkg_prep_interc
+
+ static int opkg_finalize_intercepts(opkg_intercept_t ctx)
+ {
+- char *cmd;
+ DIR *dir;
+ int err = 0;
+
+@@ -376,6 +376,10 @@ static int opkg_finalize_intercepts(opkg
+ err = errno;
+ perror (de->d_name);
+ }
++ if (unlink (path)) {
++ err = errno;
++ perror (path);
++ }
+ }
+ free (path);
+ }
+@@ -383,9 +387,10 @@ static int opkg_finalize_intercepts(opkg
+ } else
+ perror (ctx->statedir);
+
+- sprintf_alloc (&cmd, "rm -rf %s", ctx->statedir);
+- err = system (cmd);
+- free (cmd);
++ if (rmdir (ctx->statedir)) {
++ err = errno;
++ perror (ctx->statedir);
++ }
+
+ free (ctx->statedir);
+ free (ctx);
diff --git a/recipes/opkg/files/opkg-libdir.patch b/recipes/opkg/files/opkg-libdir.patch
deleted file mode 100644
index 1d48b9a6bf..0000000000
--- a/recipes/opkg/files/opkg-libdir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- trunk/utils/update-alternatives.orig 2009-06-23 15:33:56.000000000 -0300
-+++ trunk/utils/update-alternatives 2009-06-23 15:34:10.000000000 -0300
-@@ -21,7 +21,7 @@
- set -e
-
- # admin dir
--ad="$OPKG_OFFLINE_ROOT/usr/lib/opkg/alternatives"
-+ad="$OPKG_OFFLINE_ROOT/${libdir}/opkg/alternatives"
-
- usage() {
- echo "update-alternatives: $*