RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   04-Jan-2010 15:46:25
  Branch: HEAD                             Handle: 2010010414462400

  Modified files:
    rpm                     CHANGES
    rpm/js                  rpmts-js.c

  Log:
    - js: don't bother doing rpmts check/order/run if no elements.

  Summary:
    Revision    Changes     Path
    1.3239      +1  -0      rpm/CHANGES
    1.28        +10 -4      rpm/js/rpmts-js.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3238 -r1.3239 CHANGES
  --- rpm/CHANGES       4 Jan 2010 13:29:16 -0000       1.3238
  +++ rpm/CHANGES       4 Jan 2010 14:46:24 -0000       1.3239
  @@ -1,5 +1,6 @@
   
   5.2b1 -> 5.3a1
  +    - jbj: js: don't bother doing rpmts check/order/run if no elements.
       - jbj: rpmdb: fix: ensure that rpmdb pool allocations are set to zero.
       - jbj: tests: add a check-sign target w DSA/RSA coverage.
       - jbj: sign: fix: add a killref to plug a header memory leak.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/js/rpmts-js.c
  ============================================================================
  $ cvs diff -u -r1.27 -r1.28 rpmts-js.c
  --- rpm/js/rpmts-js.c 13 Dec 2009 20:23:42 -0000      1.27
  +++ rpm/js/rpmts-js.c 4 Jan 2010 14:46:24 -0000       1.28
  @@ -131,7 +131,8 @@
   
   _METHOD_DEBUG_ENTRY(_debug);
   
  -    (void) rpmcliInstallCheck(ts);   /* XXX print ps for now */
  +    if (rpmtsNElements(ts) > 0)
  +     (void) rpmcliInstallCheck(ts);  /* XXX print ps for now */
       ok = JS_TRUE;
   
       *rval = BOOLEAN_TO_JSVAL(ok);    /* XXX return error */
  @@ -147,7 +148,8 @@
   
   _METHOD_DEBUG_ENTRY(_debug);
   
  -    (void) rpmcliInstallOrder(ts);   /* XXX print ps for now */
  +    if (rpmtsNElements(ts) > 0)
  +     (void) rpmcliInstallOrder(ts);  /* XXX print ps for now */
       ok = JS_TRUE;
   
       *rval = BOOLEAN_TO_JSVAL(ok);    /* XXX return error */
  @@ -165,7 +167,8 @@
   
   #ifdef       NOTYET
       /* XXX force --test instead. */
  -    (void) rpmcliInstallRun(ts, NULL, 0);    /* XXX print ps for now */
  +    if (rpmtsNElements(ts) > 0)
  +     (void) rpmcliInstallRun(ts, NULL, 0);
   #else
       rpmtsEmpty(ts);
   #endif
  @@ -549,6 +552,7 @@
       void * ptr = JS_GetInstancePrivate(cx, obj, &rpmtsClass, NULL);
       rpmts ts = ptr;
       JSBool ok = JS_FALSE;
  +    int nelements = 0;
       int oc;
   
   _RESOLVE_DEBUG_ENTRY(_debug);
  @@ -557,8 +561,10 @@
        ok = JS_TRUE;
        goto exit;
       }
  +    if ((nelements = rpmtsNElements(ts)) <= 0)
  +     goto exit;
   
  -    if (JSVAL_IS_INT(id) && (oc = JSVAL_TO_INT(id)) >= 0 && oc < 
ts->orderCount)
  +    if (JSVAL_IS_INT(id) && (oc = JSVAL_TO_INT(id)) >= 0 && oc < nelements)
       {
        int oc = JSVAL_TO_INT(id);
        JSObject *teo = NULL; 
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to