diff options
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | README.rst | 21 | ||||
-rw-r--r-- | docs/conf.py | 2 | ||||
-rw-r--r-- | docs/development.rst | 30 | ||||
-rw-r--r-- | docs/index.rst | 2 | ||||
-rw-r--r-- | docs/userguide.rst | 35 | ||||
-rw-r--r-- | g-octave.1.rst | 3 | ||||
-rw-r--r-- | g_octave/fetch.py | 14 | ||||
-rwxr-xr-x | scripts/g-octave | 27 | ||||
-rw-r--r-- | tests/test_config.py | 2 |
10 files changed, 99 insertions, 39 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index b9c66ad..73f9cef 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ include LICENSE include README.rst include MANIFEST.in include etc/g-octave.cfg +include share/g-octave.eclass include g-octave.1 include g-octave.html include scripts/* @@ -14,5 +15,4 @@ include docs/_build/.keep exclude g_octave/tinderbox/*.pyc exclude g_octave/svn/*.pyc exclude tests/*.pyc -exclude g_octave/fetch.py @@ -56,6 +56,7 @@ Dependencies * Python_ 2.6 * Portage_ +* PySVN (optional) `g-octave`_ also depends on some files, distributed by the maintainer, like the package database (a tarball with the DESCRIPTION file of all @@ -71,7 +72,7 @@ or that a new patch is added. All these files are automatically fetched by `g-octave`_ At this time, these files are here: -http://files.rafaelmartins.eng.br/octave-forge/ +http://g-octave.rafaelmartins.eng.br/distfiles/db/ Settings @@ -115,6 +116,7 @@ Below is a list of features implemented or planned to the next releases. * Use colors on the CLI **(done)** * The user can disable the use of colors on the CLI **(done)** * Log `g-octave`_ actions to a file +* Can install packages from the octave-forge SVN repository. To-Do @@ -131,7 +133,7 @@ We have other goals besides implementing the remaining features: * Write a man page **(done)** * Convince upstream to distribute the package database * Improve the use of `g-octave`_ as a normal user, with "--pretend" -* Improve the script that generates the package database +* Improve the script that generates the package database **(done)** * Improve the details available on the packages list * Write a testsuite **(done)** * more... @@ -176,6 +178,9 @@ CLI options *--sync* search for updates of the package database, patches and auxiliary files +*--config" + return a value from the configuration file (/etc/g-octave.cfg) + Usage Examples -------------- @@ -195,6 +200,10 @@ Remove the package *control*: :: Get informations about the package *control*: :: # g-octave -i control + +To install the package *control* from the octave-forge SVN repository: :: + + # g-octave control-9999 The options *verbose*, *ask* and *pretend* are passed to **emerge**. @@ -206,8 +215,8 @@ The users can help testing and reporting bugs in our `issue tracker`_. If you can help programming in Python_, please take a look at our missing features and at the To-Do list. :) -`g-octave`_ ebuilds are available on the mercurial repository, or here: -http://overlay.rafaelmartins.eng.br/ (overlay) +`g-octave`_ ebuilds are available on the mercurial repository, or the +Gentoo science overlay Warning @@ -216,7 +225,7 @@ Warning If you experienced some random errors when installing packages, please retry, using the option *--force-all*, and report the issue to us. If you don't want to lose all your ebuilds, you can try to use the option -*--force*, that will recreate only the affected ebuild. +*--force*, that will re-create only the affected ebuild. Download Page @@ -227,7 +236,7 @@ http://g-octave.rafaelmartins.eng.br/wiki/DownloadSources or checkout the Mercurial_ repository using: :: - $ hg clone http://hg.rafaelmartins.eng.br/g-octave/ + $ hg clone http://g-octave.rafaelmartins.eng.br/hg/ Authors diff --git a/docs/conf.py b/docs/conf.py index f470b89..a417a3e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ copyright = u'2010, Rafael Goncalves Martins' # The short X.Y version. version = '0.2' # The full version, including alpha/beta/rc tags. -release = '0.2_rc1' +release = '0.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/development.rst b/docs/development.rst index ed171b5..b9077df 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -1,7 +1,7 @@ Development =========== -:Source code: http://hg.rafaelmartins.eng.br/g-octave/ +:Source code: http://g-octave.rafaelmartins.eng.br/hg/ :Bug tracker: http://g-octave.rafaelmartins.eng.br/ .. _`bug tracker`: http://g-octave.rafaelmartins.eng.br/ @@ -13,8 +13,8 @@ You can run the tests suites using the script ``run_tests.py`` that can be found in the directory ``scripts`` in the `source tarballs`_ (since 0.1) or in the `Mercurial repository`_ -.. _`source tarballs`: http://files.rafaelmartins.eng.br/distfiles/g-octave/ -.. _`Mercurial repository`: http://hg.rafaelmartins.eng.br/g-octave/ +.. _`source tarballs`: http://g-octave.rafaelmartins.eng.br/distfiles/releases/ +.. _`Mercurial repository`: http://g-octave.rafaelmartins.eng.br/hg/ :: @@ -24,6 +24,30 @@ If some test is broken, please create a ticket in the `bug tracker`_. A quick registration is needed. +Creating source tarballs from the octave-forge SVN repository +------------------------------------------------------------- + +We have a script to create source tarballs for all the packages, +using the latest stable revision from the octave-forge SVN repo. + +To use it, add a ``pkg_cache`` option to your configuration file with +the directory where you want to save the generated tarballs and, after +clone the Mercurial repository or download the source tarball, run from +the root of the source tree:: + + $ scripts/package_sources.py + + +Creating a package database from the previously created source tarballs +----------------------------------------------------------------------- + +You should want to also create a package database. For this, keep the +``pkg_cache`` option in your configuration file pointing to the directory +with your source tarballs and run from the root of the source tree:: + + $ scripts/package_database.py /path/to/your/new/database.tar.gz + + Sending patches --------------- diff --git a/docs/index.rst b/docs/index.rst index 2855cfe..2906376 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,7 @@ Welcome to g-Octave's documentation! ==================================== :Author: Rafael Goncalves Martins -:Source code: http://hg.rafaelmartins.eng.br/g-octave/ +:Source code: http://g-octave.rafaelmartins.eng.br/hg/ :Bug tracker: http://g-octave.rafaelmartins.eng.br/ :Version: |release| diff --git a/docs/userguide.rst b/docs/userguide.rst index 448d3e6..da81089 100644 --- a/docs/userguide.rst +++ b/docs/userguide.rst @@ -9,9 +9,11 @@ Installing g-Octave ------------------- The ebuilds for g-Octave will be available on the Portage tree as soon -as possible. For now, they can be found on my overlay: +as possible. For now, they can be found on the Gentoo ``science`` overlay. +To install it with ``layman`` and ``git`` installed, type:: + + # layman -a science -http://overlay.rafaelmartins.eng.br/ After you have the overlay installed, you can install the package, using: :: @@ -35,16 +37,16 @@ release will need to unmask the ebuild too, adding this to The source code of g-Octave can be found in this Mercurial repository: -http://hg.rafaelmartins.eng.br/g-octave/ +http://g-octave.rafaelmartins.eng.br/hg/ You can clone the mercurial repository using this command (with Mercurial installed, of course):: - $ hg clone http://hg.rafaelmartins.eng.br/g-octave/ + $ hg clone http://g-octave.rafaelmartins.eng.br/hg/ g-octave The release tarballs can be found here: -http://files.rafaelmartins.eng.br/distfiles/g-octave/ +http://g-octave.rafaelmartins.eng.br/distfiles/releases/ Configuring g-Octave @@ -106,8 +108,8 @@ For example: :: # g-octave control-1.0.11 -g-octave command tool supports some options for the installation of -packages: +``g-octave`` command-line tool supports some options for the installation +of packages: ``-a`` or ``--ask`` Ask before install the package @@ -123,6 +125,25 @@ or :: # g-octave -i packagename +Installing packages from the octave-forge SVN repository +-------------------------------------------------------- + +If you want to test some new feature, or to use the new version of the +packages ever, you'll like to install your packages directly from the +SVN repository. + +To install a package from SVN, type:: + + # g-octave packagename-9999 + +All the common g-octave options for install packages are allowed, and +the special version ``9999`` says to g-octave that you want to use the +SVN version. + +In order to be able to install packages from svn you need to install +g-octave with the USE flag ``svn`` enabled. + + Uninstalling packages --------------------- diff --git a/g-octave.1.rst b/g-octave.1.rst index 0d0d6f0..bd8611b 100644 --- a/g-octave.1.rst +++ b/g-octave.1.rst @@ -48,13 +48,14 @@ OPTIONS --force-all forces the recreation of the overlay and of the ebuilds --no-colors don't use colors on the CLI --sync search for updates of the package database, patches and auxiliary files +--config return a value from the configuration file (/etc/g-octave.cfg) SEE ALSO ======== * http://g-octave.rafaelmartins.eng.br/ -* http://rafaelmartins.eng.br/en-us/projects/g-octave/ +* http://g-octave.rafaelmartins.eng.br/hg BUGS diff --git a/g_octave/fetch.py b/g_octave/fetch.py index 08f8458..2d1c249 100644 --- a/g_octave/fetch.py +++ b/g_octave/fetch.py @@ -130,10 +130,18 @@ def check_db_cache(): with open(os.path.join(conf.db, 'cache.json')) as fp: cache = json.load(fp) except: - cache = {'files': []} + cache = {'files': {}} - with open(os.path.join(conf.db, 'update.json')) as fp: - update = json.load(fp) + try: + with open(os.path.join(conf.db, 'update.json')) as fp: + update = json.load(fp) + except: + my_cache = os.listdir(conf.db) + update = {'files': []} + for f in my_cache: + for s in ['patches-', 'info-', 'octave-forge-']: + if f.startswith(s) and f not in update['files']: + update['files'].append(f) for _file in update['files']: if _file not in cache['files'].values(): diff --git a/scripts/g-octave b/scripts/g-octave index 008b5f9..81703f6 100755 --- a/scripts/g-octave +++ b/scripts/g-octave @@ -11,6 +11,8 @@ :license: GPL-2, see LICENSE for more details. """ +has_fetch = True + __issue_tracker = 'http://g-octave.rafaelmartins.eng.br/report' import sys @@ -147,15 +149,17 @@ def main(): portage.output.nocolor() from g_octave.config import Config - - has_fetch = True - try: - from g_octave.fetch import need_update, check_updates, download_files, check_db_cache - except ImportError: - has_fetch = False + from g_octave.fetch import need_update, check_updates, download_files, check_db_cache conf_prefetch = Config(True) + if options.config: + try: + print conf_prefetch.__getattr__(args[0]) + except: + return os.EX_DATAERR + return os.EX_OK + # checking if our overlay is correctly added to PORTDIR_OVERLAY if conf_prefetch.overlay not in portage.settings['PORTDIR_OVERLAY'].split(' '): out.eerror('g-octave overlay is not configured!') @@ -186,16 +190,9 @@ def main(): return os.EX_OK - check_db_cache() - - conf = Config() + check_db_cache() - if options.config: - try: - print conf.__getattr__(args[0]) - except: - return os.EX_DATAERR - return os.EX_OK + conf = Config() from g_octave.description import Description from g_octave.description_tree import DescriptionTree diff --git a/tests/test_config.py b/tests/test_config.py index 33f50b9..15f1904 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -41,7 +41,7 @@ class TestConfig(unittest.TestCase): self.assertEqual(self._empty_cfg.db, '/var/cache/g-octave') self.assertEqual(self._empty_cfg.overlay, '/usr/local/portage/g-octave') self.assertEqual(self._empty_cfg.categories, 'main,extra,language') - self.assertEqual(self._empty_cfg.db_mirror, 'http://files.rafaelmartins.eng.br/octave-forge') + self.assertEqual(self._empty_cfg.db_mirror, 'http://g-octave.rafaelmartins.eng.br/distfiles/db/') def test_config_attributes(self): self.assertEqual(self._cfg.db, '/path/to/the/db') |