Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rpm for openSUSE:Factory checked in 
at 2025-05-26 18:31:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rpm (Old)
 and      /work/SRC/openSUSE:Factory/.rpm.new.2732 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rpm"

Mon May 26 18:31:48 2025 rev:323 rq:1279053 version:4.20.1

Changes:
--------
+++ only whitespace diff in changes, re-diffing
--- /work/SRC/openSUSE:Factory/rpm/rpm.changes  2025-04-27 22:54:07.707717966 
+0200
+++ /work/SRC/openSUSE:Factory/.rpm.new.2732/rpm.changes        2025-05-26 
18:32:47.280494457 +0200
@@ -1,0 +2,7 @@
+Wed May 21 15:40:57 CEST 2025 - m...@suse.de
+
+- fix posttrans scriptlet argument in the update case [bsc#1243279]
+  * updated patch: posttrans.diff
+- fix postuntrans scriptlets not being run if dump_posttrans is set
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
rpm.spec: same change
++++++ posttrans.diff ++++++
--- /var/tmp/diff_new_pack.ZmuzBn/_old  2025-05-26 18:32:48.748556010 +0200
+++ /var/tmp/diff_new_pack.ZmuzBn/_new  2025-05-26 18:32:48.752556177 +0200
@@ -1,5 +1,5 @@
 --- include/rpm/rpmcli.h.orig  2025-02-19 15:29:33.000000000 +0000
-+++ include/rpm/rpmcli.h       2025-04-14 13:20:00.048365266 +0000
++++ include/rpm/rpmcli.h       2025-05-19 13:58:25.952973533 +0000
 @@ -306,6 +306,7 @@ enum rpmInstallFlags_e {
      INSTALL_ALLMATCHES        = (1 << 9),     /*!< from --allmatches */
      INSTALL_REINSTALL = (1 << 10),    /*!< from --reinstall */
@@ -24,8 +24,8 @@
   */
  extern struct rpmInstallArguments_s rpmIArgs;
  
---- include/rpm/rpmts.h.orig   2025-04-14 13:19:55.520372147 +0000
-+++ include/rpm/rpmts.h        2025-04-14 13:20:00.052365260 +0000
+--- include/rpm/rpmts.h.orig   2025-05-19 13:58:13.800993465 +0000
++++ include/rpm/rpmts.h        2025-05-19 13:58:25.952973533 +0000
 @@ -253,6 +253,15 @@ int rpmtsOrder(rpmts ts);
  int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
  
@@ -43,7 +43,7 @@
   * @param ts          transaction set
   * @return            new transaction set reference
 --- lib/poptI.c.orig   2025-02-19 15:29:33.000000000 +0000
-+++ lib/poptI.c        2025-04-14 13:20:00.052365260 +0000
++++ lib/poptI.c        2025-05-19 13:58:25.952973533 +0000
 @@ -283,6 +283,10 @@ struct poptOption rpmInstallPoptTable[]
        &rpmIArgs.installInterfaceFlags, (INSTALL_RESTORE),
        N_("restore package(s)"),
@@ -55,9 +55,18 @@
  
     POPT_TABLEEND
  };
---- lib/psm.c.orig     2025-04-14 13:19:55.504372171 +0000
-+++ lib/psm.c  2025-04-14 13:20:00.052365260 +0000
-@@ -1009,7 +1009,7 @@ static rpmRC rpmPackageErase(rpmts ts, r
+--- lib/psm.c.orig     2025-05-19 13:58:13.780993499 +0000
++++ lib/psm.c  2025-05-19 14:32:29.713648565 +0000
+@@ -612,6 +612,8 @@ static int isUpdate(rpmts ts, rpmte te)
+     rpmtsi pi = rpmtsiInit(ts);
+     rpmte p;
+     int update = 0;
++    if (rpmteAddOp(te) == RPMTE_RUNPOSTTRANS_UPDATE)
++      update = 1;
+     while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) {
+       if (rpmteDependsOn(p) == te) {
+           update = 1;
+@@ -1009,7 +1011,7 @@ static rpmRC rpmPackageErase(rpmts ts, r
        }
        if (rc) break;
  
@@ -67,7 +76,7 @@
            rpmtriggersPrepPostUnTransFileTrigs(psm->ts, psm->te);
        }
 --- lib/rpminstall.c.orig      2025-02-19 15:29:33.000000000 +0000
-+++ lib/rpminstall.c   2025-04-25 09:21:50.799906982 +0000
++++ lib/rpminstall.c   2025-05-19 13:58:25.952973533 +0000
 @@ -6,6 +6,8 @@
  
  #include <string.h>
@@ -157,8 +166,18 @@
 +    argvFree(manifest);
 +    return rc;
 +}
+--- lib/rpmte_internal.h.orig  2025-05-19 14:17:38.131089552 +0000
++++ lib/rpmte_internal.h       2025-05-19 14:18:06.503043382 +0000
+@@ -32,6 +32,7 @@ enum addOp_e {
+   RPMTE_UPGRADE       = 1,
+   RPMTE_REINSTALL     = 2,
+   RPMTE_RESTORE       = 3,
++  RPMTE_RUNPOSTTRANS_UPDATE = 4,
+ };
+ 
+ /** \ingroup rpmte
 --- lib/rpmtriggers.c.orig     2025-02-19 15:29:33.000000000 +0000
-+++ lib/rpmtriggers.c  2025-04-14 13:20:00.052365260 +0000
++++ lib/rpmtriggers.c  2025-05-19 14:36:21.781275493 +0000
 @@ -1,5 +1,6 @@
  #include "system.h"
  
@@ -190,7 +209,29 @@
        /* Prepare and run script */
        script = rpmScriptFromTriggerTag(trigH,
                triggertag(RPMSENSE_TRIGGERPOSTUN),
-@@ -613,6 +622,16 @@ rpmRC runImmedFileTriggers(rpmts ts, rpm
+@@ -603,6 +612,21 @@ rpmRC runFileTriggers(rpmts ts, rpmte te
+     return (nerrors == 0) ? RPMRC_OK : RPMRC_FAIL;
+ }
+ 
++static int isUpdate(rpmts ts, rpmte te)
++{
++    rpmtsi pi = rpmtsiInit(ts);
++    rpmte p;
++    int update = 0;
++    while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) {
++        if (rpmteDependsOn(p) == te) {
++            update = 1;
++            break;
++        }
++    }
++    rpmtsiFree(pi);
++    return update;
++}
++
+ rpmRC runImmedFileTriggers(rpmts ts, rpmte te, int arg1, rpmsenseFlags sense,
+                           rpmscriptTriggerModes tm, int priorityClass)
+ {
+@@ -613,6 +637,19 @@ rpmRC runImmedFileTriggers(rpmts ts, rpm
      rpmTagVal priorityTag;
      rpmtriggers triggers;
  
@@ -198,7 +239,10 @@
 +      unsigned int hdrNum = headerGetInstance(trigH);
 +      if (hdrNum) {
 +          char *trigNEVRA = headerGetAsString(trigH, RPMTAG_NEVRA);
-+          rpmlog(RPMLOG_NOTICE, "dump_posttrans: install %u %s\n", hdrNum, 
trigNEVRA);
++          if (isUpdate(ts, te))
++              rpmlog(RPMLOG_NOTICE, "dump_posttrans: update %u %s\n", hdrNum, 
trigNEVRA);
++          else
++              rpmlog(RPMLOG_NOTICE, "dump_posttrans: install %u %s\n", 
hdrNum, trigNEVRA);
 +          free(trigNEVRA);
 +      }
 +      headerFree(trigH);
@@ -208,7 +252,7 @@
        priorityTag = RPMTAG_FILETRIGGERPRIORITIES;
      } else {
 --- lib/rpmtriggers.h.orig     2025-02-19 15:29:33.000000000 +0000
-+++ lib/rpmtriggers.h  2025-04-14 13:20:00.052365260 +0000
++++ lib/rpmtriggers.h  2025-05-19 13:58:25.956973525 +0000
 @@ -24,6 +24,10 @@ rpmtriggers rpmtriggersCreate(unsigned i
  RPM_GNUC_INTERNAL
  rpmtriggers rpmtriggersFree(rpmtriggers triggers);
@@ -221,7 +265,7 @@
   * Prepare post trans uninstall file triggers. After transcation uninstalled
   * files are not saved anywhere. So we need during uninstalation of every
 --- lib/rpmts_internal.h.orig  2025-02-19 15:29:33.000000000 +0000
-+++ lib/rpmts_internal.h       2025-04-14 13:20:00.052365260 +0000
++++ lib/rpmts_internal.h       2025-05-19 13:58:25.956973525 +0000
 @@ -83,6 +83,8 @@ struct rpmts_s {
      int min_writes;             /*!< macro minimize_writes used */
  
@@ -232,7 +276,7 @@
  
  /** \ingroup rpmts
 --- lib/transaction.c.orig     2025-02-19 15:29:33.000000000 +0000
-+++ lib/transaction.c  2025-04-14 13:20:00.056365254 +0000
++++ lib/transaction.c  2025-05-21 13:35:19.931704634 +0000
 @@ -1475,6 +1475,8 @@ static int rpmtsSetup(rpmts ts, rpmprobF
      /* Get available space on mounted file systems. */
      (void) rpmtsInitDSI(ts);
@@ -242,12 +286,13 @@
      return 0;
  }
  
-@@ -1858,6 +1860,15 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp
+@@ -1858,6 +1860,16 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp
      /* Actually install and remove packages */
      nfailed = rpmtsProcess(ts);
  
 +    if (ts->dump_posttrans) {
 +      rpmlog(RPMLOG_NOTICE, "dump_posttrans: enabled\n");
++      runTransScripts(ts, PKG_POSTUNTRANS);   /* need to run them right away 
*/
 +      runPostUnTransFileTrigs(ts);
 +      runTransScripts(ts, PKG_TRANSFILETRIGGERIN);
 +      /* Final exit code */
@@ -258,7 +303,7 @@
      /* Run %posttrans scripts unless disabled */
      if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) {
        rpmlog(RPMLOG_DEBUG, "running %%posttrans scripts\n");
-@@ -1901,3 +1912,117 @@ exit:
+@@ -1901,3 +1913,120 @@ exit:
      sigaction(SIGPIPE, &oact, NULL);
      return rc;
  }
@@ -321,12 +366,15 @@
 +      goto exit;
 +    char *line;
 +    while ((line = *manifest++) != 0) {
-+      if (!strncmp(line, "dump_posttrans: install ", 24)) {
-+          const char *lp = line + 24;
++      if (strncmp(line, "dump_posttrans: ", 16) != 0)
++          continue;
++      line += 16;
++      if (!strncmp(line, "install ", 8) || !strncmp(line, "update ", 7)) {
++          const char *lp = line + (*line == 'i' ? 8 : 7);
 +          Header h = runPostTransFindPkg(ts, lp);
 +          if (!h)
 +              continue;
-+          rpmte p = rpmteNew(ts, h, TR_ADDED, line + 45, NULL, RPMTE_INSTALL);
++          rpmte p = rpmteNew(ts, h, TR_ADDED, NULL, NULL, (*line == 'i' ? 
RPMTE_INSTALL: RPMTE_RUNPOSTTRANS_UPDATE));
 +          if (tsmem->orderCount >= tsmem->orderAlloced) {
 +              tsmem->orderAlloced += (tsmem->orderCount - 
tsmem->orderAlloced) + tsmem->delta;
 +              tsmem->order = xrealloc(tsmem->order, tsmem->orderAlloced * 
sizeof(*tsmem->order));
@@ -337,8 +385,8 @@
 +              tsmem->addedPackages = rpmalCreate(ts, 5);
 +          rpmalAdd(tsmem->addedPackages, p);
 +          packageHashAddEntry(tsmem->installedPackages, headerGetInstance(h), 
p);
-+      } else if (!strncmp(line, "dump_posttrans: transfiletriggerpostun ", 
39)) {
-+          const char *lp = line + 39;
++      } else if (!strncmp(line, "transfiletriggerpostun ", 23)) {
++          const char *lp = line + 23;
 +          unsigned int tix = runPostTransFindPkgNum(&lp);
 +          Header h = runPostTransFindPkg(ts, lp);
 +          struct rpmtd_s priorities;
@@ -377,7 +425,7 @@
 +    return rc;
 +}
 --- tools/rpm.c.orig   2025-02-19 15:29:33.000000000 +0000
-+++ tools/rpm.c        2025-04-14 13:20:00.056365254 +0000
++++ tools/rpm.c        2025-05-19 13:58:25.956973525 +0000
 @@ -21,6 +21,7 @@ enum modes {
      MODE_ERASE                = (1 <<  2),
      MODE_RESTORE      = (1 <<  4),

Reply via email to