From a58f176ef2367f000a60a5ce477beb3cbdedf82e Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 21 Nov 2016 15:14:02 +0100 Subject: [PATCH] opkg: set PKG_UPGRADE also when running scripts for the old package Allow scripts from the package to be upgraded to be aware of being upgraded. Signed-off-by: Jonas Gorski Acked-by: Jo-Philipp Wich --- package/system/opkg/Makefile | 2 +- package/system/opkg/patches/007-force_static.patch | 10 +++++----- package/system/opkg/patches/110-upgrade.patch | 9 +++++---- package/system/opkg/patches/200-usign_support.patch | 2 +- .../system/opkg/patches/220-drop-release-support.patch | 8 ++++---- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 34db3d1706..5b96fea004 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -13,7 +13,7 @@ include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg PKG_REV:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d PKG_VERSION:=$(PKG_REV) -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_REV) diff --git a/package/system/opkg/patches/007-force_static.patch b/package/system/opkg/patches/007-force_static.patch index 38cdb7a869..74977070c3 100644 --- a/package/system/opkg/patches/007-force_static.patch +++ b/package/system/opkg/patches/007-force_static.patch @@ -1,6 +1,6 @@ --- a/libopkg/Makefile.am +++ b/libopkg/Makefile.am -@@ -38,16 +38,10 @@ +@@ -38,16 +38,10 @@ if HAVE_SHA256 opkg_util_sources += sha256.c sha256.h endif @@ -22,7 +22,7 @@ +libopkg_a_LIBADD = $(top_builddir)/libbb/libbb.a --- a/libbb/Makefile.am +++ b/libbb/Makefile.am -@@ -2,9 +2,9 @@ +@@ -2,9 +2,9 @@ HOST_CPU=@host_cpu@ BUILD_CPU=@build_cpu@ ALL_CFLAGS=-g -O -Wall -DHOST_CPU_STR=\"$(HOST_CPU)\" -DBUILD_CPU=@build_cpu@ @@ -36,7 +36,7 @@ wfopen.c \ --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -4,11 +4,11 @@ +@@ -4,11 +4,11 @@ AM_CFLAGS = $(ALL_CFLAGS) -Wall -g -O3 - #noinst_PROGRAMS = libopkg_test opkg_active_list_test noinst_PROGRAMS = libopkg_test @@ -50,7 +50,7 @@ #opkg_extract_test_SOURCES = opkg_extract_test.c #opkg_extract_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir) -@@ -16,7 +16,7 @@ +@@ -16,7 +16,7 @@ noinst_PROGRAMS = libopkg_test #opkg_active_list_test_SOURCES = opkg_active_list_test.c #opkg_active_list_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir) @@ -61,7 +61,7 @@ --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -2,5 +2,5 @@ +@@ -2,5 +2,5 @@ AM_CFLAGS = -I${top_srcdir}/libopkg ${AL bin_PROGRAMS = opkg-cl opkg_cl_SOURCES = opkg-cl.c diff --git a/package/system/opkg/patches/110-upgrade.patch b/package/system/opkg/patches/110-upgrade.patch index 071df0e06b..61f454ae1c 100644 --- a/package/system/opkg/patches/110-upgrade.patch +++ b/package/system/opkg/patches/110-upgrade.patch @@ -1,6 +1,6 @@ --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c -@@ -1405,9 +1405,10 @@ +@@ -1405,9 +1405,11 @@ opkg_install_pkg(pkg_t *pkg, int from_up opkg_state_changed++; pkg->state_flag |= SF_FILELIST_CHANGED; @@ -8,12 +8,13 @@ + if (old_pkg) { pkg_remove_orphan_dependent(pkg, old_pkg); - ++ old_pkg->is_upgrade = 1; + pkg->is_upgrade = 1; + } /* XXX: BUG: we really should treat replacement more like an upgrade * Instead, we're going to remove the replacees */ -@@ -1466,7 +1467,7 @@ +@@ -1466,7 +1468,7 @@ opkg_install_pkg(pkg_t *pkg, int from_up } @@ -24,7 +25,7 @@ " Package debris may remain!\n", --- a/libopkg/pkg.c +++ b/libopkg/pkg.c -@@ -1285,6 +1285,12 @@ +@@ -1285,6 +1285,12 @@ pkg_run_script(pkg_t *pkg, const char *s setenv("PKG_ROOT", pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1); @@ -39,7 +40,7 @@ return 0; --- a/libopkg/pkg.h +++ b/libopkg/pkg.h -@@ -184,6 +184,7 @@ +@@ -184,6 +184,7 @@ struct pkg /* this flag specifies whether the package was installed to satisfy another * package's dependancies */ int auto_installed; diff --git a/package/system/opkg/patches/200-usign_support.patch b/package/system/opkg/patches/200-usign_support.patch index 991708a8a3..6479d57330 100644 --- a/package/system/opkg/patches/200-usign_support.patch +++ b/package/system/opkg/patches/200-usign_support.patch @@ -59,7 +59,7 @@ #include #include #include -@@ -342,7 +343,28 @@ opkg_prepare_url_for_install(const char +@@ -342,7 +343,28 @@ opkg_prepare_url_for_install(const char int opkg_verify_file (char *text_file, char *sig_file) { diff --git a/package/system/opkg/patches/220-drop-release-support.patch b/package/system/opkg/patches/220-drop-release-support.patch index 41f271f184..131c2cba6b 100644 --- a/package/system/opkg/patches/220-drop-release-support.patch +++ b/package/system/opkg/patches/220-drop-release-support.patch @@ -1,6 +1,6 @@ --- a/libopkg/Makefile.am +++ b/libopkg/Makefile.am -@@ -15,7 +15,6 @@ +@@ -15,7 +15,6 @@ opkg_cmd_sources = opkg_cmd.c opkg_cmd.h opkg_upgrade.c opkg_upgrade.h \ opkg_remove.c opkg_remove.h opkg_db_sources = opkg_conf.c opkg_conf.h \ @@ -8,7 +8,7 @@ opkg_utils.c opkg_utils.h pkg.c pkg.h hash_table.h \ pkg_depends.c pkg_depends.h pkg_extract.c pkg_extract.h \ hash_table.c pkg_hash.c pkg_hash.h pkg_parse.c pkg_parse.h \ -@@ -28,7 +27,6 @@ +@@ -28,7 +27,6 @@ opkg_list_sources = conffile.c conffile. active_list.c active_list.h list.h opkg_util_sources = file_util.c file_util.h opkg_message.h opkg_message.c md5.c md5.h \ parse_util.c parse_util.h \ @@ -719,7 +719,7 @@ #include "pkg.h" #include "pkg_dest.h" #include "pkg_parse.h" -@@ -114,39 +113,6 @@ +@@ -114,39 +113,6 @@ opkg_update_cmd(int argc, char **argv) } @@ -769,7 +769,7 @@ #include "pkg.h" #include "opkg_message.h" #include "pkg_vec.h" -@@ -183,40 +182,6 @@ +@@ -183,40 +182,6 @@ pkg_hash_load_feeds(void) lists_dir = conf->restrict_to_default_dest ? conf->default_dest->lists_dir : conf->lists_dir;