diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-07-31 22:43:46 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-07-31 22:43:46 -0300 |
commit | 806c65446ac5fd27c798f8f4a24226a980356525 (patch) | |
tree | a88a37176779aee6c808bdcb64eca06d714ad4a7 /scripts | |
parent | removed the package g_octave.svn (diff) | |
download | g-octave-806c65446ac5fd27c798f8f4a24226a980356525.tar.gz g-octave-806c65446ac5fd27c798f8f4a24226a980356525.tar.bz2 g-octave-806c65446ac5fd27c798f8f4a24226a980356525.zip |
removed some scripts that are no more used
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create_database.sh | 31 | ||||
-rwxr-xr-x | scripts/package_database.py | 66 | ||||
-rwxr-xr-x | scripts/package_sources.py | 70 |
3 files changed, 0 insertions, 167 deletions
diff --git a/scripts/create_database.sh b/scripts/create_database.sh deleted file mode 100755 index 21b1b67..0000000 --- a/scripts/create_database.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -TARBALL=${1} -TMPDIR=${2:-/tmp/__octave} -CATEGORIES='main extra language' - -CURRENTDIR=$(pwd) -RELEASE=$(sed -e 's/^.*\([0-9]\{8\}\).*$/\1/' <<< ${TARBALL}) - -mkdir -p ${TMPDIR} -tar -xvzf ${TARBALL} -C ${TMPDIR} - -cd ${TMPDIR}/octave-forge* - -for cat in ${CATEGORIES}; do - mkdir -p ${TMPDIR}/{src,db}/${cat} - for pkg in $(ls ${cat}); do - mypkg=${pkg%.tar.gz} - tar -xvzf ${cat}/${pkg} -C ${TMPDIR}/src/${cat} - mkdir ${TMPDIR}/db/${cat}/${mypkg} - cp ${TMPDIR}/{src,db}/${cat}/${mypkg}/DESCRIPTION - done -done - -mkdir ${TMPDIR}/octave-forge -cp -r ${TMPDIR}/db/* ${TMPDIR}/octave-forge/ - -cd ${TMPDIR} && tar -cvzf "${CURRENTDIR}/octave-forge-${RELEASE}.db.tar.gz" \ - octave-forge - -rm -rf ${TMPDIR} diff --git a/scripts/package_database.py b/scripts/package_database.py deleted file mode 100755 index 9db45df..0000000 --- a/scripts/package_database.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" - package_database.py - ~~~~~~~~~~~~~~~~~~~ - - a simple script that create a package database from the octave-forge - SVN repository. - - :copyright: (c) 2010 by Rafael Goncalves Martins - :license: GPL-2, see LICENSE for more details. -""" - -from __future__ import print_function - -import os -import sys - -current_dir = os.path.dirname(os.path.realpath(__file__)) -if os.path.exists(os.path.join(current_dir, '..', 'g_octave')): - sys.path.insert(0, os.path.join(current_dir, '..')) - -import shutil -import tarfile -import tempfile - -from contextlib import closing - -from g_octave import config -from g_octave.svn import revisions, utils - -def main(argv): - if len(argv) < 2: - print('You should provide the name of the generated tarball', file=sys.stderr) - return 1 - conf = config.Config() - json_file = os.path.join(conf.db, 'revisions.json') - db = revisions.Revisions(json_file).get() - pkg_cache = os.listdir(conf.pkg_cache) - temp_dir = tempfile.mkdtemp() - try: - for category in db: - category_dir = os.path.join(temp_dir, category) - if not os.path.exists(category_dir): - os.makedirs(category_dir) - for package in db[category]: - for tarball in pkg_cache: - if tarball.startswith(package + '-') and tarball.endswith('.tar.gz'): - dirname = tarball[:tarball.find('.tar.gz')] - tarball_path = os.path.join(conf.pkg_cache, tarball) - with closing(tarfile.open(tarball_path, 'r:gz')) as src_tar: - src_tar.extract( - os.path.join(dirname, 'DESCRIPTION'), - path = category_dir - ) - utils.create_tarball(temp_dir, argv[1], 'octave-forge') - except Exception as err: - raise RuntimeError('An error was ocurred: %s' % err) - finally: - shutil.rmtree(temp_dir) - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/scripts/package_sources.py b/scripts/package_sources.py deleted file mode 100755 index 4196109..0000000 --- a/scripts/package_sources.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" - package_sources.py - ~~~~~~~~~~~~~~~~~~ - - a simple script that create stable source tarballs from the octave-forge - SVN repository. - - :copyright: (c) 2010 by Rafael Goncalves Martins - :license: GPL-2, see LICENSE for more details. -""" - -from __future__ import print_function - -import datetime -import os -import shutil -import sys -import tempfile - -current_dir = os.path.dirname(os.path.realpath(__file__)) -if os.path.exists(os.path.join(current_dir, '..', 'g_octave')): - sys.path.insert(0, os.path.join(current_dir, '..')) - -from g_octave import config, description -from g_octave.svn import client, utils - -def main(argv): - conf = config.Config() - svn = client.SvnClient(create_revisions=False, verbose=True) - - # create temporary stuff - temp_dir = tempfile.mkdtemp() - - try: - checkout_dir = os.path.join(temp_dir, 'checkout') - error = [] - for category, pkg in svn.update_revisions(): - cur_checkout_dir = os.path.join(checkout_dir, pkg) - os.makedirs(cur_checkout_dir) - print('Checking out the package: %s/%s' % (category, pkg)) - try: - svn.checkout_package(category, pkg, cur_checkout_dir, stable=True) - except Exception as err: - error.append('%s/%s' % (category, pkg)) - print('An error was ocurred: %s' % err) - continue - - print('Creating the tarball: %s/%s' % (category, pkg)) - desc = description.Description(os.path.join(cur_checkout_dir, 'DESCRIPTION')) - new_checkout = os.path.join(temp_dir, '%s-%s' % (pkg, desc.version)) - shutil.move(cur_checkout_dir, new_checkout) - utils.create_tarball( - new_checkout, - # using gzip for backward compatibility - '%s/%s-%s.tar.gz' % (conf.pkg_cache, pkg, desc.version), - '%s-%s' % (pkg, desc.version) - ) - except Exception as err: - raise RuntimeError('An error was ocurred: %s' % err) - finally: - shutil.rmtree(temp_dir) - if len(error) > 0: - print('Errors: %s' % ', '.join(error)) - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) |