upgrade opkg to r215 from the googlecode svn

SVN-Revision: 17152
This commit is contained in:
Imre Kaloz 2009-08-06 20:08:27 +00:00
parent 21d2934f38
commit e8ce7fab52
6 changed files with 36 additions and 163 deletions

View File

@ -7,14 +7,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=opkg PKG_NAME:=opkg
PKG_REV:=4993 PKG_REV:=215
PKG_VERSION:=$(PKG_REV) PKG_VERSION:=$(PKG_REV)
PKG_RELEASE:=4 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=svn PKG_SOURCE_PROTO:=svn
PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION) PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION)
PKG_SOURCE_URL:=http://svn.openmoko.org/trunk/src/target/opkg/ PKG_SOURCE_URL:=http://opkg.googlecode.com/svn/trunk/
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_FIXUP = libtool PKG_FIXUP = libtool
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -37,7 +37,7 @@ define Package/opkg/description
endef endef
define Package/opkg/conffiles define Package/opkg/conffiles
/etc/opkg.conf /etc/opkg/opkg.conf
endef endef
TARGET_CFLAGS += $(FPIC) $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds) TARGET_CFLAGS += $(FPIC) $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
@ -67,8 +67,9 @@ define Package/opkg/install
$(INSTALL_DIR) $(1)/usr/lib/opkg $(INSTALL_DIR) $(1)/usr/lib/opkg
$(INSTALL_DIR) $(1)/bin $(INSTALL_DIR) $(1)/bin
$(INSTALL_DIR) $(1)/etc $(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) ./files/opkg.conf $(1)/etc/ $(INSTALL_DIR) $(1)/etc/opkg
$(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/opkg/
$(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg/opkg.conf
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopkg.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopkg.so.* $(1)/usr/lib/

View File

@ -1,105 +0,0 @@
diff -urN opkg-4993/configure.ac opkg-4993.new/configure.ac
--- opkg-4993/configure.ac 2009-05-17 18:15:52.000000000 +0200
+++ opkg-4993.new/configure.ac 2009-05-17 18:17:09.000000000 +0200
@@ -26,9 +26,16 @@
# Checks for libraries
-# check for libcurl
-PKG_CHECK_MODULES(CURL, libcurl)
+AC_ARG_ENABLE(curl,
+ AC_HELP_STRING([--enable-curl], [Enable use of libcurl instead of wget
+ [[default=yes]] ]),
+ [want_curl="$enableval"], [want_curl="yes"])
+if test "x$want_curl" = "xyes"; then
+ # check for libcurl
+ PKG_CHECK_MODULES(CURL, libcurl)
+ AC_DEFINE(HAVE_CURL, 1, [Define if you want to use libcurl instead of wget])
+fi
dnl **********
diff -urN opkg-4993/libopkg/opkg.c opkg-4993.new/libopkg/opkg.c
--- opkg-4993/libopkg/opkg.c 2009-05-17 18:15:50.000000000 +0200
+++ opkg-4993.new/libopkg/opkg.c 2009-05-17 18:17:09.000000000 +0200
@@ -1019,8 +1019,9 @@
return package;
}
-
+#ifdef HAVE_CURL
#include <curl/curl.h>
+#endif
/**
* @brief Check the accessibility of repositories. It will try to access the repository to check if the respository is accessible throught current network status.
* @param opkg The opkg_t
@@ -1070,6 +1071,7 @@
repositories--;
err = opkg_download(opkg->conf, iter1->data, "/dev/null", NULL, NULL);
+ #ifdef HAVE_CURL
if (!(err == CURLE_OK ||
err == CURLE_HTTP_RETURNED_ERROR ||
err == CURLE_FILE_COULDNT_READ_FILE ||
@@ -1078,6 +1080,7 @@
)) {
ret++;
}
+ #endif
str_list_elt_deinit(iter1);
free(iter1);
}
diff -urN opkg-4993/libopkg/opkg_download.c opkg-4993.new/libopkg/opkg_download.c
--- opkg-4993/libopkg/opkg_download.c 2009-05-17 18:15:50.000000000 +0200
+++ opkg-4993.new/libopkg/opkg_download.c 2009-05-17 18:17:09.000000000 +0200
@@ -17,7 +17,9 @@
General Public License for more details.
*/
#include "config.h"
+#ifdef HAVE_CURL
#include <curl/curl.h>
+#endif
#ifdef HAVE_GPGME
#include <gpgme.h>
#endif
@@ -77,6 +79,7 @@
setenv("no_proxy", conf->no_proxy, 1);
}
+#ifdef HAVE_CURL
CURL *curl;
CURLcode res;
FILE * file = fopen (tmp_file_location, "w");
@@ -123,6 +126,31 @@
free(src_basec);
return -1;
}
+#else /* if wget is selected */
+ char *cmd;
+ /* XXX: BUG rewrite to use execvp or else busybox's internal wget -Jamey 7/23/2002 */
+ sprintf_alloc(&cmd, "wget --passive-ftp %s %s%s %s%s -P %s %s",
+ (conf->http_proxy || conf->ftp_proxy) ? "--proxy=on" : "",
+ conf->proxy_user ? "--proxy-user=" : "",
+ conf->proxy_user ? conf->proxy_user : "",
+ conf->proxy_passwd ? "--proxy-passwd=" : "",
+ conf->proxy_passwd ? conf->proxy_passwd : "",
+ conf->tmp_dir,
+ src);
+ err = xsystem(cmd);
+ if (err) {
+ if (err != -1) {
+ opkg_message(conf,OPKG_ERROR, "%s: ERROR: Command failed with return value %d: `%s'\n",
+ __FUNCTION__, err, cmd);
+ }
+ unlink(tmp_file_location);
+ free(tmp_file_location);
+ free(src_basec);
+ free(cmd);
+ return EINVAL;
+ }
+ free(cmd);
+#endif
err = file_move(tmp_file_location, dest_file_name);

