All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade.
       [not found] <543ef52e.0879c20a.1785.4076SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2014-10-21 15:40 ` Paul Barker
  2014-10-22 22:54   ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Barker @ 2014-10-21 15:40 UTC (permalink / raw)
  To: Peter Urbanec; +Cc: OE Core

On 15 October 2014 23:27, Peter Urbanec <openembedded-devel@urbanec.net> wrote:
> opkg upgrade will now call prerm and postrm scripts from the old package
> with "upgrade new-version" arguments, similar to what dpkg does.
>
> Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
> ---
>  .../opkg/opkg/prerm-and-postrm-scripts.patch       | 81
> ++++++++++++++++++++++
>  meta/recipes-devtools/opkg/opkg_0.2.2.bb           |  1 +
>  2 files changed, 82 insertions(+)
>  create mode 100644
> meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
>
> diff --git a/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
> b/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
> new file mode 100644
> index 0000000..98a447a
> --- /dev/null
> +++ b/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
> @@ -0,0 +1,81 @@
> +From 476965fdb2d6eec559242e6205cbb07d539b80e1 Mon Sep 17 00:00:00 2001
> +From: Peter Urbanec <openembedded-devel@urbanec.net>
> +Date: Wed, 15 Oct 2014 14:32:22 +1100
> +Subject: [PATCH] opkg_install: Call prerm and postrm scripts on package
> upgrade.

Sorry Peter, it looks like this patch has been corrupted as well as
the one sent to the opkg-devel list. In this case I think it's mostly
lines like the above which have been incorrectly wrapped.

Could you resend this using 'git send-email' if possible?

Thanks,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade.
  2014-10-21 15:40 ` [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade Paul Barker
@ 2014-10-22 22:54   ` Burton, Ross
  2014-10-24 10:49     ` Paul Barker
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2014-10-22 22:54 UTC (permalink / raw)
  To: Peter Urbanec; +Cc: OE Core

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

On 21 October 2014 16:40, Paul Barker <paul@paulbarker.me.uk> wrote:

> Sorry Peter, it looks like this patch has been corrupted as well as
> the one sent to the opkg-devel list. In this case I think it's mostly
> lines like the above which have been incorrectly wrapped.
>
> Could you resend this using 'git send-email' if possible?
>

Alternatively (and preferably for large numbers of patches), push your
changes to a git repo somewhere.

Ross

[-- Attachment #2: Type: text/html, Size: 866 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade.
  2014-10-22 22:54   ` Burton, Ross
@ 2014-10-24 10:49     ` Paul Barker
  2014-10-24 12:01       ` Andreas Oberritter
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Barker @ 2014-10-24 10:49 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Peter Urbanec, OE Core

On 22 October 2014 23:54, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 21 October 2014 16:40, Paul Barker <paul@paulbarker.me.uk> wrote:
>>
>> Sorry Peter, it looks like this patch has been corrupted as well as
>> the one sent to the opkg-devel list. In this case I think it's mostly
>> lines like the above which have been incorrectly wrapped.
>>
>> Could you resend this using 'git send-email' if possible?
>
>
> Alternatively (and preferably for large numbers of patches), push your
> changes to a git repo somewhere.
>
> Ross

This patch can now be marked as a backport if it is resent.

I'd probably say it shouldn't be applied in oe-core until after the
1.7 branch now as it's so close to release and if any prerm/postrm
scripts don't check for an "upgrade" argument they may end up doing
the wrong thing.

Cheers,

-- 
Paul Barker

Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade.
  2014-10-24 10:49     ` Paul Barker
@ 2014-10-24 12:01       ` Andreas Oberritter
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Oberritter @ 2014-10-24 12:01 UTC (permalink / raw)
  To: Paul Barker, Burton, Ross; +Cc: Peter Urbanec, OE Core

On 24.10.2014 12:49, Paul Barker wrote:
> On 22 October 2014 23:54, Burton, Ross <ross.burton@intel.com> wrote:
>>
>> On 21 October 2014 16:40, Paul Barker <paul@paulbarker.me.uk> wrote:
>>>
>>> Sorry Peter, it looks like this patch has been corrupted as well as
>>> the one sent to the opkg-devel list. In this case I think it's mostly
>>> lines like the above which have been incorrectly wrapped.
>>>
>>> Could you resend this using 'git send-email' if possible?
>>
>>
>> Alternatively (and preferably for large numbers of patches), push your
>> changes to a git repo somewhere.
>>
>> Ross
> 
> This patch can now be marked as a backport if it is resent.
> 
> I'd probably say it shouldn't be applied in oe-core until after the
> 1.7 branch now as it's so close to release and if any prerm/postrm
> scripts don't check for an "upgrade" argument they may end up doing
> the wrong thing.
> 
> Cheers,
> 

As already pointed out in the discussion about the other patch ("Better
support for upgrading packages in opkg and update-rc.d.bbclass"),
OE-Core expects prerm and postrm scripts not to run on upgrade. Not only
with opkg, but with rpm and apt/dpkg, too. So unless we're going to
accept breaking virtually every prerm and postrm script in the OE-Core
ecosystem, somebody will need to come up with a good plan before
applying this patch, even after the release.

FWIW, it would be safe to apply if preceded by a patch making
package_ipk.bbclass inject code to skip these scripts upgrades as rpm
and deb do, effectively turning this patch into a no-op, but bringing
all package managers in line before any further changes.

Regards,
Andreas


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade.
@ 2014-10-15 22:27 Peter Urbanec
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Urbanec @ 2014-10-15 22:27 UTC (permalink / raw)
  To: openembedded-core

opkg upgrade will now call prerm and postrm scripts from the old package
with "upgrade new-version" arguments, similar to what dpkg does.

Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
---
  .../opkg/opkg/prerm-and-postrm-scripts.patch       | 81 
++++++++++++++++++++++
  meta/recipes-devtools/opkg/opkg_0.2.2.bb           |  1 +
  2 files changed, 82 insertions(+)
  create mode 100644 
meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch

diff --git 
a/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch 
b/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
new file mode 100644
index 0000000..98a447a
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/prerm-and-postrm-scripts.patch
@@ -0,0 +1,81 @@
+From 476965fdb2d6eec559242e6205cbb07d539b80e1 Mon Sep 17 00:00:00 2001
+From: Peter Urbanec <openembedded-devel@urbanec.net>
+Date: Wed, 15 Oct 2014 14:32:22 +1100
+Subject: [PATCH] opkg_install: Call prerm and postrm scripts on package 
upgrade.
+To: opkg-devel@googlegroups.com
+Cc: paul@paulbarker.me.uk
+
+When upgrading a package from v1 to v2, run "v1-prerm upgrade v2" and
+"v1-postrm upgrade v2", similarly to what dpkg does.
+
+Fixes opkg issue 104: Support prerm scripts for the old package
+See https://code.google.com/p/opkg/issues/detail?id=104
+
+Signed-off-by: Peter Urbanec <openembedded-devel@urbanec.net>
+Upstream-Status: Submitted [opkg-devel@googlegroups.com]
+
+---
+ libopkg/opkg_install.c | 40 ++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 38 insertions(+), 2 deletions(-)
+
+diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
+index 4f6fe65..ec0f34a 100644
+--- a/libopkg/opkg_install.c
++++ b/libopkg/opkg_install.c
+@@ -601,7 +601,25 @@ prerm_upgrade_old_pkg(pkg_t *pkg, pkg_t *old_pkg)
+ 	   Error unwind, for both the above cases:
+ 	   old-postinst abort-upgrade new-version
+      */
+-     return 0;
++    int err;
++    char *script_args;
++    char *new_version;
++
++    if (!old_pkg || !pkg)
++        return 0;
++
++    new_version = pkg_version_str_alloc(pkg);
++
++    sprintf_alloc(&script_args, "upgrade %s", new_version);
++    free(new_version);
++    err = pkg_run_script(old_pkg, "prerm", script_args);
++    free(script_args);
++    if (err != 0) {
++        opkg_msg(ERROR, "prerm script for package \"%s\" failed\n",
++                 old_pkg->name);
++        return -1;
++    }
++    return 0;
+ }
+
+ static int
+@@ -1001,7 +1019,25 @@ postrm_upgrade_old_pkg(pkg_t *pkg, pkg_t 
*old_pkg)
+ 	   new-postrm failed-upgrade old-version
+ 	Error unwind, for both cases:
+ 	   old-preinst abort-upgrade new-version    */
+-     return 0;
++    int err;
++    char *script_args;
++    char *new_version;
++
++    if (!old_pkg || !pkg)
++        return 0;
++
++    new_version = pkg_version_str_alloc(pkg);
++
++    sprintf_alloc(&script_args, "upgrade %s", new_version);
++    free(new_version);
++    err = pkg_run_script(old_pkg, "postrm", script_args);
++    free(script_args);
++    if (err != 0) {
++        opkg_msg(ERROR, "postrm script for package \"%s\" failed\n",
++                 old_pkg->name);
++        return -1;
++    }
++    return 0;
+ }
+
+ static int
+--
+2.1.2
+
diff --git a/meta/recipes-devtools/opkg/opkg_0.2.2.bb 
b/meta/recipes-devtools/opkg/opkg_0.2.2.bb
index 3dd7489..c5b6561 100644
--- a/meta/recipes-devtools/opkg/opkg_0.2.2.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.2.2.bb
@@ -4,6 +4,7 @@ SRC_URI = 
"http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz
             file://no-install-recommends.patch \
             file://add-exclude.patch \
             file://opkg-configure.service \
+           file://prerm-and-postrm-scripts.patch \
  "

  S = "${WORKDIR}/${BPN}-${PV}"
-- 
2.1.2




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-24 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <543ef52e.0879c20a.1785.4076SMTPIN_ADDED_BROKEN@mx.google.com>
2014-10-21 15:40 ` [PATCH V3] opkg: Call prerm and postrm scripts on package upgrade Paul Barker
2014-10-22 22:54   ` Burton, Ross
2014-10-24 10:49     ` Paul Barker
2014-10-24 12:01       ` Andreas Oberritter
2014-10-15 22:27 Peter Urbanec

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.