summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-03-21 20:56:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-03-21 20:56:35 (GMT)
commit55f1bb8bfa362569b6698a91a1cf421bdfcd13d7 (patch)
treebeea9fb70aee8ff05b1f6fa78bd04e5d2a668bdf /Lib/distutils
parente6c430dffe5618016c516578726c0a7aa1471a9e (diff)
downloadcpython-55f1bb8bfa362569b6698a91a1cf421bdfcd13d7.zip
cpython-55f1bb8bfa362569b6698a91a1cf421bdfcd13d7.tar.gz
cpython-55f1bb8bfa362569b6698a91a1cf421bdfcd13d7.tar.bz2
Add the upload command. Make all dist commands register their
outputs with the distribution object.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/command/bdist_dumb.py5
-rw-r--r--Lib/distutils/command/bdist_rpm.py3
-rw-r--r--Lib/distutils/command/bdist_wininst.py2
-rw-r--r--Lib/distutils/command/sdist.py1
-rw-r--r--Lib/distutils/command/upload.py4
-rw-r--r--Lib/distutils/dist.py5
6 files changed, 18 insertions, 2 deletions
diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py
index 7f498c8..5943551 100644
--- a/Lib/distutils/command/bdist_dumb.py
+++ b/Lib/distutils/command/bdist_dumb.py
@@ -117,8 +117,9 @@ class bdist_dumb (Command):
ensure_relative(install.install_base))
# Make the archive
- self.make_archive(pseudoinstall_root,
- self.format, root_dir=archive_root)
+ filename = self.make_archive(pseudoinstall_root,
+ self.format, root_dir=archive_root)
+ self.distribution.dist_files.append(('bdist_dumb', filename))
if not self.keep_temp:
remove_tree(self.bdist_dir, dry_run=self.dry_run)
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
index 8eaaff3..09bfa43 100644
--- a/Lib/distutils/command/bdist_rpm.py
+++ b/Lib/distutils/command/bdist_rpm.py
@@ -297,12 +297,14 @@ class bdist_rpm (Command):
# Make a source distribution and copy to SOURCES directory with
# optional icon.
+ saved_dist_files = self.distributuion.dist_files[:]
sdist = self.reinitialize_command('sdist')
if self.use_bzip2:
sdist.formats = ['bztar']
else:
sdist.formats = ['gztar']
self.run_command('sdist')
+ self.distribution.dist_files = saved_dist_files
source = sdist.get_archive_files()[0]
source_dir = rpm_dir['SOURCES']
@@ -355,6 +357,7 @@ class bdist_rpm (Command):
assert len(rpms) == 1, \
"unexpected number of RPM files found: %s" % rpms
self.move_file(rpms[0], self.dist_dir)
+ self.distribution.dist_files.append(('bdist_rpm', rpms[0]))
if debuginfo:
self.move_file(debuginfo[0], self.dist_dir)
# run()
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index 9b45cf3..a0335fe 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -162,6 +162,8 @@ class bdist_wininst (Command):
root_dir=self.bdist_dir)
# create an exe containing the zip-file
self.create_exe(arcname, fullname, self.bitmap)
+ self.distribution.dist_files.append(('bdist_wininst',
+ self.get_installer_filename()))
# remove the zip-file again
log.debug("removing temporary file '%s'", arcname)
os.remove(arcname)
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index fe6c913..8b88f22 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -449,6 +449,7 @@ class sdist (Command):
for fmt in self.formats:
file = self.make_archive(base_name, fmt, base_dir=base_dir)
archive_files.append(file)
+ self.distribution.dist_files.append(('sdist',file))
self.archive_files = archive_files
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
new file mode 100644
index 0000000..d14f177
--- /dev/null
+++ b/Lib/distutils/command/upload.py
@@ -0,0 +1,4 @@
+"""distutils.command.upload
+
+Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
+
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index f015874..c7ec383 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -177,6 +177,11 @@ Common commands: (see '--help-commands' for more)
# command_options = { command_name : { option : (source, value) } }
self.command_options = {}
+ # 'dist_files' is the list of (command, file) that have been created
+ # by any dist commands run so far. This is filled regardless
+ # of whether the run is dry or not.
+ self.dist_files = []
+
# These options are really the business of various commands, rather
# than of the Distribution itself. We provide aliases for them in
# Distribution as a convenience to the developer.