View File

@ -1,24 +0,0 @@
diff -urN opkg-4993/libopkg/opkg_cmd.c opkg-4993.new/libopkg/opkg_cmd.c
--- opkg-4993/libopkg/opkg_cmd.c 2009-05-17 18:15:50.000000000 +0200
+++ opkg-4993.new/libopkg/opkg_cmd.c 2009-05-17 18:19:50.000000000 +0200
@@ -289,9 +289,6 @@
unlink (tmp_file_name);
free (tmp_file_name);
free (url);
-#else
- opkg_message (conf, OPKG_NOTICE, "Signature check for %s skipped "
- "because GPG support was not enabled in this build\n", src->name);
#endif
free(list_file_name);
}
diff -urN opkg-4993/libopkg/opkg_download.c opkg-4993.new/libopkg/opkg_download.c
--- opkg-4993/libopkg/opkg_download.c 2009-05-17 18:20:17.000000000 +0200
+++ opkg-4993.new/libopkg/opkg_download.c 2009-05-17 18:19:10.000000000 +0200
@@ -374,7 +374,6 @@
return status;
#else
- opkg_message (conf, OPKG_NOTICE, "Signature check for %s was skipped because GPG support was not enabled in this build\n");
return 0;
#endif
}

View File

@ -6,8 +6,8 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
--- a/libopkg/opkg_conf.c --- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c +++ b/libopkg/opkg_conf.c
@@ -64,6 +64,7 @@ int opkg_init_options_array(const opkg_c @@ -70,6 +70,7 @@ int opkg_init_options_array(const opkg_c
{ "offline_root", OPKG_OPT_TYPE_STRING, &conf->offline_root }, { "offline_root_path", OPKG_OPT_TYPE_STRING, &conf->offline_root_path },
{ "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd }, { "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd },
{ "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd }, { "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd },
+ { "overlay_root", OPKG_OPT_TYPE_STRING, &conf->overlay_root }, + { "overlay_root", OPKG_OPT_TYPE_STRING, &conf->overlay_root },
@ -16,8 +16,8 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
{ "query-all", OPKG_OPT_TYPE_BOOL, &conf->query_all }, { "query-all", OPKG_OPT_TYPE_BOOL, &conf->query_all },
--- a/libopkg/opkg_conf.h --- a/libopkg/opkg_conf.h
+++ b/libopkg/opkg_conf.h +++ b/libopkg/opkg_conf.h
@@ -67,6 +67,7 @@ struct opkg_conf @@ -70,6 +70,7 @@ struct opkg_conf
char *offline_root; char *offline_root_path;
char *offline_root_pre_script_cmd; char *offline_root_pre_script_cmd;
char *offline_root_post_script_cmd; char *offline_root_post_script_cmd;
+ char *overlay_root; + char *overlay_root;
@ -26,35 +26,36 @@ Signed-off-by: Nicolas Thill <nico@openwrt.org>
int noaction; int noaction;
--- a/libopkg/opkg_install.c --- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c
@@ -524,10 +524,13 @@ static int verify_pkg_installable(opkg_c @@ -474,12 +474,15 @@ static int verify_pkg_installable(opkg_c
* my diddling with the .opk file size below isn't going to cut it. * my diddling with the .opk file size below isn't going to cut it.
* 3) return a proper error code instead of 1 * 3) return a proper error code instead of 1
*/ */
- int comp_size, blocks_available; - int comp_size, blocks_available;
-
+ int comp_size, blocks_available = -1; + int comp_size, blocks_available = -1;
+ char *root_dir;
if (!conf->force_space && pkg->installed_size != NULL) { if (!conf->force_space && pkg->installed_size != NULL) {
- blocks_available = get_available_blocks(conf->default_dest->root_dir); root_dir = pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir;
+ if (conf->overlay_root != NULL) - blocks_available = get_available_blocks(root_dir);
+ blocks_available = get_available_blocks(conf->overlay_root); + if (conf->overlay_root != NULL)
+ if (blocks_available < 0) + blocks_available = get_available_blocks(conf->overlay_root);
+ blocks_available = get_available_blocks(conf->default_dest->root_dir); + if (blocks_available < 0)
+ blocks_available = get_available_blocks(root_dir);
comp_size = strtoul(pkg->installed_size, NULL, 0); comp_size = strtoul(pkg->installed_size, NULL, 0);
/* round up a blocks count without doing fancy-but-slow casting jazz */ /* round up a blocks count without doing fancy-but-slow casting jazz */
--- a/libopkg/opkg_utils.c --- a/libopkg/opkg_utils.c
+++ b/libopkg/opkg_utils.c +++ b/libopkg/opkg_utils.c
@@ -30,10 +30,8 @@ int get_available_blocks(char * filesyst @@ -30,10 +30,8 @@ long unsigned int get_available_blocks(c
{ {
struct statfs sfs; struct statfs sfs;
- if(statfs(filesystem, &sfs)){ - if(statfs(filesystem, &sfs)){
- fprintf(stderr, "bad statfs\n"); - fprintf(stderr, "bad statfs\n");
- return 0; - return 0;
- } - }
+ if(statfs(filesystem, &sfs)) + if(statfs(filesystem, &sfs))
+ return -1; + return -1;
/* fprintf(stderr, "reported fs type %x\n", sfs.f_type); */ /* fprintf(stderr, "reported fs type %x\n", sfs.f_type); */
return ((sfs.f_bavail * sfs.f_bsize) / 1024);
} // Actually ((sfs.f_bavail * sfs.f_bsize) / 1024)

View File

@ -10,11 +10,11 @@
--- a/libopkg/Makefile.am --- a/libopkg/Makefile.am
+++ b/libopkg/Makefile.am +++ b/libopkg/Makefile.am
@@ -1,5 +1,6 @@ @@ -1,5 +1,5 @@
-
-AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) -AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS)
+HOST_CPU=@host_cpu@ +HOST_CPU=@host_cpu@
+AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"$(HOST_CPU)\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS) +AM_CFLAGS=-Wall -Werror -DHOST_CPU_STR=\"$(HOST_CPU)\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DOPKGETCDIR=\"@opkgetcdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir) $(BIGENDIAN_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS)
libopkg_includedir=$(includedir)/libopkg libopkg_includedir=$(includedir)/libopkg
libopkg_include_HEADERS= opkg.h libopkg_include_HEADERS= opkg.h

View File

@ -1,6 +1,6 @@
--- a/libopkg/pkg_hash.c --- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c
@@ -367,8 +367,11 @@ pkg_t *pkg_hash_fetch_best_installation_ @@ -363,8 +363,11 @@ pkg_t *pkg_hash_fetch_best_installation_
abstract_pkg_t *apkg = NULL; abstract_pkg_t *apkg = NULL;
pkg_t *ret; pkg_t *ret;