RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: lua/local/ llocal.lua rpm/ CHANGES

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Mon 04 Feb 2008 - 20:09:33 CET
Message-Id: <20080204190933.6C739348458@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm lua                          Date:   04-Feb-2008 20:09:33
  Branch: HEAD                             Handle: 2008020419093201

  Modified files:
    lua/local               llocal.lua
    rpm                     CHANGES

  Log:
    ensure that RPM Lua function util.rsplit("", ...) returns an empty
    table instead of a table with a single entry (an empty string)

  Summary:
    Revision    Changes     Path
    1.16        +8  -6      lua/local/llocal.lua
    1.2135      +1  -0      rpm/CHANGES
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: lua/local/llocal.lua
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 llocal.lua
  --- lua/local/llocal.lua	12 Jan 2008 22:30:54 -0000	1.15
  +++ lua/local/llocal.lua	4 Feb 2008 19:09:33 -0000	1.16
  @@ -73,14 +73,16 @@
   --  regular expression based string splitting
   function util.rsplit(str, regex, n, cf)
       local result = {}
  -    for section, _ in rex.split(str, regex, cf) do
  -        if n ~= nil then
  -            if n <= 0 then
  -                break
  +    if str ~= "" then
  +        for section, _ in rex.split(str, regex, cf) do
  +            if n ~= nil then
  +                if n <= 0 then
  +                    break
  +                end
  +                n = n - 1
               end
  -            n = n - 1
  +            table.insert(result, section)
           end
  -        table.insert(result, section)
       end
       return result
   end
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2134 -r1.2135 CHANGES
  --- rpm/CHANGES	4 Feb 2008 18:33:29 -0000	1.2134
  +++ rpm/CHANGES	4 Feb 2008 19:09:32 -0000	1.2135
  @@ -1,4 +1,5 @@
   5.0.0 -> 5.1a1:
  +    - rse: ensure that RPM Lua function util.rsplit("", ...) returns an empty table
       - jbj: "+bing" -- handle no *.rpm package found condition correctly.
       - jbj: "+bing" -- limit Fts(3) recursion to target directory traversal only.
       - jbj: "+bing" -- define "%NEVRA bing" on-the-fly for use by glob patterns.
  @@ .
Received on Mon Feb 4 20:09:33 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.