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 31 Dec 2007 - 21:26:41 CET
Message-Id: <20071231202641.57050348460@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:   31-Dec-2007 21:26:41
  Branch: HEAD                             Handle: 2007123120264001

  Modified files:
    lua/local               llocal.lua
    rpm                     CHANGES

  Log:
    add often required RPM Lua convenience function util.slurp()

  Summary:
    Revision    Changes     Path
    1.7         +17 -0      lua/local/llocal.lua
    1.2044      +5  -0      rpm/CHANGES
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: lua/local/llocal.lua
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 llocal.lua
  --- lua/local/llocal.lua	30 Dec 2007 21:09:39 -0000	1.6
  +++ lua/local/llocal.lua	31 Dec 2007 20:26:41 -0000	1.7
  @@ -173,3 +173,20 @@
       io.stderr:write(util.dump(obj1, unpack(arg)))
   end
   
  +--  -----------------------------------------------------------------------  --                                                                
  +--                          I/O UTILITIES                                                                                                      
  +--  -----------------------------------------------------------------------  --                                                                
  +                                                                                                                                               
  +--  slurp in all data of a file                                                                                                                
  +function util.slurp(filename)                                                                                                                  
  +    local data = nil                                                                                                                           
  +    if filename ~= nil then                                                                                                                    
  +        local fp, error = io.open(filename, "r")                                                                                               
  +        if fp ~= nil then                                                                                                                      
  +            data = fp:read("*all")                                                                                                             
  +            io.close(fp)                                                                                                                       
  +        end                                                                                                                                    
  +    end                                                                                                                                        
  +    return data                                                                                                                                
  +end                                                                                                                                            
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2043 -r1.2044 CHANGES
  --- rpm/CHANGES	30 Dec 2007 22:33:07 -0000	1.2043
  +++ rpm/CHANGES	31 Dec 2007 20:26:40 -0000	1.2044
  @@ -1,3 +1,8 @@
  +5.0b4 -> 5.0.0:
  +    - rse: add often required RPM Lua convenience function util.slurp()
  +    - rse: add PCRE to "devtool standalone" procedure
  +    - rse: make RPM configuration in "devtool standalone" procedure more flexible
  +
   5.0b3 -> 5.0b4:
       - jbj: fix: calculate clearsign'd text digests correctly.
       - jbj: fix: display RPMRC_NOKEY failures explicitly.
  @@ .
Received on Mon Dec 31 21:26:41 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.