aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST.in1
-rw-r--r--repoman/MANIFEST.in3
-rw-r--r--repoman/README49
-rw-r--r--repoman/TEST-NOTES45
-rwxr-xr-xrepoman/bin/repoman (renamed from bin/repoman)0
-rw-r--r--repoman/cnf/metadata.xsd (renamed from cnf/metadata.xsd)0
-rw-r--r--repoman/man/repoman.1 (renamed from man/repoman.1)0
-rw-r--r--repoman/pym/repoman/__init__.py (renamed from pym/repoman/__init__.py)0
-rw-r--r--repoman/pym/repoman/_portage.py (renamed from pym/repoman/_portage.py)0
-rw-r--r--repoman/pym/repoman/_subprocess.py (renamed from pym/repoman/_subprocess.py)0
-rw-r--r--repoman/pym/repoman/actions.py (renamed from pym/repoman/actions.py)0
-rw-r--r--repoman/pym/repoman/argparser.py (renamed from pym/repoman/argparser.py)0
-rw-r--r--repoman/pym/repoman/check_missingslot.py (renamed from pym/repoman/check_missingslot.py)0
-rw-r--r--repoman/pym/repoman/checks/__init__.py (renamed from pym/repoman/checks/__init__.py)0
-rw-r--r--repoman/pym/repoman/checks/herds/__init__.py (renamed from pym/repoman/checks/herds/__init__.py)0
-rw-r--r--repoman/pym/repoman/checks/herds/herdbase.py (renamed from pym/repoman/checks/herds/herdbase.py)0
-rw-r--r--repoman/pym/repoman/checks/herds/metadata.py (renamed from pym/repoman/checks/herds/metadata.py)0
-rw-r--r--repoman/pym/repoman/copyrights.py (renamed from pym/repoman/copyrights.py)0
-rw-r--r--repoman/pym/repoman/errors.py (renamed from pym/repoman/errors.py)0
-rw-r--r--repoman/pym/repoman/gpg.py (renamed from pym/repoman/gpg.py)0
-rwxr-xr-xrepoman/pym/repoman/main.py (renamed from pym/repoman/main.py)0
-rw-r--r--repoman/pym/repoman/metadata.py (renamed from pym/repoman/metadata.py)0
-rw-r--r--repoman/pym/repoman/modules/__init__.py (renamed from pym/repoman/modules/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/commit/__init__.py (renamed from pym/repoman/modules/commit/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/commit/repochecks.py (renamed from pym/repoman/modules/commit/repochecks.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/__init__.py (renamed from pym/repoman/modules/scan/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/depend/__init__.py (renamed from pym/repoman/modules/scan/depend/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/depend/_depend_checks.py (renamed from pym/repoman/modules/scan/depend/_depend_checks.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/depend/_gen_arches.py (renamed from pym/repoman/modules/scan/depend/_gen_arches.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/depend/profile.py (renamed from pym/repoman/modules/scan/depend/profile.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/directories/__init__.py (renamed from pym/repoman/modules/scan/directories/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/directories/files.py (renamed from pym/repoman/modules/scan/directories/files.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/directories/mtime.py (renamed from pym/repoman/modules/scan/directories/mtime.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/eapi/__init__.py (renamed from pym/repoman/modules/scan/eapi/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/eapi/eapi.py (renamed from pym/repoman/modules/scan/eapi/eapi.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/__init__.py (renamed from pym/repoman/modules/scan/ebuild/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/checks.py (renamed from pym/repoman/modules/scan/ebuild/checks.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/ebuild.py (renamed from pym/repoman/modules/scan/ebuild/ebuild.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/errors.py (renamed from pym/repoman/modules/scan/ebuild/errors.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/ebuild/multicheck.py (renamed from pym/repoman/modules/scan/ebuild/multicheck.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/eclasses/__init__.py (renamed from pym/repoman/modules/scan/eclasses/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/eclasses/live.py (renamed from pym/repoman/modules/scan/eclasses/live.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/eclasses/ruby.py (renamed from pym/repoman/modules/scan/eclasses/ruby.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/fetch/__init__.py (renamed from pym/repoman/modules/scan/fetch/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/fetch/fetches.py (renamed from pym/repoman/modules/scan/fetch/fetches.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/keywords/__init__.py (renamed from pym/repoman/modules/scan/keywords/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/keywords/keywords.py (renamed from pym/repoman/modules/scan/keywords/keywords.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/manifest/__init__.py (renamed from pym/repoman/modules/scan/manifest/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/manifest/manifests.py (renamed from pym/repoman/modules/scan/manifest/manifests.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/__init__.py (renamed from pym/repoman/modules/scan/metadata/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/description.py (renamed from pym/repoman/modules/scan/metadata/description.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py (renamed from pym/repoman/modules/scan/metadata/ebuild_metadata.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/pkgmetadata.py (renamed from pym/repoman/modules/scan/metadata/pkgmetadata.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/restrict.py (renamed from pym/repoman/modules/scan/metadata/restrict.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/metadata/use_flags.py (renamed from pym/repoman/modules/scan/metadata/use_flags.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/options/__init__.py (renamed from pym/repoman/modules/scan/options/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/options/options.py (renamed from pym/repoman/modules/scan/options/options.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/scan.py (renamed from pym/repoman/modules/scan/scan.py)0
-rw-r--r--repoman/pym/repoman/modules/scan/scanbase.py (renamed from pym/repoman/modules/scan/scanbase.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/None/__init__.py (renamed from pym/repoman/modules/vcs/None/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/None/changes.py (renamed from pym/repoman/modules/vcs/None/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/None/status.py (renamed from pym/repoman/modules/vcs/None/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/__init__.py (renamed from pym/repoman/modules/vcs/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/bzr/__init__.py (renamed from pym/repoman/modules/vcs/bzr/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/bzr/changes.py (renamed from pym/repoman/modules/vcs/bzr/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/bzr/status.py (renamed from pym/repoman/modules/vcs/bzr/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/changes.py (renamed from pym/repoman/modules/vcs/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/cvs/__init__.py (renamed from pym/repoman/modules/vcs/cvs/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/cvs/changes.py (renamed from pym/repoman/modules/vcs/cvs/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/cvs/status.py (renamed from pym/repoman/modules/vcs/cvs/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/git/__init__.py (renamed from pym/repoman/modules/vcs/git/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/git/changes.py (renamed from pym/repoman/modules/vcs/git/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/git/status.py (renamed from pym/repoman/modules/vcs/git/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/hg/__init__.py (renamed from pym/repoman/modules/vcs/hg/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/hg/changes.py (renamed from pym/repoman/modules/vcs/hg/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/hg/status.py (renamed from pym/repoman/modules/vcs/hg/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/settings.py (renamed from pym/repoman/modules/vcs/settings.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/svn/__init__.py (renamed from pym/repoman/modules/vcs/svn/__init__.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/svn/changes.py (renamed from pym/repoman/modules/vcs/svn/changes.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/svn/status.py (renamed from pym/repoman/modules/vcs/svn/status.py)0
-rw-r--r--repoman/pym/repoman/modules/vcs/vcs.py (renamed from pym/repoman/modules/vcs/vcs.py)0
-rw-r--r--repoman/pym/repoman/profile.py (renamed from pym/repoman/profile.py)0
-rw-r--r--repoman/pym/repoman/qa_data.py (renamed from pym/repoman/qa_data.py)0
-rw-r--r--repoman/pym/repoman/qa_tracker.py (renamed from pym/repoman/qa_tracker.py)0
-rw-r--r--repoman/pym/repoman/repos.py (renamed from pym/repoman/repos.py)0
-rw-r--r--repoman/pym/repoman/scanner.py (renamed from pym/repoman/scanner.py)0
-rw-r--r--repoman/pym/repoman/tests/__init__.py (renamed from pym/portage/tests/repoman/__init__.py)0
-rw-r--r--repoman/pym/repoman/tests/__test__.py (renamed from pym/portage/tests/repoman/__test__.py)0
-rw-r--r--repoman/pym/repoman/tests/changelog/__init__.py2
-rw-r--r--repoman/pym/repoman/tests/changelog/test_echangelog.py (renamed from pym/portage/tests/repoman/test_echangelog.py)0
-rw-r--r--repoman/pym/repoman/tests/runTests.py61
-rw-r--r--repoman/pym/repoman/tests/simple/__init__.py2
-rw-r--r--repoman/pym/repoman/tests/simple/test_simple.py (renamed from pym/portage/tests/repoman/test_simple.py)0
-rw-r--r--repoman/pym/repoman/utilities.py (renamed from pym/repoman/utilities.py)0
-rwxr-xr-xrepoman/setup.py662
-rwxr-xr-xsetup.py4
96 files changed, 826 insertions, 3 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 217846053..4f6cac162 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -12,7 +12,6 @@ include cnf/make.conf.example.*
# extra files for tests
include .portage_not_installed
-include cnf/metadata.xsd
# extra scripts
include misc/*
diff --git a/repoman/MANIFEST.in b/repoman/MANIFEST.in
new file mode 100644
index 000000000..ed81a97db
--- /dev/null
+++ b/repoman/MANIFEST.in
@@ -0,0 +1,3 @@
+
+# for the tests
+include cnf/metadata.xsd
diff --git a/repoman/README b/repoman/README
new file mode 100644
index 000000000..5e78842c9
--- /dev/null
+++ b/repoman/README
@@ -0,0 +1,49 @@
+About Portage
+=============
+
+Portage is a package management system based on ports collections. The
+Package Manager Specification Project (PMS) standardises and documents
+the behaviour of Portage so that the Portage tree can be used by other
+package managers.
+
+
+Dependencies
+============
+
+Python and Bash should be the only hard dependencies. Python 2.7 is the
+minimum supported version.
+
+
+Licensing and Legalese
+=======================
+
+Portage is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+version 2 as published by the Free Software Foundation.
+
+Portage is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Portage; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.
+
+
+More information
+================
+
+-DEVELOPING contains some code guidelines.
+-LICENSE contains the GNU General Public License version 2.
+-NEWS contains new features/major bug fixes for each version.
+-RELEASE NOTES contains mainly upgrade information for each version.
+-TEST-NOTES contains Portage unit test information.
+
+
+Links
+=====
+Gentoo project page: <https://wiki.gentoo.org/wiki/Project:Portage>
+PMS: <https://dev.gentoo.org/~ulm/pms/head/pms.html>
+PMS git repo: <https://gitweb.gentoo.org/proj/pms.git/>
diff --git a/repoman/TEST-NOTES b/repoman/TEST-NOTES
new file mode 100644
index 000000000..f9c6ab0cd
--- /dev/null
+++ b/repoman/TEST-NOTES
@@ -0,0 +1,45 @@
+UnitTests
+---------
+
+Portage has some tests that use the unittest framework that ships with python (2.3-2.4ish)
+Tests have a specific naming convention.
+
+in pym/portage/tests/ there is a runTest script that invokes pym/portage/tests/__init__.py
+
+This init looks at a hardcoded list of test dirs to search for tests.
+If you add a new dir and don't see your new tests, make sure that the dir is in this list.
+
+On the subject of adding more directories; the layout is basically 1 directory per portage
+file at this point (we have few files, and even fewer large files). Inside of the dir
+you should have files of the form test_${function}.py.
+
+So if I was to write a vercmp test, and vercmp is in portage_versions.
+
+pym/portage/tests/portage_versions/test_vercmp.py
+
+would be the filename.
+
+The __init__.py file now does recursive tests, but you need to tell it so. For example, if
+you had cache tests the dir format would be something like...
+
+pym/portage/tests/cache/flat_hash/test_foo.py
+
+and you would put "cache/flat_hash" into the testDirs variable in __init__.py.
+
+
+Skipping
+--------
+
+Please use the portage.tests.* classes as they support throwing a SkipException for
+tests that are known to fail. Normally one uses testing to do Test Driven Development
+(TDD); however we do not do that here. Therefore there are times when legitimate tests
+exist but fail due to code in trunk. We would still like the suite to pass in some instances
+because the suite is built around two things, testing functionality in the current code as
+well as poking holes in the current code (isvalidatom is an example). So sometimes we desire
+a test to point out that "this needs fixing" but it doesn't affect portage's overall
+functionality. You should raise portage.tests.SkipException in that case.
+
+emerge
+------
+
+The emerge namespace currently has 0 tests (and no runner)
diff --git a/bin/repoman b/repoman/bin/repoman
index 819e0f543..819e0f543 100755
--- a/bin/repoman
+++ b/repoman/bin/repoman
diff --git a/cnf/metadata.xsd b/repoman/cnf/metadata.xsd
index 0ead09ee8..0ead09ee8 100644
--- a/cnf/metadata.xsd
+++ b/repoman/cnf/metadata.xsd
diff --git a/man/repoman.1 b/repoman/man/repoman.1
index e2b9c668a..e2b9c668a 100644
--- a/man/repoman.1
+++ b/repoman/man/repoman.1
diff --git a/pym/repoman/__init__.py b/repoman/pym/repoman/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/__init__.py
+++ b/repoman/pym/repoman/__init__.py
diff --git a/pym/repoman/_portage.py b/repoman/pym/repoman/_portage.py
index 0f611f761..0f611f761 100644
--- a/pym/repoman/_portage.py
+++ b/repoman/pym/repoman/_portage.py
diff --git a/pym/repoman/_subprocess.py b/repoman/pym/repoman/_subprocess.py
index dcdc985fe..dcdc985fe 100644
--- a/pym/repoman/_subprocess.py
+++ b/repoman/pym/repoman/_subprocess.py
diff --git a/pym/repoman/actions.py b/repoman/pym/repoman/actions.py
index 4144b4570..4144b4570 100644
--- a/pym/repoman/actions.py
+++ b/repoman/pym/repoman/actions.py
diff --git a/pym/repoman/argparser.py b/repoman/pym/repoman/argparser.py
index 2d56a87e6..2d56a87e6 100644
--- a/pym/repoman/argparser.py
+++ b/repoman/pym/repoman/argparser.py
diff --git a/pym/repoman/check_missingslot.py b/repoman/pym/repoman/check_missingslot.py
index 4a3c57b2c..4a3c57b2c 100644
--- a/pym/repoman/check_missingslot.py
+++ b/repoman/pym/repoman/check_missingslot.py
diff --git a/pym/repoman/checks/__init__.py b/repoman/pym/repoman/checks/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/checks/__init__.py
+++ b/repoman/pym/repoman/checks/__init__.py
diff --git a/pym/repoman/checks/herds/__init__.py b/repoman/pym/repoman/checks/herds/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/checks/herds/__init__.py
+++ b/repoman/pym/repoman/checks/herds/__init__.py
diff --git a/pym/repoman/checks/herds/herdbase.py b/repoman/pym/repoman/checks/herds/herdbase.py
index d38d2e31d..d38d2e31d 100644
--- a/pym/repoman/checks/herds/herdbase.py
+++ b/repoman/pym/repoman/checks/herds/herdbase.py
diff --git a/pym/repoman/checks/herds/metadata.py b/repoman/pym/repoman/checks/herds/metadata.py
index b4a433ed7..b4a433ed7 100644
--- a/pym/repoman/checks/herds/metadata.py
+++ b/repoman/pym/repoman/checks/herds/metadata.py
diff --git a/pym/repoman/copyrights.py b/repoman/pym/repoman/copyrights.py
index 761309af6..761309af6 100644
--- a/pym/repoman/copyrights.py
+++ b/repoman/pym/repoman/copyrights.py
diff --git a/pym/repoman/errors.py b/repoman/pym/repoman/errors.py
index 9cf113ba0..9cf113ba0 100644
--- a/pym/repoman/errors.py
+++ b/repoman/pym/repoman/errors.py
diff --git a/pym/repoman/gpg.py b/repoman/pym/repoman/gpg.py
index 26e243201..26e243201 100644
--- a/pym/repoman/gpg.py
+++ b/repoman/pym/repoman/gpg.py
diff --git a/pym/repoman/main.py b/repoman/pym/repoman/main.py
index 2009a44fe..2009a44fe 100755
--- a/pym/repoman/main.py
+++ b/repoman/pym/repoman/main.py
diff --git a/pym/repoman/metadata.py b/repoman/pym/repoman/metadata.py
index a9ad3e8c0..a9ad3e8c0 100644
--- a/pym/repoman/metadata.py
+++ b/repoman/pym/repoman/metadata.py
diff --git a/pym/repoman/modules/__init__.py b/repoman/pym/repoman/modules/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/modules/__init__.py
+++ b/repoman/pym/repoman/modules/__init__.py
diff --git a/pym/repoman/modules/commit/__init__.py b/repoman/pym/repoman/modules/commit/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/modules/commit/__init__.py
+++ b/repoman/pym/repoman/modules/commit/__init__.py
diff --git a/pym/repoman/modules/commit/repochecks.py b/repoman/pym/repoman/modules/commit/repochecks.py
index bedbdaf34..bedbdaf34 100644
--- a/pym/repoman/modules/commit/repochecks.py
+++ b/repoman/pym/repoman/modules/commit/repochecks.py
diff --git a/pym/repoman/modules/scan/__init__.py b/repoman/pym/repoman/modules/scan/__init__.py
index e69de29bb..e69de29bb 100644
--- a/pym/repoman/modules/scan/__init__.py
+++ b/repoman/pym/repoman/modules/scan/__init__.py
diff --git a/pym/repoman/modules/scan/depend/__init__.py b/repoman/pym/repoman/modules/scan/depend/__init__.py
index 6d1228601..6d1228601 100644
--- a/pym/repoman/modules/scan/depend/__init__.py
+++ b/repoman/pym/repoman/modules/scan/depend/__init__.py
diff --git a/pym/repoman/modules/scan/depend/_depend_checks.py b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
index 4e1d216e1..4e1d216e1 100644
--- a/pym/repoman/modules/scan/depend/_depend_checks.py
+++ b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
diff --git a/pym/repoman/modules/scan/depend/_gen_arches.py b/repoman/pym/repoman/modules/scan/depend/_gen_arches.py
index 16b8dac5f..16b8dac5f 100644
--- a/pym/repoman/modules/scan/depend/_gen_arches.py
+++ b/repoman/pym/repoman/modules/scan/depend/_gen_arches.py
diff --git a/pym/repoman/modules/scan/depend/profile.py b/repoman/pym/repoman/modules/scan/depend/profile.py
index a714a9317..a714a9317 100644
--- a/pym/repoman/modules/scan/depend/profile.py
+++ b/repoman/pym/repoman/modules/scan/depend/profile.py
diff --git a/pym/repoman/modules/scan/directories/__init__.py b/repoman/pym/repoman/modules/scan/directories/__init__.py
index 47834cb40..47834cb40 100644
--- a/pym/repoman/modules/scan/directories/__init__.py
+++ b/repoman/pym/repoman/modules/scan/directories/__init__.py
diff --git a/pym/repoman/modules/scan/directories/files.py b/repoman/pym/repoman/modules/scan/directories/files.py
index 2aed26440..2aed26440 100644
--- a/pym/repoman/modules/scan/directories/files.py
+++ b/repoman/pym/repoman/modules/scan/directories/files.py
diff --git a/pym/repoman/modules/scan/directories/mtime.py b/repoman/pym/repoman/modules/scan/directories/mtime.py
index 134a86b80..134a86b80 100644
--- a/pym/repoman/modules/scan/directories/mtime.py
+++ b/repoman/pym/repoman/modules/scan/directories/mtime.py
diff --git a/pym/repoman/modules/scan/eapi/__init__.py b/repoman/pym/repoman/modules/scan/eapi/__init__.py
index 4c3dd6e8f..4c3dd6e8f 100644
--- a/pym/repoman/modules/scan/eapi/__init__.py
+++ b/repoman/pym/repoman/modules/scan/eapi/__init__.py
diff --git a/pym/repoman/modules/scan/eapi/eapi.py b/repoman/pym/repoman/modules/scan/eapi/eapi.py
index 1d4ad5a4a..1d4ad5a4a 100644
--- a/pym/repoman/modules/scan/eapi/eapi.py
+++ b/repoman/pym/repoman/modules/scan/eapi/eapi.py
diff --git a/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py
index 8666e78c2..8666e78c2 100644
--- a/pym/repoman/modules/scan/ebuild/__init__.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py
diff --git a/pym/repoman/modules/scan/ebuild/checks.py b/repoman/pym/repoman/modules/scan/ebuild/checks.py
index fb3e01944..fb3e01944 100644
--- a/pym/repoman/modules/scan/ebuild/checks.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py
diff --git a/pym/repoman/modules/scan/ebuild/ebuild.py b/repoman/pym/repoman/modules/scan/ebuild/ebuild.py
index 28cb8b407..28cb8b407 100644
--- a/pym/repoman/modules/scan/ebuild/ebuild.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/ebuild.py
diff --git a/pym/repoman/modules/scan/ebuild/errors.py b/repoman/pym/repoman/modules/scan/ebuild/errors.py
index 3090de0d1..3090de0d1 100644
--- a/pym/repoman/modules/scan/ebuild/errors.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/errors.py
diff --git a/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py
index 9e36e2a68..9e36e2a68 100644
--- a/pym/repoman/modules/scan/ebuild/multicheck.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py
diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
index 78d46e4b4..78d46e4b4 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
diff --git a/pym/repoman/modules/scan/eclasses/live.py b/repoman/pym/repoman/modules/scan/eclasses/live.py
index dca10b583..dca10b583 100644
--- a/pym/repoman/modules/scan/eclasses/live.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/live.py
diff --git a/pym/repoman/modules/scan/eclasses/ruby.py b/repoman/pym/repoman/modules/scan/eclasses/ruby.py
index b3501805e..b3501805e 100644
--- a/pym/repoman/modules/scan/eclasses/ruby.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/ruby.py
diff --git a/pym/repoman/modules/scan/fetch/__init__.py b/repoman/pym/repoman/modules/scan/fetch/__init__.py
index 3c8e6002c..3c8e6002c 100644
--- a/pym/repoman/modules/scan/fetch/__init__.py
+++ b/repoman/pym/repoman/modules/scan/fetch/__init__.py
diff --git a/pym/repoman/modules/scan/fetch/fetches.py b/repoman/pym/repoman/modules/scan/fetch/fetches.py
index 555f34f14..555f34f14 100644
--- a/pym/repoman/modules/scan/fetch/fetches.py
+++ b/repoman/pym/repoman/modules/scan/fetch/fetches.py
diff --git a/pym/repoman/modules/scan/keywords/__init__.py b/repoman/pym/repoman/modules/scan/keywords/__init__.py
index 2223927c8..2223927c8 100644
--- a/pym/repoman/modules/scan/keywords/__init__.py
+++ b/repoman/pym/repoman/modules/scan/keywords/__init__.py
diff --git a/pym/repoman/modules/scan/keywords/keywords.py b/repoman/pym/repoman/modules/scan/keywords/keywords.py
index 7cb2fe912..7cb2fe912 100644
--- a/pym/repoman/modules/scan/keywords/keywords.py
+++ b/repoman/pym/repoman/modules/scan/keywords/keywords.py
diff --git a/pym/repoman/modules/scan/manifest/__init__.py b/repoman/pym/repoman/modules/scan/manifest/__init__.py
index dca431b62..dca431b62 100644
--- a/pym/repoman/modules/scan/manifest/__init__.py
+++ b/repoman/pym/repoman/modules/scan/manifest/__init__.py
diff --git a/pym/repoman/modules/scan/manifest/manifests.py b/repoman/pym/repoman/modules/scan/manifest/manifests.py
index 2b8d7af77..2b8d7af77 100644
--- a/pym/repoman/modules/scan/manifest/manifests.py
+++ b/repoman/pym/repoman/modules/scan/manifest/manifests.py
diff --git a/pym/repoman/modules/scan/metadata/__init__.py b/repoman/pym/repoman/modules/scan/metadata/__init__.py
index b656d7af0..b656d7af0 100644
--- a/pym/repoman/modules/scan/metadata/__init__.py
+++ b/repoman/pym/repoman/modules/scan/metadata/__init__.py
diff --git a/pym/repoman/modules/scan/metadata/description.py b/repoman/pym/repoman/modules/scan/metadata/description.py
index 79f62e1de..79f62e1de 100644
--- a/pym/repoman/modules/scan/metadata/description.py
+++ b/repoman/pym/repoman/modules/scan/metadata/description.py
diff --git a/pym/repoman/modules/scan/metadata/ebuild_metadata.py b/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py
index e991a30b3..e991a30b3 100644
--- a/pym/repoman/modules/scan/metadata/ebuild_metadata.py
+++ b/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py
diff --git a/pym/repoman/modules/scan/metadata/pkgmetadata.py b/repoman/pym/repoman/modules/scan/metadata/pkgmetadata.py
index 433551aed..433551aed 100644
--- a/pym/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/repoman/pym/repoman/modules/scan/metadata/pkgmetadata.py
diff --git a/pym/repoman/modules/scan/metadata/restrict.py b/repoman/pym/repoman/modules/scan/metadata/restrict.py
index 0f9c5e52e..0f9c5e52e 100644
--- a/pym/repoman/modules/scan/metadata/restrict.py
+++ b/repoman/pym/repoman/modules/scan/metadata/restrict.py
diff --git a/pym/repoman/modules/scan/metadata/use_flags.py b/repoman/pym/repoman/modules/scan/metadata/use_flags.py
index 1738fd23e..1738fd23e 100644
--- a/pym/repoman/modules/scan/metadata/use_flags.py
+++ b/repoman/pym/repoman/modules/scan/metadata/use_flags.py
diff --git a/pym/repoman/modules/scan/options/__init__.py b/repoman/pym/repoman/modules/scan/options/__init__.py
index a5746ce67..a5746ce67 100644
--- a/pym/repoman/modules/scan/options/__init__.py
+++ b/repoman/pym/repoman/modules/scan/options/__init__.py
diff --git a/pym/repoman/modules/scan/options/options.py b/repoman/pym/repoman/modules/scan/options/options.py
index 443f01bd8..443f01bd8 100644
--- a/pym/repoman/modules/scan/options/options.py
+++ b/repoman/pym/repoman/modules/scan/options/options.py
diff --git a/pym/repoman/modules/scan/scan.py b/repoman/pym/repoman/modules/scan/scan.py
index d2a5f515b..d2a5f515b 100644
--- a/pym/repoman/modules/scan/scan.py
+++ b/repoman/pym/repoman/modules/scan/scan.py
diff --git a/pym/repoman/modules/scan/scanbase.py b/repoman/pym/repoman/modules/scan/scanbase.py
index aea1bb121..aea1bb121 100644
--- a/pym/repoman/modules/scan/scanbase.py
+++ b/repoman/pym/repoman/modules/scan/scanbase.py
diff --git a/pym/repoman/modules/vcs/None/__init__.py b/repoman/pym/repoman/modules/vcs/None/__init__.py
index 285932541..285932541 100644
--- a/pym/repoman/modules/vcs/None/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/None/__init__.py
diff --git a/pym/repoman/modules/vcs/None/changes.py b/repoman/pym/repoman/modules/vcs/None/changes.py
index 46c38e257..46c38e257 100644
--- a/pym/repoman/modules/vcs/None/changes.py
+++ b/repoman/pym/repoman/modules/vcs/None/changes.py
diff --git a/pym/repoman/modules/vcs/None/status.py b/repoman/pym/repoman/modules/vcs/None/status.py
index d6e5ca0e4..d6e5ca0e4 100644
--- a/pym/repoman/modules/vcs/None/status.py
+++ b/repoman/pym/repoman/modules/vcs/None/status.py
diff --git a/pym/repoman/modules/vcs/__init__.py b/repoman/pym/repoman/modules/vcs/__init__.py
index 84e837408..84e837408 100644
--- a/pym/repoman/modules/vcs/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/__init__.py
diff --git a/pym/repoman/modules/vcs/bzr/__init__.py b/repoman/pym/repoman/modules/vcs/bzr/__init__.py
index 4490ed86c..4490ed86c 100644
--- a/pym/repoman/modules/vcs/bzr/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/bzr/__init__.py
diff --git a/pym/repoman/modules/vcs/bzr/changes.py b/repoman/pym/repoman/modules/vcs/bzr/changes.py
index 4d4808c08..4d4808c08 100644
--- a/pym/repoman/modules/vcs/bzr/changes.py
+++ b/repoman/pym/repoman/modules/vcs/bzr/changes.py
diff --git a/pym/repoman/modules/vcs/bzr/status.py b/repoman/pym/repoman/modules/vcs/bzr/status.py
index 199e7f399..199e7f399 100644
--- a/pym/repoman/modules/vcs/bzr/status.py
+++ b/repoman/pym/repoman/modules/vcs/bzr/status.py
diff --git a/pym/repoman/modules/vcs/changes.py b/repoman/pym/repoman/modules/vcs/changes.py
index aa4923f8f..aa4923f8f 100644
--- a/pym/repoman/modules/vcs/changes.py
+++ b/repoman/pym/repoman/modules/vcs/changes.py
diff --git a/pym/repoman/modules/vcs/cvs/__init__.py b/repoman/pym/repoman/modules/vcs/cvs/__init__.py
index 0b4587bc6..0b4587bc6 100644
--- a/pym/repoman/modules/vcs/cvs/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/cvs/__init__.py
diff --git a/pym/repoman/modules/vcs/cvs/changes.py b/repoman/pym/repoman/modules/vcs/cvs/changes.py
index c3d880bdb..c3d880bdb 100644
--- a/pym/repoman/modules/vcs/cvs/changes.py
+++ b/repoman/pym/repoman/modules/vcs/cvs/changes.py
diff --git a/pym/repoman/modules/vcs/cvs/status.py b/repoman/pym/repoman/modules/vcs/cvs/status.py
index b936aa7d9..b936aa7d9 100644
--- a/pym/repoman/modules/vcs/cvs/status.py
+++ b/repoman/pym/repoman/modules/vcs/cvs/status.py
diff --git a/pym/repoman/modules/vcs/git/__init__.py b/repoman/pym/repoman/modules/vcs/git/__init__.py
index eecd4a1d0..eecd4a1d0 100644
--- a/pym/repoman/modules/vcs/git/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/git/__init__.py
diff --git a/pym/repoman/modules/vcs/git/changes.py b/repoman/pym/repoman/modules/vcs/git/changes.py
index 7e9ac1eb5..7e9ac1eb5 100644
--- a/pym/repoman/modules/vcs/git/changes.py
+++ b/repoman/pym/repoman/modules/vcs/git/changes.py
diff --git a/pym/repoman/modules/vcs/git/status.py b/repoman/pym/repoman/modules/vcs/git/status.py
index 48a73bed3..48a73bed3 100644
--- a/pym/repoman/modules/vcs/git/status.py
+++ b/repoman/pym/repoman/modules/vcs/git/status.py
diff --git a/pym/repoman/modules/vcs/hg/__init__.py b/repoman/pym/repoman/modules/vcs/hg/__init__.py
index 2e39970f7..2e39970f7 100644
--- a/pym/repoman/modules/vcs/hg/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/hg/__init__.py
diff --git a/pym/repoman/modules/vcs/hg/changes.py b/repoman/pym/repoman/modules/vcs/hg/changes.py
index 867057545..867057545 100644
--- a/pym/repoman/modules/vcs/hg/changes.py
+++ b/repoman/pym/repoman/modules/vcs/hg/changes.py
diff --git a/pym/repoman/modules/vcs/hg/status.py b/repoman/pym/repoman/modules/vcs/hg/status.py
index 8443554f5..8443554f5 100644
--- a/pym/repoman/modules/vcs/hg/status.py
+++ b/repoman/pym/repoman/modules/vcs/hg/status.py
diff --git a/pym/repoman/modules/vcs/settings.py b/repoman/pym/repoman/modules/vcs/settings.py
index a8e91dd27..a8e91dd27 100644
--- a/pym/repoman/modules/vcs/settings.py
+++ b/repoman/pym/repoman/modules/vcs/settings.py
diff --git a/pym/repoman/modules/vcs/svn/__init__.py b/repoman/pym/repoman/modules/vcs/svn/__init__.py
index 6bb0b9af4..6bb0b9af4 100644
--- a/pym/repoman/modules/vcs/svn/__init__.py
+++ b/repoman/pym/repoman/modules/vcs/svn/__init__.py
diff --git a/pym/repoman/modules/vcs/svn/changes.py b/repoman/pym/repoman/modules/vcs/svn/changes.py
index d83c7c45f..d83c7c45f 100644
--- a/pym/repoman/modules/vcs/svn/changes.py
+++ b/repoman/pym/repoman/modules/vcs/svn/changes.py
diff --git a/pym/repoman/modules/vcs/svn/status.py b/repoman/pym/repoman/modules/vcs/svn/status.py
index 6575fe0b0..6575fe0b0 100644
--- a/pym/repoman/modules/vcs/svn/status.py
+++ b/repoman/pym/repoman/modules/vcs/svn/status.py
diff --git a/pym/repoman/modules/vcs/vcs.py b/repoman/pym/repoman/modules/vcs/vcs.py
index e9d45d4c8..e9d45d4c8 100644
--- a/pym/repoman/modules/vcs/vcs.py
+++ b/repoman/pym/repoman/modules/vcs/vcs.py
diff --git a/pym/repoman/profile.py b/repoman/pym/repoman/profile.py
index 50da91728..50da91728 100644
--- a/pym/repoman/profile.py
+++ b/repoman/pym/repoman/profile.py
diff --git a/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py
index b9475e801..b9475e801 100644
--- a/pym/repoman/qa_data.py
+++ b/repoman/pym/repoman/qa_data.py
diff --git a/pym/repoman/qa_tracker.py b/repoman/pym/repoman/qa_tracker.py
index 9bfe0e241..9bfe0e241 100644
--- a/pym/repoman/qa_tracker.py
+++ b/repoman/pym/repoman/qa_tracker.py
diff --git a/pym/repoman/repos.py b/repoman/pym/repoman/repos.py
index 39f53c180..39f53c180 100644
--- a/pym/repoman/repos.py
+++ b/repoman/pym/repoman/repos.py
diff --git a/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py
index 48d9001a9..48d9001a9 100644
--- a/pym/repoman/scanner.py
+++ b/repoman/pym/repoman/scanner.py
diff --git a/pym/portage/tests/repoman/__init__.py b/repoman/pym/repoman/tests/__init__.py
index 532918b6a..532918b6a 100644
--- a/pym/portage/tests/repoman/__init__.py
+++ b/repoman/pym/repoman/tests/__init__.py
diff --git a/pym/portage/tests/repoman/__test__.py b/repoman/pym/repoman/tests/__test__.py
index e69de29bb..e69de29bb 100644
--- a/pym/portage/tests/repoman/__test__.py
+++ b/repoman/pym/repoman/tests/__test__.py
diff --git a/repoman/pym/repoman/tests/changelog/__init__.py b/repoman/pym/repoman/tests/changelog/__init__.py
new file mode 100644
index 000000000..532918b6a
--- /dev/null
+++ b/repoman/pym/repoman/tests/changelog/__init__.py
@@ -0,0 +1,2 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
diff --git a/pym/portage/tests/repoman/test_echangelog.py b/repoman/pym/repoman/tests/changelog/test_echangelog.py
index 1640be268..1640be268 100644
--- a/pym/portage/tests/repoman/test_echangelog.py
+++ b/repoman/pym/repoman/tests/changelog/test_echangelog.py
diff --git a/repoman/pym/repoman/tests/runTests.py b/repoman/pym/repoman/tests/runTests.py
new file mode 100644
index 000000000..9c452764f
--- /dev/null
+++ b/repoman/pym/repoman/tests/runTests.py
@@ -0,0 +1,61 @@
+#!/usr/bin/python -bWd
+# runTests.py -- Portage Unit Test Functionality
+# Copyright 2006-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import os, sys
+import os.path as osp
+import grp
+import platform
+import pwd
+import signal
+
+def debug_signal(signum, frame):
+ import pdb
+ pdb.set_trace()
+
+if platform.python_implementation() == 'Jython':
+ debug_signum = signal.SIGUSR2 # bug #424259
+else:
+ debug_signum = signal.SIGUSR1
+
+signal.signal(debug_signum, debug_signal)
+
+# Pretend that the current user's uid/gid are the 'portage' uid/gid,
+# so things go smoothly regardless of the current user and global
+# user/group configuration.
+os.environ["PORTAGE_USERNAME"] = pwd.getpwuid(os.getuid()).pw_name
+os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name
+
+# Insert our parent dir so we can do shiny import "tests"
+# This line courtesy of Marienz and Pkgcore ;)
+sys.path.insert(0, osp.dirname(osp.dirname(osp.dirname(osp.realpath(__file__)))))
+
+import portage
+portage._internal_caller = True
+
+# Ensure that we don't instantiate portage.settings, so that tests should
+# work the same regardless of global configuration file state/existence.
+portage._disable_legacy_globals()
+
+if os.environ.get('NOCOLOR') in ('yes', 'true'):
+ portage.output.nocolor()
+
+import portage.tests as tests
+from portage.const import PORTAGE_BIN_PATH
+path = os.environ.get("PATH", "").split(":")
+path = [x for x in path if x]
+
+insert_bin_path = True
+try:
+ insert_bin_path = not path or \
+ not os.path.samefile(path[0], PORTAGE_BIN_PATH)
+except OSError:
+ pass
+
+if insert_bin_path:
+ path.insert(0, PORTAGE_BIN_PATH)
+ os.environ["PATH"] = ":".join(path)
+
+if __name__ == "__main__":
+ sys.exit(tests.main())
diff --git a/repoman/pym/repoman/tests/simple/__init__.py b/repoman/pym/repoman/tests/simple/__init__.py
new file mode 100644
index 000000000..532918b6a
--- /dev/null
+++ b/repoman/pym/repoman/tests/simple/__init__.py
@@ -0,0 +1,2 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
diff --git a/pym/portage/tests/repoman/test_simple.py b/repoman/pym/repoman/tests/simple/test_simple.py
index 6a7976142..6a7976142 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/repoman/pym/repoman/tests/simple/test_simple.py
diff --git a/pym/repoman/utilities.py b/repoman/pym/repoman/utilities.py
index 8a757dc85..8a757dc85 100644
--- a/pym/repoman/utilities.py
+++ b/repoman/pym/repoman/utilities.py
diff --git a/repoman/setup.py b/repoman/setup.py
new file mode 100755
index 000000000..b7b8ee268
--- /dev/null
+++ b/repoman/setup.py
@@ -0,0 +1,662 @@
+#!/usr/bin/env python
+# Copyright 1998-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from __future__ import print_function
+
+from distutils.core import setup, Command
+from distutils.command.build import build
+from distutils.command.build_scripts import build_scripts
+from distutils.command.clean import clean
+from distutils.command.install import install
+from distutils.command.install_data import install_data
+from distutils.command.install_lib import install_lib
+from distutils.command.install_scripts import install_scripts
+from distutils.command.sdist import sdist
+from distutils.dep_util import newer
+from distutils.dir_util import mkpath, remove_tree
+from distutils.util import change_root, subst_vars
+
+import codecs
+import collections
+import glob
+import os
+import os.path
+import re
+import subprocess
+import sys
+
+
+# TODO:
+# - smarter rebuilds of docs w/ 'install_docbook' and 'install_epydoc'.
+
+x_scripts = {
+ 'bin': [
+ 'bin/repoman',
+ ],
+ 'sbin': [
+ ],
+}
+
+
+class x_build(build):
+ """ Build command with extra build_man call. """
+
+ def run(self):
+ build.run(self)
+ self.run_command('build_man')
+
+
+class build_man(Command):
+ """ Perform substitutions in manpages. """
+
+ user_options = [
+ ]
+
+ def initialize_options(self):
+ self.build_base = None
+
+ def finalize_options(self):
+ self.set_undefined_options('build',
+ ('build_base', 'build_base'))
+
+ def run(self):
+ for d, files in self.distribution.data_files:
+ if not d.startswith('$mandir/'):
+ continue
+
+ for source in files:
+ target = os.path.join(self.build_base, source)
+ mkpath(os.path.dirname(target))
+
+ if not newer(source, target) and not newer(__file__, target):
+ continue
+
+ print('copying and updating %s -> %s' % (
+ source, target))
+
+ with codecs.open(source, 'r', 'utf8') as f:
+ data = f.readlines()
+ data[0] = data[0].replace('VERSION',
+ self.distribution.get_version())
+ with codecs.open(target, 'w', 'utf8') as f:
+ f.writelines(data)
+
+
+class docbook(Command):
+ """ Build docs using docbook. """
+
+ user_options = [
+ ('doc-formats=', None, 'Documentation formats to build (all xmlto formats for docbook are allowed, comma-separated'),
+ ]
+
+ def initialize_options(self):
+ self.doc_formats = 'xhtml,xhtml-nochunks'
+
+ def finalize_options(self):
+ self.doc_formats = self.doc_formats.replace(',', ' ').split()
+
+ def run(self):
+ if not os.path.isdir('doc/fragment'):
+ mkpath('doc/fragment')
+
+ with open('doc/fragment/date', 'w'):
+ pass
+ with open('doc/fragment/version', 'w') as f:
+ f.write('<releaseinfo>%s</releaseinfo>' % self.distribution.get_version())
+
+ for f in self.doc_formats:
+ print('Building docs in %s format...' % f)
+ subprocess.check_call(['xmlto', '-o', 'doc',
+ '-m', 'doc/custom.xsl', f, 'doc/portage.docbook'])
+
+
+class epydoc(Command):
+ """ Build API docs using epydoc. """
+
+ user_options = [
+ ]
+
+ def initialize_options(self):
+ self.build_lib = None
+
+ def finalize_options(self):
+ self.set_undefined_options('build_py', ('build_lib', 'build_lib'))
+
+ def run(self):
+ self.run_command('build_py')
+
+ print('Building API documentation...')
+
+ process_env = os.environ.copy()
+ pythonpath = self.build_lib
+ try:
+ pythonpath += ':' + process_env['PYTHONPATH']
+ except KeyError:
+ pass
+ process_env['PYTHONPATH'] = pythonpath
+
+ subprocess.check_call(['epydoc', '-o', 'epydoc',
+ '--name', self.distribution.get_name(),
+ '--url', self.distribution.get_url(),
+ '-qq', '--no-frames', '--show-imports',
+ '--exclude', 'portage.tests',
+ '_emerge', 'portage'],
+ env = process_env)
+ os.remove('epydoc/api-objects.txt')
+
+
+class install_docbook(install_data):
+ """ install_data for docbook docs """
+
+ user_options = install_data.user_options
+
+ def initialize_options(self):
+ install_data.initialize_options(self)
+ self.htmldir = None
+
+ def finalize_options(self):
+ self.set_undefined_options('install', ('htmldir', 'htmldir'))
+ install_data.finalize_options(self)
+
+ def run(self):
+ if not os.path.exists('doc/portage.html'):
+ self.run_command('docbook')
+ self.data_files = [
+ (self.htmldir, glob.glob('doc/*.html')),
+ ]
+ install_data.run(self)
+
+
+class install_epydoc(install_data):
+ """ install_data for epydoc docs """
+
+ user_options = install_data.user_options
+
+ def initialize_options(self):
+ install_data.initialize_options(self)
+ self.htmldir = None
+
+ def finalize_options(self):
+ self.set_undefined_options('install', ('htmldir', 'htmldir'))
+ install_data.finalize_options(self)
+
+ def run(self):
+ if not os.path.exists('epydoc/index.html'):
+ self.run_command('epydoc')
+ self.data_files = [
+ (os.path.join(self.htmldir, 'api'), glob.glob('epydoc/*')),
+ ]
+ install_data.run(self)
+
+
+class x_build_scripts_custom(build_scripts):
+ def finalize_options(self):
+ build_scripts.finalize_options(self)
+ if 'dir_name' in dir(self):
+ self.build_dir = os.path.join(self.build_dir, self.dir_name)
+ if self.dir_name in x_scripts:
+ self.scripts = x_scripts[self.dir_name]
+ else:
+ self.scripts = set(self.scripts)
+ for other_files in x_scripts.values():
+ self.scripts.difference_update(other_files)
+
+ def run(self):
+ # group scripts by subdirectory
+ split_scripts = collections.defaultdict(list)
+ for f in self.scripts:
+ dir_name = os.path.dirname(f[len('bin/'):])
+ split_scripts[dir_name].append(f)
+
+ base_dir = self.build_dir
+ base_scripts = self.scripts
+ for d, files in split_scripts.items():
+ self.build_dir = os.path.join(base_dir, d)
+ self.scripts = files
+ self.copy_scripts()
+
+ # restore previous values
+ self.build_dir = base_dir
+ self.scripts = base_scripts
+
+
+class x_build_scripts_bin(x_build_scripts_custom):
+ dir_name = 'bin'
+
+
+class x_build_scripts_sbin(x_build_scripts_custom):
+ dir_name = 'sbin'
+
+
+class x_build_scripts_portagebin(x_build_scripts_custom):
+ dir_name = 'portage'
+
+
+class x_build_scripts(build_scripts):
+ def initialize_option(self):
+ build_scripts.initialize_options(self)
+
+ def finalize_options(self):
+ build_scripts.finalize_options(self)
+
+ def run(self):
+ self.run_command('build_scripts_bin')
+ self.run_command('build_scripts_portagebin')
+ self.run_command('build_scripts_sbin')
+
+
+class x_clean(clean):
+ """ clean extended for doc & post-test cleaning """
+
+ @staticmethod
+ def clean_docs():
+ def get_doc_outfiles():
+ for dirpath, _dirnames, filenames in os.walk('doc'):
+ for f in filenames:
+ if f.endswith('.docbook') or f == 'custom.xsl':
+ pass
+ else:
+ yield os.path.join(dirpath, f)
+
+ # do not recurse
+ break
+
+
+ for f in get_doc_outfiles():
+ print('removing %s' % repr(f))
+ os.remove(f)
+
+ if os.path.isdir('doc/fragment'):
+ remove_tree('doc/fragment')
+
+ if os.path.isdir('epydoc'):
+ remove_tree('epydoc')
+
+ def clean_tests(self):
+ # do not remove incorrect dirs accidentally
+ top_dir = os.path.normpath(os.path.join(self.build_lib, '..'))
+ cprefix = os.path.commonprefix((self.build_base, top_dir))
+ if cprefix != self.build_base:
+ return
+
+ bin_dir = os.path.join(top_dir, 'bin')
+ if os.path.exists(bin_dir):
+ remove_tree(bin_dir)
+
+ conf_dir = os.path.join(top_dir, 'cnf')
+ if os.path.islink(conf_dir):
+ print('removing %s symlink' % repr(conf_dir))
+ os.unlink(conf_dir)
+
+ pni_file = os.path.join(top_dir, '.portage_not_installed')
+ if os.path.exists(pni_file):
+ print('removing %s' % repr(pni_file))
+ os.unlink(pni_file)
+
+ def clean_man(self):
+ man_dir = os.path.join(self.build_base, 'man')
+ if os.path.exists(man_dir):
+ remove_tree(man_dir)
+
+ def run(self):
+ if self.all:
+ self.clean_tests()
+ self.clean_docs()
+ self.clean_man()
+
+ clean.run(self)
+
+
+class x_install(install):
+ """ install command with extra Portage paths """
+
+ user_options = install.user_options + [
+ # note: $prefix and $exec_prefix are reserved for Python install
+ ('system-prefix=', None, "Prefix for architecture-independent data"),
+ ('system-exec-prefix=', None, "Prefix for architecture-specific data"),
+
+ ('bindir=', None, "Install directory for main executables"),
+ ('datarootdir=', None, "Data install root directory"),
+ ('docdir=', None, "Documentation install directory"),
+ ('htmldir=', None, "HTML documentation install directory"),
+ ('mandir=', None, "Manpage root install directory"),
+ ('portage-base=', 'b', "Portage install base"),
+ ('portage-bindir=', None, "Install directory for Portage internal-use executables"),
+ ('portage-datadir=', None, 'Install directory for data files'),
+ ('sbindir=', None, "Install directory for superuser-intended executables"),
+ ('sysconfdir=', None, 'System configuration path'),
+ ]
+
+ # note: the order is important for proper substitution
+ paths = [
+ ('system_prefix', '/usr'),
+ ('system_exec_prefix', '$system_prefix'),
+
+ ('bindir', '$system_exec_prefix/bin'),
+ ('sbindir', '$system_exec_prefix/sbin'),
+ ('sysconfdir', '/etc'),
+
+ ('datarootdir', '$system_prefix/share'),
+ ('docdir', '$datarootdir/doc/$package-$version'),
+ ('htmldir', '$docdir/html'),
+ ('mandir', '$datarootdir/man'),
+
+ ('portage_base', '$system_exec_prefix/lib/portage'),
+ ('portage_bindir', '$portage_base/bin'),
+ ('portage_datadir', '$datarootdir/portage'),
+
+ # not customized at the moment
+ ('logrotatedir', '$sysconfdir/logrotate.d'),
+ ('portage_confdir', '$portage_datadir/config'),
+ ('portage_setsdir', '$portage_confdir/sets'),
+ ]
+
+ def initialize_options(self):
+ install.initialize_options(self)
+
+ for key, default in self.paths:
+ setattr(self, key, default)
+ self.subst_paths = {}
+
+ def finalize_options(self):
+ install.finalize_options(self)
+
+ # substitute variables
+ new_paths = {
+ 'package': self.distribution.get_name(),
+ 'version': self.distribution.get_version(),
+ }
+ for key, _default in self.paths:
+ new_paths[key] = subst_vars(getattr(self, key), new_paths)
+ setattr(self, key, new_paths[key])
+ self.subst_paths = new_paths
+
+
+class x_install_data(install_data):
+ """ install_data with customized path support """
+
+ user_options = install_data.user_options
+
+ def initialize_options(self):
+ install_data.initialize_options(self)
+ self.build_base = None
+ self.paths = None
+
+ def finalize_options(self):
+ install_data.finalize_options(self)
+ self.set_undefined_options('build',
+ ('build_base', 'build_base'))
+ self.set_undefined_options('install',
+ ('subst_paths', 'paths'))
+
+ def run(self):
+ self.run_command('build_man')
+
+ def process_data_files(df):
+ for d, files in df:
+ # substitute man sources
+ if d.startswith('$mandir/'):
+ files = [os.path.join(self.build_base, v) for v in files]
+
+ # substitute variables in path
+ d = subst_vars(d, self.paths)
+ yield (d, files)
+
+ old_data_files = self.data_files
+ self.data_files = process_data_files(self.data_files)
+
+ install_data.run(self)
+ self.data_files = old_data_files
+
+
+class x_install_lib(install_lib):
+ """ install_lib command with Portage path substitution """
+
+ user_options = install_lib.user_options
+
+ def initialize_options(self):
+ install_lib.initialize_options(self)
+ self.portage_base = None
+ self.portage_bindir = None
+ self.portage_confdir = None
+
+ def finalize_options(self):
+ install_lib.finalize_options(self)
+ self.set_undefined_options('install',
+ ('portage_base', 'portage_base'),
+ ('portage_bindir', 'portage_bindir'),
+ ('portage_confdir', 'portage_confdir'))
+
+ def install(self):
+ ret = install_lib.install(self)
+
+ def rewrite_file(path, val_dict):
+ path = os.path.join(self.install_dir, path)
+ print('Rewriting %s' % path)
+ with codecs.open(path, 'r', 'utf-8') as f:
+ data = f.read()
+
+ for varname, val in val_dict.items():
+ regexp = r'(?m)^(%s\s*=).*$' % varname
+ repl = r'\1 %s' % repr(val)
+
+ data = re.sub(regexp, repl, data)
+
+ with codecs.open(path, 'w', 'utf-8') as f:
+ f.write(data)
+
+ rewrite_file('portage/__init__.py', {
+ 'VERSION': self.distribution.get_version(),
+ })
+ rewrite_file('portage/const.py', {
+ 'PORTAGE_BASE_PATH': self.portage_base,
+ 'PORTAGE_BIN_PATH': self.portage_bindir,
+ 'PORTAGE_CONFIG_PATH': self.portage_confdir,
+ })
+
+ return ret
+
+
+class x_install_scripts_custom(install_scripts):
+ def initialize_options(self):
+ install_scripts.initialize_options(self)
+ self.root = None
+
+ def finalize_options(self):
+ self.set_undefined_options('install',
+ ('root', 'root'),
+ (self.var_name, 'install_dir'))
+ install_scripts.finalize_options(self)
+ self.build_dir = os.path.join(self.build_dir, self.dir_name)
+
+ # prepend root
+ if self.root is not None:
+ self.install_dir = change_root(self.root, self.install_dir)
+
+
+class x_install_scripts_bin(x_install_scripts_custom):
+ dir_name = 'bin'
+ var_name = 'bindir'
+
+
+class x_install_scripts_sbin(x_install_scripts_custom):
+ dir_name = 'sbin'
+ var_name = 'sbindir'
+
+
+class x_install_scripts_portagebin(x_install_scripts_custom):
+ dir_name = 'portage'
+ var_name = 'portage_bindir'
+
+
+class x_install_scripts(install_scripts):
+ def initialize_option(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ self.run_command('install_scripts_bin')
+ self.run_command('install_scripts_portagebin')
+ self.run_command('install_scripts_sbin')
+
+
+class x_sdist(sdist):
+ """ sdist defaulting to .tar.bz2 format """
+
+ def finalize_options(self):
+ if self.formats is None:
+ self.formats = ['bztar']
+
+ sdist.finalize_options(self)
+
+
+class build_tests(x_build_scripts_custom):
+ """ Prepare build dir for running tests. """
+
+ def initialize_options(self):
+ x_build_scripts_custom.initialize_options(self)
+ self.build_base = None
+ self.build_lib = None
+
+ def finalize_options(self):
+ x_build_scripts_custom.finalize_options(self)
+ self.set_undefined_options('build',
+ ('build_base', 'build_base'),
+ ('build_lib', 'build_lib'))
+
+ # since we will be writing to $build_lib/.., it is important
+ # that we do not leave $build_base
+ self.top_dir = os.path.normpath(os.path.join(self.build_lib, '..'))
+ cprefix = os.path.commonprefix((self.build_base, self.top_dir))
+ if cprefix != self.build_base:
+ raise SystemError('build_lib must be a subdirectory of build_base')
+
+ self.build_dir = os.path.join(self.top_dir, 'bin')
+
+ def run(self):
+ self.run_command('build_py')
+
+ # install all scripts $build_lib/../bin
+ # (we can't do a symlink since we want shebangs corrected)
+ x_build_scripts_custom.run(self)
+
+ # symlink 'cnf' directory
+ conf_dir = os.path.join(self.top_dir, 'cnf')
+ if os.path.exists(conf_dir):
+ if not os.path.islink(conf_dir):
+ raise SystemError('%s exists and is not a symlink (collision)'
+ % repr(conf_dir))
+ os.unlink(conf_dir)
+ conf_src = os.path.relpath('cnf', self.top_dir)
+ print('Symlinking %s -> %s' % (conf_dir, conf_src))
+ os.symlink(conf_src, conf_dir)
+
+ # create $build_lib/../.portage_not_installed
+ # to enable proper paths in tests
+ with open(os.path.join(self.top_dir, '.portage_not_installed'), 'w'):
+ pass
+
+
+class test(Command):
+ """ run tests """
+
+ user_options = []
+
+ def initialize_options(self):
+ self.build_lib = None
+
+ def finalize_options(self):
+ self.set_undefined_options('build',
+ ('build_lib', 'build_lib'))
+
+ def run(self):
+ self.run_command('build_tests')
+ subprocess.check_call([
+ sys.executable, '-bWd',
+ os.path.join(self.build_lib, 'portage/tests/runTests.py')
+ ])
+
+
+def find_packages():
+ for dirpath, _dirnames, filenames in os.walk('pym'):
+ if '__init__.py' in filenames:
+ yield os.path.relpath(dirpath, 'pym')
+
+
+def find_scripts():
+ for dirpath, _dirnames, filenames in os.walk('bin'):
+ for f in filenames:
+ if f not in ['deprecated-path']:
+ yield os.path.join(dirpath, f)
+
+
+def get_manpages():
+ linguas = os.environ.get('LINGUAS')
+ if linguas is not None:
+ linguas = linguas.split()
+
+ for dirpath, _dirnames, filenames in os.walk('man'):
+ groups = collections.defaultdict(list)
+ for f in filenames:
+ _fn, suffix = f.rsplit('.', 1)
+ groups[suffix].append(os.path.join(dirpath, f))
+
+ topdir = dirpath[len('man/'):]
+ if not topdir or linguas is None or topdir in linguas:
+ for g, mans in groups.items():
+ yield [os.path.join('$mandir', topdir, 'man%s' % g), mans]
+
+
+setup(
+ name = 'repoman',
+ version = '2.3.0',
+ url = 'https://wiki.gentoo.org/wiki/Project:Portage',
+ author = 'Gentoo Portage Development Team',
+ author_email = 'dev-portage@gentoo.org',
+
+ package_dir = {'': 'pym'},
+ packages = list(find_packages()),
+ # something to cheat build & install commands
+ scripts = list(find_scripts()),
+
+ data_files = list(get_manpages()) + [
+ ['$docdir', ['NEWS', 'RELEASE-NOTES']],
+ ],
+
+ cmdclass = {
+ 'build': x_build,
+ 'build_man': build_man,
+ 'build_scripts': x_build_scripts,
+ 'build_scripts_bin': x_build_scripts_bin,
+ 'build_scripts_portagebin': x_build_scripts_portagebin,
+ 'build_scripts_sbin': x_build_scripts_sbin,
+ 'build_tests': build_tests,
+ 'clean': x_clean,
+ 'docbook': docbook,
+ 'epydoc': epydoc,
+ 'install': x_install,
+ 'install_data': x_install_data,
+ 'install_docbook': install_docbook,
+ 'install_epydoc': install_epydoc,
+ 'install_lib': x_install_lib,
+ 'install_scripts': x_install_scripts,
+ 'install_scripts_bin': x_install_scripts_bin,
+ 'install_scripts_portagebin': x_install_scripts_portagebin,
+ 'install_scripts_sbin': x_install_scripts_sbin,
+ 'sdist': x_sdist,
+ 'test': test,
+ },
+
+ classifiers = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
+ 'Operating System :: POSIX',
+ 'Programming Language :: Python',
+ 'Topic :: System :: Installation/Setup'
+ ]
+)
diff --git a/setup.py b/setup.py
index b066fae09..c487ddf07 100755
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ import sys
x_scripts = {
'bin': [
'bin/ebuild', 'bin/egencache', 'bin/emerge', 'bin/emerge-webrsync',
- 'bin/emirrordist', 'bin/portageq', 'bin/quickpkg', 'bin/repoman'
+ 'bin/emirrordist', 'bin/portageq', 'bin/quickpkg',
],
'sbin': [
'bin/archive-conf', 'bin/dispatch-conf', 'bin/emaint', 'bin/env-update',
@@ -144,7 +144,7 @@ class epydoc(Command):
'--url', self.distribution.get_url(),
'-qq', '--no-frames', '--show-imports',
'--exclude', 'portage.tests',
- '_emerge', 'portage', 'repoman'],
+ '_emerge', 'portage'],
env = process_env)
os.remove('epydoc/api-objects.txt')