opendreambox/opkg: use stable r180 but include backport of r196
authorMoritz Venn <moritz.venn@freaque.net>
Mon, 19 Jan 2009 13:44:28 +0000 (14:44 +0100)
committerMoritz Venn <moritz.venn@freaque.net>
Mon, 19 Jan 2009 13:44:28 +0000 (14:44 +0100)
conf/distro/opendreambox.conf
packages/opkg/files/r196.diff [new file with mode: 0644]
packages/opkg/opkg.inc

index f182027..fdddb9a 100644 (file)
@@ -50,6 +50,12 @@ PREFERRED_VERSION_binutils ?= "2.18.50.0.7"
 PREFERRED_VERSION_linux-libc-headers ?= "2.6.12.0"
 PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers"
 
+# Newer Versions crash on fork and this is declared the current "stable"
+# version anyway. Overriding sane-srcrev is dangerous though.
+SRCREV_pn-opkg = "180"
+SRCREV_pn-opkg-native = "180"
+SRCREV_pn-opkg-sdk = "180"
+
 PREFERRED_VERSION_automake ?= "1.10"
 PREFERRED_VERSION_automake-native ?= "1.10"
 
diff --git a/packages/opkg/files/r196.diff b/packages/opkg/files/r196.diff
new file mode 100644 (file)
index 0000000..fd82fdb
--- /dev/null
@@ -0,0 +1,75 @@
+diff -auNr opkg-r180/libopkg/opkg_conf.c opkg-r180+r196/libopkg/opkg_conf.c
+--- opkg-r180/libopkg/opkg_conf.c      2009-01-17 12:29:50.000000000 +0100
++++ opkg-r180+r196/libopkg/opkg_conf.c 2009-01-17 14:03:57.000000000 +0100
+@@ -646,22 +646,20 @@
+ int opkg_conf_write_status_files(opkg_conf_t *conf)
+ {
+-     pkg_dest_list_elt_t *iter;
+      pkg_dest_t *dest;
+      pkg_vec_t *all;
+      pkg_t *pkg;
+      register int i;
+      int err;
++     FILE * status_file = NULL;
+      if (conf->noaction)
+         return 0;
+-     for (iter = conf->pkg_dest_list.head; iter; iter = iter->next) {
+-        dest = iter->data;
+-        dest->status_file = fopen(dest->status_file_tmp_name, "w");
+-        if (dest->status_file == NULL) {
+-             fprintf(stderr, "%s: Can't open status file: %s for writing: %s\n",
+-                     __FUNCTION__, dest->status_file_name, strerror(errno));
+-        }
++     dest = (pkg_dest_t *)(conf->pkg_dest_list.head)->data;
++     status_file = fopen(dest->status_file_tmp_name, "w");
++     if (status_file == NULL) {
++          fprintf(stderr, "%s: Can't open status file: %s for writing: %s\n",
++                    __FUNCTION__, dest->status_file_tmp_name, strerror(errno));
+      }
+      all = pkg_vec_alloc();
+@@ -685,29 +683,25 @@
+                      __FUNCTION__, pkg->name);
+              continue;
+         }
+-        if (pkg->dest->status_file) {
+-             pkg_print_status(pkg, pkg->dest->status_file);
++        if (status_file) {
++             pkg_print_status(pkg, status_file);
+         }
+      }
+      pkg_vec_free(all);
+-     for (iter = conf->pkg_dest_list.head; iter; iter = iter->next) {
+-        dest = iter->data;
+-        if (dest->status_file) {
+-             err = ferror(dest->status_file);
+-             fclose(dest->status_file);
+-             dest->status_file = NULL;
+-             if (!err) {
+-                  file_move(dest->status_file_tmp_name, dest->status_file_name);
+-             } else {
+-                  fprintf(stderr, "%s: ERROR: An error has occurred writing %s, "
+-                          "retaining old %s\n", __FUNCTION__, 
+-                          dest->status_file_tmp_name, dest->status_file_name);
+-             }
+-        }
++    if (status_file) {
++          err = ferror(status_file);
++          fclose(status_file);
++          if (!err) {
++              file_move(dest->status_file_tmp_name, dest->status_file_name);
++          } else {
++               fprintf(stderr, "%s: ERROR: An error has occurred writing %s, "
++                    "retaining old %s\n", __FUNCTION__,
++                    dest->status_file_tmp_name, dest->status_file_name);
++          }
++          status_file = NULL;
+      }
+-
+      return 0;
+ }
index b586e70..89957d5 100644 (file)
@@ -8,6 +8,9 @@ PV = "0.1.6+svnr${SRCREV}"
 SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http"
 S = "${WORKDIR}/trunk"
 
+# We use an older version in opendreambox but the fix from r196 is important
+SRC_URI_append_opendreambox = " file://r196.diff;patch=1"
+
 inherit autotools pkgconfig
 
 do_stage() {