[Nix-dev] Semi-automated updates

Michael Raskin 7c6f434c at mail.ru
Tue Aug 25 09:25:09 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

		Hello.
	I have implemented a simple script to make upgrading upstream reference
easier. It is in
pkgs/build-support/upstream-updater/update-upstream-data.sh . It
supposes that every file.nix that uses it has 2 axillary files
associated with it:

a) src-for-file.nix - this is an expression supposed to be imported
directly by file.nix. It contains url, hash (sha256) and version
attributes. It also has advertisedUrl, which is used for checking for
updates if we edit the URL as to use mirror:// syntax.

When you run update-upstream-data.sh, it will create
updated-src-for-file.nix, which you can compare and diff with
src-for-file.nix, and later just move over it.

You can pass second parameter to update-upstream-data.sh (first
parameter is file.nix, possibly with complete path): URL to consider
retrieved. Otherwise the second axillary file is considered.

b) src-info-for-file.nix - this is an expression describing retrieval of
the fresher source. It can contain various helper attributes in case
defaults fail.

downloadPage (the only mandatory attribute): URL which will contain the
link to the source.

sourceRegexp (default: '.*[.]tar[.].*' ): regular expression of the
files considered to be source archives.

choiceCommand (default: 'head -1' ): the shell command to filter the
list of plausible URLs to select the freshest one. By default we hope
for a "newsfeed-like" release list with the freshest URL on top, but you
can write arbitrary script. For example, you can grab SF.net file list
and run sed on the selected URL to get an URL bypassing redirector pages.

Note: sed scripts are double-quoted in the script, so you can use
variable expansion etc.

versionExtractorSedScript (default: 's/.*-([0-9.]+)[.].*/\1/' ): sed
script to run to convert URL to the version attribute. It is convenient
for naming based on version, etc.

versionReferenceCreator (default: 's/-([0-9.]+)[.]/-${version}./' ): sed
script to replace version in URL with ${version} variable reference. I
prefer to see the URLs in such a form.. When this is used, "$version"
shell environment variable contains version.

mirrorSedScript (default: '' ): what to do with URL to prepare a nice
mirror-aware URL for commit.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJKk5HUAAoJEE6tnN0aWvw3Ae0IAIWHOcalp3z+ZahR+VJo8IDP
3DPC3Y2/vyWQruMISRshTmkduTJV7kvoGvqaLpQG2XL6iA5xy5JiMNi0h4EoWWA+
Z5nS3updmwu3UTyl6IO86U7d4k38e5iWcchyetThGtAd4EifX7ER3sGOR71/CK9O
OpoJT2CS10sHY63l7hzahHGkkLhZofPaKRhGD4FhoNE/UlWIydpW59+pmFFbemgn
DF8K+6JaN/E9a0bsRf43BlEN7iv71cz3q0BT6MS/HRcKoGgwLTt6B+61gSRDU4iB
bCYRmOpqgHcxITG23GucTiDSPkovYbbVZFOBKmPdIBAEGxRfem8XL9jq3qNfgN8=
=2AQu
-----END PGP SIGNATURE-----



More information about the nix-dev mailing list