Lua Patch

lua-users home
wiki

luapatch is a Pure Lua implementation of the Unix patch utility (unified diffs only).

Web Site

Description

This is a Lua implementation of the patch utility [1]. It only supports unified diffs (diff -u).

A main motivation of this utility is to provide a platform-independent, easily deployable, and simple patch utility for LuaRocks [2].

Usage

For help:


./patch.lua --help

To patch current directory using patch file "mypatch":


./patch.lua < mypatch

Download/Source

Status

This code is new should undergo further testing. Some of the style might be further improved as it was converted from Python.

Note: Those code in the direct port is fairly ugly. It is being largely rewritten. If you want it sooner, just ask.

License

(c) 2008 David Manura, Licensed under the same terms as Lua (MIT license). Code is heavilly based on the Python-based patch.py version 8.06-1, Copyright (c) 2008 rainforce.org, MIT License . See included LICENSE.txt file.

Note: the source reuses Lua optparse (CommandLineParsing) and EnhancedFileLines (DavidManura).

See Also

Related documentation and implementations on patch:


RecentChanges · preferences
edit · history
Last edited August 19, 2010 3:39 am GMT (diff)