[sunzi/development] setup_prepare: fix inconsistent value usage + duplicate
by Jan Pokorný
commit 2ef7e36ba261e9a0f43979d10f120806546ae1bb
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 20:27:27 2012 +0100
setup_prepare: fix inconsistent value usage + duplicate
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
prepare-common.py | 6 ++++--
prepare-devel.py | 9 ---------
setup_prepare.py | 4 ++--
3 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/prepare-common.py b/prepare-common.py
index 17e1890..1f9d4ad 100644
--- a/prepare-common.py
+++ b/prepare-common.py
@@ -12,14 +12,16 @@ from os.path import join, basename
# parametrization
#
-# basic setup
-# TODO
+# this can be used instead of ./setup wrapper, e.g.: python setup.py cfg build
+# where "cfg" is a standard alias to "prepare --gen defaultcfg", but only
+# once any setup.cfg already exists (initally use "cp dist-files/setup.cfg .")
gen_file('defaultcfg',
join('dist-files','setup.cfg'),
'setup.cfg',
incl=False,
)
+# basic setup
nonoptions(
package = PACKAGE,
)
diff --git a/prepare-devel.py b/prepare-devel.py
index ec5c4e4..f18cba0 100644
--- a/prepare-devel.py
+++ b/prepare-devel.py
@@ -11,15 +11,6 @@ from os.path import join, exists, isfile, basename, splitext, normpath, sep
from shutil import copy2
from fnmatch import fnmatch
-# this can be used instead of ./setup wrapper, e.g.: python setup.py cfg build
-# where "cfg" is a standard alias to "prepare --gen defaultcfg", but only
-# once any setup.cfg already exists (initally use "cp dist-files/setup.cfg .")
-gen_file('defaultcfg',
- join('dist-files','setup.cfg'),
- 'setup.cfg',
- incl=False,
-)
-
#
# JavaScript and stylesheets
#
diff --git a/setup_prepare.py b/setup_prepare.py
index 5c326ef..9a79790 100644
--- a/setup_prepare.py
+++ b/setup_prepare.py
@@ -400,7 +400,7 @@ class PrepareFile(object):
self.dst_getter = lambda dst,getter: getter(dst, 'w')
self.incl = incl
- self.private = kwargs
+ self.private = kwargs # mainly to keep data between prepare and attach
self._prepared = False
def prepare(self, getter, distribution=None):
src, dst = self.do_prepare(getter, distribution)
@@ -425,7 +425,7 @@ class PreparePackageData(PrepareFile):
def do_prepare(self, getter, distribution):
# upon build
dst_top = (distribution.package_dir or {}).get('', '')
- pkg = self.private['package'] # fail if not passed from constructor
+ pkg = self.package
dst_pkg = path.join(
dst_top,
(distribution.package_dir or {}).get(pkg, pkg)
12 years, 1 month
[sunzi/development] Revert "setup_prepare.py: fix inconsistent usage of value"
by Jan Pokorný
commit 0254923fe58557caf65bee200c9a9c73d22313db
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 20:09:11 2012 +0100
Revert "setup_prepare.py: fix inconsistent usage of value"
This reverts commit 61987beb1b655834e9dddafef3ae8c5b818b7733.
Wasn't a proper solution, such one will follow.
setup_prepare.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/setup_prepare.py b/setup_prepare.py
index 36b10a5..5c326ef 100644
--- a/setup_prepare.py
+++ b/setup_prepare.py
@@ -418,6 +418,10 @@ class PrepareFile(object):
raise RuntimeError('Only PrepareFile subclasses attach distribution')
class PreparePackageData(PrepareFile):
+ def __init__(self, package, src, dst, subst=False, incl=True, **kws):
+ super(PreparePackageData, self).__init__(src, dst, subst, incl, **kws)
+ self.package = package
+
def do_prepare(self, getter, distribution):
# upon build
dst_top = (distribution.package_dir or {}).get('', '')
@@ -434,7 +438,7 @@ class PreparePackageData(PrepareFile):
def do_attach(self, distribution):
# upon build
- pkg, dst = self.private['package'], self.private['dst']
+ pkg, dst = self.package, self.private['dst']
distribution.package_data[pkg].append(dst)
class PrepareDataFile(PrepareFile):
12 years, 1 month
[sunzi/development] setup_prepare.py: fix inconsistent usage of value
by Jan Pokorný
commit 61987beb1b655834e9dddafef3ae8c5b818b7733
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 19:54:53 2012 +0100
setup_prepare.py: fix inconsistent usage of value
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
setup_prepare.py | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/setup_prepare.py b/setup_prepare.py
index 5c326ef..36b10a5 100644
--- a/setup_prepare.py
+++ b/setup_prepare.py
@@ -418,10 +418,6 @@ class PrepareFile(object):
raise RuntimeError('Only PrepareFile subclasses attach distribution')
class PreparePackageData(PrepareFile):
- def __init__(self, package, src, dst, subst=False, incl=True, **kws):
- super(PreparePackageData, self).__init__(src, dst, subst, incl, **kws)
- self.package = package
-
def do_prepare(self, getter, distribution):
# upon build
dst_top = (distribution.package_dir or {}).get('', '')
@@ -438,7 +434,7 @@ class PreparePackageData(PrepareFile):
def do_attach(self, distribution):
# upon build
- pkg, dst = self.package, self.private['dst']
+ pkg, dst = self.private['package'], self.private['dst']
distribution.package_data[pkg].append(dst)
class PrepareDataFile(PrepareFile):
12 years, 1 month
[sunzi/development] README.txt: extraneous comma
by Jan Pokorný
commit 1b54cee067ab6dcafb62449f8af371649abc6397
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 19:40:57 2012 +0100
README.txt: extraneous comma
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
README.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/README.txt b/README.txt
index c7f90e7..4764ffc 100644
--- a/README.txt
+++ b/README.txt
@@ -69,7 +69,7 @@ current dir (but feel free to modify as per your needs)::
The whole process may take a while as the steps from 2.2 are being perfomed
(third-party repositories cloned, etc.). In the internal logic of setup,
the virtualenv environment is used automatically, but you have to activate
-it manually (`source bin/activate`, look at virtualenv documentation),
+it manually (`source bin/activate`, look at virtualenv documentation)
before rerunning the application, etc.
12 years, 1 month
[sunzi/development] README.txt: elaborate on bootstrap process
by Jan Pokorný
commit 2b09ad0a88afff9d428471f5036b870aca48b8d9
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 19:38:06 2012 +0100
README.txt: elaborate on bootstrap process
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
README.txt | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/README.txt b/README.txt
index 93db649..c7f90e7 100644
--- a/README.txt
+++ b/README.txt
@@ -54,19 +54,24 @@ as usual.
2.3 Quick start (for contribution)
----------------------------------
-Bootstrap script is the fastest way to start hacking (this will setup
-virtualenv environment in the current dir, modify as per your needs)::
+Bootstrap script is the fastest way to experiment with sunzi. No external
+Python library is needed as Python side is well-managed in the isolated
+virtualenv environment. This snippet will setup the environment in the
+current dir (but feel free to modify as per your needs)::
URL='http://git.fedorahosted.org/git/?p=sunzi.git;a=blob_plain;f=sunzi-bootstr...'
- ENV=.
- curl $URL | python -c 'import sys;__file__="_";exec(sys.stdin.read())' $ENV
-
-The whole process may take a while as the steps from 2.2 are being perfomed
-(third-party repositories cloned, etc.).
-
+ ARGS=". " # actual arguments for virtualenv (target dir has to be present)
+ curl $URL | python -c'import sys;__file__="_";exec(sys.stdin.read())' $ARGS
+ # or download $URL locally and run as a common Python script...
.. TODO: URL may be even static file, e.g., on fedorapeople.org
+The whole process may take a while as the steps from 2.2 are being perfomed
+(third-party repositories cloned, etc.). In the internal logic of setup,
+the virtualenv environment is used automatically, but you have to activate
+it manually (`source bin/activate`, look at virtualenv documentation),
+before rerunning the application, etc.
+
.. ``TODO``
.. Prerequisities for successful build/installation/deployment:
12 years, 1 month
[sunzi/development] README.txt: document usage of bootstrap script
by Jan Pokorný
commit eaf753f01dad5ef0c493a3095fb6539123d0116f
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 19:16:19 2012 +0100
README.txt: document usage of bootstrap script
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
README.txt | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/README.txt b/README.txt
index 51e5e92..93db649 100644
--- a/README.txt
+++ b/README.txt
@@ -20,7 +20,8 @@ framework.
=========================
In case of using distro-packaged version of `sunzi`, you can skip
-to point ``TODO``.
+to point ``TODO``. If you want to contribute, you may be also
+skip down to point 2.3.
2.1 Dependencies
----------------
@@ -50,6 +51,23 @@ of `setup.cfg` (from the path above) before actually performing requested
forgot". To preserve a copy of `setup.cfg`, just use `python setup.py`
as usual.
+2.3 Quick start (for contribution)
+----------------------------------
+
+Bootstrap script is the fastest way to start hacking (this will setup
+virtualenv environment in the current dir, modify as per your needs)::
+
+ URL='http://git.fedorahosted.org/git/?p=sunzi.git;a=blob_plain;f=sunzi-bootstr...'
+ ENV=.
+ curl $URL | python -c 'import sys;__file__="_";exec(sys.stdin.read())' $ENV
+
+The whole process may take a while as the steps from 2.2 are being perfomed
+(third-party repositories cloned, etc.).
+
+
+.. TODO: URL may be even static file, e.g., on fedorapeople.org
+
+
.. ``TODO``
.. Prerequisities for successful build/installation/deployment:
..
12 years, 1 month
[sunzi/development] bootstrap process: move few steps further
by Jan Pokorný
commit 8909e2a7352ef72940b3b7ce43189e735f98bb1c
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 18:20:59 2012 +0100
bootstrap process: move few steps further
It will still get stuck at paste commands.
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
README.txt | 13 ++++--
dist-files/setup.cfg | 1 +
input-files/bootstrap-create.py | 33 ++++++++--------
input-files/bootstrap-recipe.py | 50 ++++++++++++++++--------
prepare-common.py | 6 +++
prepare-devel.py | 15 ++++---
setup | 18 ++++++---
bootstrap-virtualenv.py => sunzi-bootstrap.py | 52 +++++++++++++++++--------
8 files changed, 122 insertions(+), 66 deletions(-)
---
diff --git a/README.txt b/README.txt
index 0154130..51e5e92 100644
--- a/README.txt
+++ b/README.txt
@@ -39,13 +39,16 @@ to also initialize third-party bundles, necessary for successful
package build.
Another enabling step is to get an initial `setup.cfg` file (unless you want
-to provide all the parameters in command-line). To do so, either run::
+to provide all the parameters in command-line) as a copy of the default one::
- python setup.py prepare --gen defaultcfg
+ cp dist-files/setup.cfg .
-or, equivalently, grab a copy from `dist-files/setup.cfg` location.
-Most convenient way is to use `./setup` shell wrapper of `python setup.py`
-that will ensure `setup.cfg` exists, copying it if needed, for you.
+Probably more convenient is to use `./setup` shell wrapper at places you
+would use `python setup.py`. This will ensure you have pristine version
+of `setup.cfg` (from the path above) before actually performing requested
+`setup.py` command(s), which can prevent "oh, I had edited setup.cfg and
+forgot". To preserve a copy of `setup.cfg`, just use `python setup.py`
+as usual.
.. ``TODO``
.. Prerequisities for successful build/installation/deployment:
diff --git a/dist-files/setup.cfg b/dist-files/setup.cfg
index 18f89b6..d201377 100644
--- a/dist-files/setup.cfg
+++ b/dist-files/setup.cfg
@@ -30,6 +30,7 @@ pamdir = /etc/pam.d
sasl2dir = /etc/sasl2
[aliases]
+cfg = prepate --gen defaultcfg
stylesheet = prepare --gen stylesheet
specfile = prepare --gen specfile
tarball = prepare --gen-all sdist --formats=gztar
diff --git a/input-files/bootstrap-create.py b/input-files/bootstrap-create.py
old mode 100644
new mode 100755
index a21428b..b699ab2
--- a/input-files/bootstrap-create.py
+++ b/input-files/bootstrap-create.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# Copyright 2012 Red Hat, Inc.
# Part of sunzi project
# Licensed under GPLv2 (a copy included / http://gnu.org/licenses/gpl-2.0.txt)
@@ -6,25 +7,25 @@
Use ``python dist-files/bootstrap-create.py`` to update ``bootstrap-virtualenv.py``.
"""
from __future__ import print_function
-import sys
from os import path
import virtualenv
-import textwrap
-SCRIPT_NAME = '../bootstrap-virtualenv.py'
-EXTRA_TEXT_NAME = 'bootstrap-recipe.py'
+this_dir = path.dirname(path.abspath(__file__))
+parent_dir = path.dirname(this_dir)
+SCRIPT_NAME = path.join(parent_dir, 'sunzi-bootstrap.py')
+EXTRA_TEXT_NAME = path.join(this_dir, 'bootstrap-recipe.py')
-def main(argv):
- here = path.dirname(argv[0])
- script_name = path.normpath(path.join(here, SCRIPT_NAME))
- extra_text_name = path.normpath(path.join(here, EXTRA_TEXT_NAME))
-
- try:
- with open(extra_text_name) as f:
- extra_text = f.read()
- except EnvironmentError, exc:
- print('Unable to open/read %s' % extra_text_name)
- exit
+# NOTE: can be extended by custom options (hint: extend_parser)
+def main(script_name, extra_text_name=None):
+ if extra_text_name:
+ try:
+ with open(extra_text_name) as f:
+ extra_text = f.read()
+ except EnvironmentError:
+ print('Unable to open/read %s' % extra_text_name)
+ raise
+ else:
+ extra_text = ''
new_script = virtualenv.create_bootstrap_script(extra_text)
if path.exists(script_name):
@@ -41,4 +42,4 @@ def main(argv):
f.write(new_script)
if __name__ == '__main__':
- main(sys.argv)
+ main(SCRIPT_NAME, EXTRA_TEXT_NAME)
diff --git a/input-files/bootstrap-recipe.py b/input-files/bootstrap-recipe.py
index 9a142d6..eb736a6 100644
--- a/input-files/bootstrap-recipe.py
+++ b/input-files/bootstrap-recipe.py
@@ -6,36 +6,54 @@
Used by bootstrap-create.py that includes this into final bootstrap script.
"""
import subprocess
-from os.path import join
+from os import environ
+from os.path import join, curdir, abspath
-SUNZI_GIT = 'git://git.fedorahosted.org/sunzi.git'
+# TODO: switch for RO an RW git access (RO only now) + branch
+SUNZI_GIT_RO = 'git://git.fedorahosted.org/sunzi.git'
+SUNZI_GIT_RW = 'ssh://git.fedorahosted.org/git/sunzi.git'
+SUNZI_GIT_BRANCH = 'development'
+# subdir to be created within a new virtualenv environment
SUNZI_DIR = 'sunzi'
+def from_cwd(prog):
+ return join(curdir, prog)
+
def after_install(options, home_dir):
- sunzi_dir = join(home_dir, 'SUNZI_DIR')
- python = join(home_dir, 'bin', 'python')
- #paster = path.join(home_dir, 'bin', 'paster')
+ sunzi_dir = join(home_dir, SUNZI_DIR)
+ # path of virtualenv-infected programs
+ python = abspath(join(home_dir, 'bin', 'python'))
+ paster = abspath(join(home_dir, 'bin', 'paster'))
+
+ env = environ.copy()
+ env['PYTHON'] = python
cmds = [
- dict(cmd=['git','clone', SUNZI_GIT, sunzi_dir]),
- # just to ensure existing setup.cfg
- dict(cmd=[join(sunzi_dir, 'setup')]),
- dict(cwd=sunzi_dir,
- cmd=[join('third-party','init.sh'), 'all']),
+ # see also README.txt
+ dict(args=['git','clone','-b',SUNZI_GIT_BRANCH,SUNZI_GIT_RO,sunzi_dir],
+ keepgoing=True),
+ dict(cwd=join(sunzi_dir, 'third-party'),
+ args=[from_cwd('init.sh'),'all']),
+ # just to ensure existing setup.cfg (PYTHON from env)
dict(cwd=sunzi_dir,
- cmd=[python, 'setup.py', 'prepare', '--develop']),
- # TODO: see dev.sh at luci
+ args=[from_cwd('setup'),'prepare','--develop']),
+ # TODO: see also dev.sh at luci
#dict(cwd=sunzi_dir,
# cmd=['paster', 'make-config', 'sunzi', 'development.ini'],
#dict(cwd=sunzi_dir,
# cmd=['paster', 'setup-app', 'sunzi', 'development.ini'],
]
+ run_commands(cmds, env)
+def run_commands(cmds, env=None):
for cmd in cmds:
- print('Running `%s\'' % ' '.join(cmd['cmd']))
- ret = subprocess.call(**cmd)
+ args = cmd.pop('args')
+ keepgoing = cmd.pop('keepgoing', False)
+ print('Running `%s\' with CWD: `%s\''
+ % (' '.join(args), cmd.get('cwd', '(no change)')))
+ ret = subprocess.call(args, env=env, **cmd)
if ret > 0:
print('Nonzero exit code: %d' % ret)
elif ret < 0:
print('Killed by signal %d' % -ret)
- if ret != 0:
- return
+ if ret != 0 and not keepgoing:
+ break
diff --git a/prepare-common.py b/prepare-common.py
index 025a349..17e1890 100644
--- a/prepare-common.py
+++ b/prepare-common.py
@@ -14,6 +14,12 @@ from os.path import join, basename
# basic setup
# TODO
+gen_file('defaultcfg',
+ join('dist-files','setup.cfg'),
+ 'setup.cfg',
+ incl=False,
+)
+
nonoptions(
package = PACKAGE,
)
diff --git a/prepare-devel.py b/prepare-devel.py
index c3d0627..ec5c4e4 100644
--- a/prepare-devel.py
+++ b/prepare-devel.py
@@ -11,6 +11,15 @@ from os.path import join, exists, isfile, basename, splitext, normpath, sep
from shutil import copy2
from fnmatch import fnmatch
+# this can be used instead of ./setup wrapper, e.g.: python setup.py cfg build
+# where "cfg" is a standard alias to "prepare --gen defaultcfg", but only
+# once any setup.cfg already exists (initally use "cp dist-files/setup.cfg .")
+gen_file('defaultcfg',
+ join('dist-files','setup.cfg'),
+ 'setup.cfg',
+ incl=False,
+)
+
#
# JavaScript and stylesheets
#
@@ -171,9 +180,3 @@ gen_file('stylesheet',
)
# similarly for JavaScript files (but 1:1 mapping kept)
javascript_items.make_params(PACKAGE,PUBLIC,JAVASCRIPT_ROOT)
-
-gen_file('defaultcfg',
- join('dist-files','setucfg'),
- 'setup.cfg',
- subst=True, incl=False,
-)
diff --git a/setup b/setup
index ec08964..bdd391e 100755
--- a/setup
+++ b/setup
@@ -9,17 +9,23 @@
if [ -z "$PYTHON" ]; then
PYTHON=python
fi
-
+ORIG=dist-files/setup.cfg
+USED=setup.cfg
ARCHIVE=$(ls -1v *.tar.gz 2>/dev/null | head -n1)
+
if [ -n "$ARCHIVE" ] ; then
# refresh files from the newest archive if any present
+ echo "extracting necessary files from archive ${ARCHIVE}..."
EXTRACT='*/setup* */prepare-{common,dist}.py */metadata.py'
tar xf "$ARCHIVE" --strip-components=1 --wildcards "$EXTRACT"
+elif diff "$USED" "$ORIG" >/dev/null 2>&1; then
+ # no change detected
+ echo "using existing ${USED}..."
else
- # or at least, start with pristine setup.cfg if missing
- # hint: you can always run python setup.py directly
- cp dist-files/setup.cfg . 2>/dev/null
- # alternatively: $PYTHON setup.py prepare --gen defaultcfg
+ # either change detected or missing $USED
+ # hint: you can always run python setup.py directly to avoid this
+ echo "using pristine ${USED} from ${ORIG} (making backup if needed)..."
+ mv -f -- "$USED" "${ORIG}.$(date +%y%m%d-%H%M%S)" 2>/dev/null
+ cp -f -- "$ORIG" "$USED"
fi
-
[ $# -eq 0 ] || "$PYTHON" setup.py "$@"
diff --git a/bootstrap-virtualenv.py b/sunzi-bootstrap.py
similarity index 98%
rename from bootstrap-virtualenv.py
rename to sunzi-bootstrap.py
index ead3082..53dbfb1 100644
--- a/bootstrap-virtualenv.py
+++ b/sunzi-bootstrap.py
@@ -1544,39 +1544,57 @@ def create_bootstrap_script(extra_text, python_version=''):
Used by bootstrap-create.py that includes this into final bootstrap script.
"""
import subprocess
-from os.path import join
-
-SUNZI_GIT = 'git://git.fedorahosted.org/sunzi.git'
+from os import environ
+from os.path import join, curdir, abspath
+
+# TODO: switch for RO an RW git access (RO only now) + branch
+SUNZI_GIT_RO = 'git://git.fedorahosted.org/sunzi.git'
+SUNZI_GIT_RW = 'ssh://git.fedorahosted.org/git/sunzi.git'
+SUNZI_GIT_BRANCH = 'development'
+# subdir to be created within a new virtualenv environment
SUNZI_DIR = 'sunzi'
+def from_cwd(prog):
+ return join(curdir, prog)
+
def after_install(options, home_dir):
- sunzi_dir = join(home_dir, 'SUNZI_DIR')
- python = join(home_dir, 'bin', 'python')
- #paster = path.join(home_dir, 'bin', 'paster')
+ sunzi_dir = join(home_dir, SUNZI_DIR)
+ # path of virtualenv-infected programs
+ python = abspath(join(home_dir, 'bin', 'python'))
+ paster = abspath(join(home_dir, 'bin', 'paster'))
+
+ env = environ.copy()
+ env['PYTHON'] = python
cmds = [
- dict(cmd=['git','clone', SUNZI_GIT, sunzi_dir]),
- # just to ensure existing setup.cfg
- dict(cmd=[join(sunzi_dir, 'setup')]),
- dict(cwd=sunzi_dir,
- cmd=[join('third-party','init.sh'), 'all']),
+ # see also README.txt
+ dict(args=['git','clone','-b',SUNZI_GIT_BRANCH,SUNZI_GIT_RO,sunzi_dir],
+ keepgoing=True),
+ dict(cwd=join(sunzi_dir, 'third-party'),
+ args=[from_cwd('init.sh'),'all']),
+ # just to ensure existing setup.cfg (PYTHON from env)
dict(cwd=sunzi_dir,
- cmd=[python, 'setup.py', 'prepare', '--develop']),
- # TODO: see dev.sh at luci
+ args=[from_cwd('setup'),'prepare','--develop']),
+ # TODO: see also dev.sh at luci
#dict(cwd=sunzi_dir,
# cmd=['paster', 'make-config', 'sunzi', 'development.ini'],
#dict(cwd=sunzi_dir,
# cmd=['paster', 'setup-app', 'sunzi', 'development.ini'],
]
+ run_commands(cmds, env)
+def run_commands(cmds, env=None):
for cmd in cmds:
- print('Running `%s\'' % ' '.join(cmd['cmd']))
- ret = subprocess.call(**cmd)
+ args = cmd.pop('args')
+ keepgoing = cmd.pop('keepgoing', False)
+ print('Running `%s\' with CWD: `%s\''
+ % (' '.join(args), cmd.get('cwd', '(no change)')))
+ ret = subprocess.call(args, env=env, **cmd)
if ret > 0:
print('Nonzero exit code: %d' % ret)
elif ret < 0:
print('Killed by signal %d' % -ret)
- if ret != 0:
- return
+ if ret != 0 and not keepgoing:
+ break
def convert(s):
12 years, 1 month
[sunzi/development] init.sh: comment wrt. reliance on being in git repo
by Jan Pokorný
commit 3e836a46466bae04adcb1a2a3531dfed28f28063
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 15:58:27 2012 +0100
init.sh: comment wrt. reliance on being in git repo
(third-party/init.sh)
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
third-party/init.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/third-party/init.sh b/third-party/init.sh
index 08d2203..8f70202 100755
--- a/third-party/init.sh
+++ b/third-party/init.sh
@@ -2,6 +2,8 @@
# vim: noet:ts=8:sw=8
# jpokorny(a)redhat.com
# NOTE: not ready for arbitrary CWD, from . only
+# NOTE: this is always to be run from within git repo so things like
+# "git rev-parse" will work (see do_git_submodule)
#
# internals
12 years, 1 month
[sunzi/development] README.*: vim modeline, adjust README.maint
by Jan Pokorný
commit e582f78e02080be61f917fb0d5458b593fda312b
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 15:21:51 2012 +0100
README.*: vim modeline, adjust README.maint
... to reflect current state
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
README.contrib | 2 +-
README.maint | 75 +++++++++++++++++++++++--------------------------------
README.txt | 3 +-
3 files changed, 34 insertions(+), 46 deletions(-)
---
diff --git a/README.contrib b/README.contrib
index c2fd5e7..867e0c4 100644
--- a/README.contrib
+++ b/README.contrib
@@ -54,4 +54,4 @@ are shown so it can be fixed easily, otherwise one has to be
careful on his/her own or run the checker manually.
-.. vim:syntax=rst fileencoding=utf-8:
+.. vim: et:ts=4:sw=4:fileencoding=utf-8:syntax=rst
diff --git a/README.maint b/README.maint
index 9768574..6e0be6f 100644
--- a/README.maint
+++ b/README.maint
@@ -89,23 +89,25 @@ III. Fedora/RHEL release instructions
A. Make a fresh upstream-based release in Fedora/RHEL
-----------------------------------------------------
1. Upload tarball (see II.A.).
-2. Bring local `setup` shell script with you to the target location
+2. Bring `setup` shell script with you to the target location
of the tarball; this is 1/ convenient wrapper around `setup.py`
invocations and 2/ way to ensure the `dist-files` and `setup*.py`
are used in a version-local pristine form.
-3. Add something like "rebase to ver. X" to `CHANGES.{fedora,rhel}`
+3. Bring with you also `dist/{CHANGES,PATCHES}.dist` files and change
+ the suffix to `fedora` or `rhel` respectively.
+4. Add something like "rebase to ver. X" to `CHANGES.*`
(classic RPM changelog format incl. date-name-release line).
-4. Generate specfile::
+5. Generate specfile::
- $ ./setup fedora # or rhel
+ $ ./setup fedora specfile # or rhel
-5. Ready to build RPM, share `CHANGES.*` file ...
+6. Ready to build RPM, share `CHANGES.*` file ...
B. Make a patches-added release in Fedora/RHEL
----------------------------------------------
1. Attach new patches.
-2. Add these new patches to `patches.{fedora,rhel}`.
-3. See A3.-A5. (share `patches.*` as well).
+2. Add these new patches to `PATCHES.*`.
+3. See A4.-A6. (share `PATCHES.*` as well).
C. Make a scratch build in Fedora/RHEL
--------------------------------------
@@ -120,47 +122,32 @@ C. Make a scratch build in Fedora/RHEL
IV. Maintaining third-party bundles
===================================
-A. jQuery
----------
-Currently, jQuery release is taken from jQueryUI repo (avoids the need
-to build the final `jquery.js` from sources in jQuery repo while keeping
-up-to-date is conveniently simple and the compatibility with current
-jQueryUI is guaranteed -- provided that also this package is kept
-up-to-date.
+A. Adding a new bundle
+----------------------
+Depends on the type of source location (git repo, SVN repo, etc.).
+Also depends, whether the desired files can be consumed directly
+or not.
-Start creating your local `sunzi` tracking branch to track current
-stable branch of jQuery UI::
+Please, take existing ones in the `third-party` directory as
+an example.
- cd third-party/jquery-ui
- git checkout -b sunzi -t origin/1-8-stable # as per current situation
+Generally, git repositories are added as git submodules, and thus
+the position in respective commits graph forms a part of state
+of our base repository. Contrary, SVN and other VCSs has to
+have such position defined explicitly.
-Once this is set up, and you want update (if available) jquery.js, use::
+(unfinished...)
- cd third-party/jquery-ui
- git checkout sunzi
- git pull
- cd ../..
- # (globally) update info about the current head within the submodule
- # git status will show you "third-party/jquery-ui (new commits)"
- git add third-party/jquery-ui
- git commit -sm "sync third-party/jquery-ui: new jquery version"
+B. Updating current bundle
+--------------------------
+Again, depends on the type of source location.
-However, the last two steps do only when you tested the version to work
-properly and want to make it project default version; otherwise do
-**not** commit and perhaps even use `git submodule update` which should
-revert previous pulls of submodules so you are back in sync).
+With git repository (contained as git submodule), you only have
+to visit respective subdirectory, change the position within
+commits graph (e.g., git pull; git tags; git checkout 1.0.42)
+and commit the change indicated for this subdirectory.
+If the content is cached in another directory within `third-party`,
+do not forget to refresh the deliveries from the updated sources,
-NOTE: investigate, whether this workflow ^ will work.
-This is all you have to do manually, `setup.py` will pick up the latest
-`jquery-*.js` from `third-party/jquery-ui` dir (if there are more).
-
-TODO: alternatively, take it from `tw.jquery` SVN checkout?
-
-
-B. jQuery UI
-------------
-TODO: build manually from `third-party/jquery-ui` repo?
-
-
-.. vim:syntax=rst fileencoding=utf-8:
+.. vim: et:ts=4:sw=4:fileencoding=utf-8:syntax=rst
diff --git a/README.txt b/README.txt
index 394f15d..0154130 100644
--- a/README.txt
+++ b/README.txt
@@ -217,4 +217,5 @@ that will ensure `setup.cfg` exists, copying it if needed, for you.
.. :Homepage: http://sources.redhat.com/cluster/wiki/Luci
-.. vim:syntax=rst fileencoding=utf-8:
+
+.. vim: et:ts=4:sw=4:fileencoding=utf-8:syntax=rst
12 years, 1 month
[sunzi/development] setup.py: forgotten change re: commit c5f4afa
by Jan Pokorný
commit 7f63e668b170b914757efc29697837f0d9d36905
Author: Jan Pokorný <jpokorny(a)redhat.com>
Date: Sat Feb 25 15:18:36 2012 +0100
setup.py: forgotten change re: commit c5f4afa
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index d798f94..cd39bb5 100644
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ phase = Phase.DEFAULT
phase |= path.exists('setup') and Phase.DEVELDIR # not within Python package
phase |= path.exists('.git') and Phase.GITDIR # ditto
-params_import = ['prepare-common.py']
+params_import = ['prepare-common.py', 'prepare-dist.py']
if phase & Phase.DEVELDIR:
params_import.append('prepare-devel.py')
12 years, 1 month