new function: -u (updates a module)

Christian Riggenbach criggenbach at magahugu.net
Sun Apr 27 21:51:46 CEST 2008


Hi Lunarians

This is the second try to submit a new function to lin.

The changes are:
* some changes in lin:
   - add a new switch (-u) and the description of the function
* a new plugin:
  - module-update.plugin, which hooks in to BUILD_POST_INSTALL
* changes to two "verify"-plugins
  - verify-md5.plugin: add some code to sedit the checksum for modules
    compiled from "zlocal", add code to optionaly force the checksum to sha1
  - verify-sha1.plugin: the same as above, but without the forcing to sha1 :)
* a change in download-generic.plugin:
  - add the switch "-p" to the "install"-ing of the source from tmp to the
    source-cache to preserve the date of the downloaded file

Now the important part :)

With this changes applied, you can update a module easily from the 
command-line as following:

lin -uw $VERSION $MODULE

the module is normal built, as you expect by the "-w" switch.

if the module is built successfully, the module-update.plugin takes care of 
the "-u" switch and questions the user to update. When you agree, the plugin 
takes a copy of the module to "zlocal" (as in "lvu edit", with the same 
restrictions), reads the date from the dowloaded source (with "stat -c%y", 
this is the cause to add "-p" to the "install" in download-generic.plugin) 
and suggest it for UPDATED. Next, the plugin calculates a sha1 sum (forced, 
as suggested by Stefan Wold) and updates DETAILS to the given values.

The two verify-plugins are used to update the sha1/md5 checksum in modules 
built from "zlocal". When you use md5, you are questioned to switch to sha1. 
These two have nothing to to with the module-update.plugin, but are also 
handy.

Attached are four patches, one for each changed script and the 
module-update.plugin script.

-- 
mit freundlichen Grüssen

Christian Riggenbach
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module-update.plugin
Type: application/x-shellscript
Size: 5130 bytes
Desc: not available
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/module-update.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lin.patch
Type: text/x-diff
Size: 1381 bytes
Desc: not available
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/lin.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify-md5.plugin.patch
Type: text/x-diff
Size: 2295 bytes
Desc: not available
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/verify-md5.plugin.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify-sha1.plugin.patch
Type: text/x-diff
Size: 2078 bytes
Desc: not available
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/verify-sha1.plugin.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: download-generic.plugin.patch
Type: text/x-diff
Size: 440 bytes
Desc: not available
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/download-generic.plugin.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://foo-projects.org/pipermail/lunar/attachments/20080427/9038e252/attachment.bin


More information about the Lunar mailing list