From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:rewrite-on-master commit in: /
Date: Fri, 22 Nov 2013 07:13:28 +0000 (UTC) [thread overview]
Message-ID: <1385100156.a49fe86db3a3a0511faa51e3e5f8a9af4cf41711.dol-sen@gentoo> (raw)
commit: a49fe86db3a3a0511faa51e3e5f8a9af4cf41711
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 7 14:42:27 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Nov 22 06:02:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=a49fe86d
Streamline data_files generation with additional keys
* Move data_file generation out of setup().
* Return per-directory keys, since distutils only uses the directory
key and value filename (not the value path) when installing
data_files.
* Use relative key paths for more flexible installation.
* Raise NotImplementedError if os.path.sep is not '/', which allows
for simpler path handling.
---
setup.py | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/setup.py b/setup.py
index f585b99..6bc4a06 100755
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,6 @@ from __future__ import print_function
import codecs as _codecs
from distutils.core import setup as _setup, Command as _Command
-import itertools as _itertools
import os as _os
from catalyst import __version__
@@ -35,7 +34,10 @@ package_name = 'catalyst'
tag = '{0}-{1}'.format(package_name, __version__)
-def files(root):
+if _os.path.sep != '/':
+ raise NotImplementedError('Non-POSIX paths are not supported')
+
+def files(root, target):
"""Iterate through all the file paths under `root`
Distutils wants all paths to be written in the Unix convention
@@ -44,11 +46,18 @@ def files(root):
[1]: http://docs.python.org/2/distutils/setupscript.html#writing-the-setup-script
"""
for dirpath, dirnames, filenames in _os.walk(root):
- for filename in filenames:
- path = _os.path.join(dirpath, filename)
- if _os.path.sep != '/':
- path = path.replace(_os.path.sep, '/')
- yield path
+ key = _os.path.join(target, dirpath)
+ filepaths = [_os.path.join(dirpath, filename)
+ for filename in filenames]
+ yield (key, filepaths)
+
+
+_data_files = [('/etc/catalyst', ['etc/catalyst.conf','etc/catalystrc']),
+ ('/usr/share/man/man1', ['files/catalyst.1']),
+ ('/usr/share/man/man5', ['files/catalyst-config.5', 'files/catalyst-spec.5'])
+ ]
+_data_files.extend(files('livecd', 'lib/catalyst/'))
+_data_files.extend(files('targets', 'lib/catalyst/'))
class set_version(_Command):
@@ -106,16 +115,7 @@ _setup(
'{0}.base'.format(package_name),
'{0}.targets'.format(package_name),
],
- data_files=[
- ('/etc/catalyst', [
- 'etc/catalyst.conf',
- 'etc/catalystrc',
- ]),
- ('lib/catalyst/', list(_itertools.chain(
- files('livecd'),
- files('targets'),
- ))),
- ],
+ data_files=_data_files,
provides=[package_name],
cmdclass={
'set_version': set_version
next reply other threads:[~2013-11-22 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 7:13 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-11-22 7:13 [gentoo-commits] proj/catalyst:rewrite-on-master commit in: / Brian Dolbec
2013-11-22 7:13 Brian Dolbec
2013-11-22 7:13 Brian Dolbec
2013-11-22 7:13 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385100156.a49fe86db3a3a0511faa51e3e5f8a9af4cf41711.dol-sen@gentoo \
--to=brian.dolbec@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox