New version checker for software releases
Go to file
lilydjwg b258adfc13 source update 2014-09-29 16:35:55 +08:00
nvchecker add branch support for GitHub source 2014-09-14 16:23:36 +08:00
scripts sources update 2013-12-08 21:50:17 +08:00
sources source update 2014-09-29 16:35:55 +08:00
.gitignore use argparse instead of tornado.options and change a few terms 2013-08-09 18:50:41 +08:00
README.rst update README 2014-09-14 16:28:38 +08:00
setup.py add nvcmp command 2014-01-08 21:24:13 +08:00

README.rst

**nvchecker** (short for *new version checker*) is for checking if a new version of some software has been released.

Dependency
==========
- Python 3
- Tornado
- Optional pycurl
- All commands used in your version source files

Running
=======
To see available options::

  ./nvchecker --help

Run with one or more software version source files::

  ./nvchecker source_file

You normally will like to specify some "version record files"; see below.

Version Record Files
====================
Version record files record which version of the software you know or is available. They are simple key-value pairs of ``(name, version)`` seperated by a space\ [v0.3]_::

  fcitx 4.2.7
  google-chrome 27.0.1453.93-200836
  vim 7.3.1024

Say you've got a version record file called ``old_ver.txt`` which records all your watched software and their versions, as well as some configuration entries. To update it using ``nvchecker``::

  ./nvchecker source.ini

See what are updated with ``nvcmp``::

  ./nvcmp source.ini

Manually compare the two files for updates (assuming they are sorted alphabetically; files generated by ``nvchecker`` are already sorted)::

  comm -13 old_ver.txt new_ver.txt
  # or say that in English:
  comm -13 old_ver.txt new_ver.txt | awk '{print $1 " has updated to version " $2 "."}'
  # show both old and new versions
  join old_ver.txt new_ver.txt | awk '$2 != $3'

The ``nvtake`` Command
----------------------
This command helps to manage version record files. It reads both old and new version record files, and a list of names given on the commandline. It then update the versions of those names in the old version record file.

This helps when you have known (and processed) some of the updated software, but not all. You can tell nvchecker that via this command instead of editing the file by hand.

This command will help most if you specify where you version record files are in your config file. See below for how to use a config file.

Version Source Files
====================
The software version source files are in ini format. *Section names* is the name of the software. Following fields are used to tell nvchecker how to determine the current version of that software.

See ``sample_source.ini`` for an example.

Configuration Section
---------------------
A special section named ``__config__`` is special, it provides some configuration options\ [v0.4]_.

Relative path are relative to the source files, and ``~`` and environmental variables are expanded.

Currently supported options are:

oldver
  Specify a version record file containing the old version info.

newver
  Specify a version record file to storing the new version info.

Search in a Webpage
-------------------
Search through a specific webpage for the version string. This type of version finding has these fields:

url
  The URL of the webpage to fetch.

encoding
  (*Optional*) The character encoding of the webpage, if ``latin1`` is not appropriate.

regex
  A regular expression used to find the version string.

  It can have zero or one capture group. The capture group or the whole match is the version string.

  When multiple version strings are found, the maximum of those is chosen.

proxy
  The HTTP proxy to use. The format is ``host:port``, e.g. ``localhost:8087``. This requires `pycurl <http://pycurl.sourceforge.net/>_`.

Find with a Command
-------------------
Use a shell command line to get the version. The output is striped first, so trailing newlines do not bother.

cmd
  The command line to use. This will run with the system's standard shell (i.e. ``/bin/sh``).

Check AUR
---------
Check `Arch User Repository <https://aur.archlinux.org/>`_ for updates.

aur
  The package name in AUR. If empty, use the name of software (the *section name*).

Check GitHub
------------
Check `GitHub <https://github.com/>`_ for updates. The version returned is in date format ``%Y%m%d``, e.g. ``20130701``.

github
  The github repository, with author, e.g. ``lilydjwg/nvchecker``.

branch
  Which branch to track? Default: ``master``.

Check PyPI
----------
Check `PyPI <https://pypi.python.org/>`_ for updates.

pypi
  The name used on PyPI, e.g. ``PySide``.

Check Local Pacman Database
---------------------------
This is used when you run ``nvchecker`` on an Arch Linux system and the program always keeps up with a package in your configured repositories for `Pacman <https://wiki.archlinux.org/index.php/Pacman>`_.

pacman
  The package name to reference to.

Check Arch Linux official packages
----------------------------------
This enables you to track the update of `Arch Linux official packages <https://www.archlinux.org/packages/>`_, without needing of pacman and an updated local Pacman databases.

archpkg
  Name of the Arch Linux package.

Check Google Code (hg repository)
---------------------------------
Check a mercurial (hg) repository on `Google Code <https://code.google.com/>`_ for updates. The version returned is in date format ``%Y%m%d``, e.g. ``20130701``.

gcode_hg
  The name used on Google Code, e.g. ``chromium-compact-language-detector``.

Manually updating
-----------------
This enables you to manually specify the version (maybe because you want to approve each release before it gets to the script).

manual
  The version string.

Other
-----
More to come. Send me a patch or pull request if you can't wait and have written one yourself :-)

Bugs
====
* Finish writing results even on Ctrl-C or other interruption.

TODO
====
* Support GitHub tags
* doc for ``archpkg`` and ``manual``

Footnotes
=========
.. [v0.3] Note: with nvchecker <= 0.2, there are one more colon each line. You can use ``sed -i 's/://' FILES...`` to remove them.
.. [v0.4] This is added in version 0.4, and old command-line options are removed.