Commit Graph

2651 Commits

Author SHA1 Message Date
Barry Warsaw 9357854187 For backwards compatibility, simply import everything from the
_exceptions module, including __doc__.
2000-05-25 23:15:52 +00:00
Greg Ward fe55e86a0a Take the basename of the script before concatenating it with the build dir. 2000-05-25 20:05:52 +00:00
Fred Drake fd267d998d Piers Lauder <piers@cs.su.oz.au>:
This patch adds a comment about quoting to the doc string,
and also checks that the 'flags' argument to the STORE command
is appropriately enclosed inside parentheses to avoid quoting.
2000-05-25 03:25:26 +00:00
Greg Ward 101de37907 Fix to use 'change_root()' rather than directly mangling path. 2000-05-25 02:14:26 +00:00
Greg Ward 80fa55e71f Improvements to Bastian's build_scripts command:
* 'first_line_re' loosened up
  * command description improved
  * replaced '_copy_files()' and '_adjust_files()' with one method
    that does everything, 'copy_scripts()' -- this should be more
    efficient than Bastian's version, should behave better in
    dry-run mode, and does timestamp dependency-checking
2000-05-25 02:03:56 +00:00
Greg Ward 029e302786 Added comment to remind us of the (temporary?) obsolescense of the
'install_misc' class.
2000-05-25 01:26:23 +00:00
Greg Ward e3d17526b2 Use Distribution's 'has_scripts()' method instead of directly accessing
its 'scripts' attribute.
2000-05-25 01:21:54 +00:00
Greg Ward a4efe65b43 Bastian Kleineidam: the "build_scripts" command. 2000-05-25 01:20:15 +00:00
Greg Ward 8d5881a2ba Bastian Kleineidam: the "build_scripts" command and changes
necessary to support it.

Details:
  - build command additionally calls build_scripts
  - build_scripts builds your scripts in 'build/scripts' and adjusts the
    first line if it begins with "#!" and ends with "python", optionally
    ending with commandline options (like -O, -t ...).  Adjusting means we
    write the current path to the Python interpreter in the first line.
  - install_scripts copies the scripts to the install_scripts dir
  - install_data copies your data_files in install_data. You can
    supply individual directories for your data_files:

    data_files = ['doc/info.txt', # copy this file in install_scripts dir
      ('testdata', ['a.dat', 'b.dat']), # copy these files in
                                        # install_scripts/testdata
      ('/etc', ['packagerc']),    # copy this in /etc. When --root is
                                  # given, copy this in rootdir/etc
    ]

    So you can use the --root option with absolute data paths.
2000-05-25 01:19:18 +00:00
Greg Ward fcd974efbb Normalized all the end-of-class lines. 2000-05-25 01:10:04 +00:00
Guido van Rossum c580dae6da Fix a problem reported by Oleg Broytmann, who complains that very
often, ftp URLs hang in the final close.  Further analysis suggests
that this is because the close hook in addclosehook() calls the hook
before acually closing the connection.  The hook, in this case, waits
for the '226 Transfer complete' status from the server on the command
socket.  However, more and more ftp servers only send this status when
the data socket has actually been closed -- causing a deadlock.

The fix is simple: in addclosehook.close(), call addbase.close()
*before* calling the closehook.
2000-05-24 13:21:46 +00:00
Greg Ward a570c05997 Catch failure to open installed Makefile, and report it as a
DistutilsPlatformError: "invalid Python installation".  (This will
happen on Red Hat-ish systems where the python-devel package is not
installed.)
2000-05-23 23:14:00 +00:00
Greg Ward 40313cfe6e Fix 'get_command_obj()' so it checks if a command object has an attribute
before setting it -- this will catch bad options (eg. typos) in config files.
2000-05-23 04:11:14 +00:00
Greg Ward 77751c0b49 Added some debuging output (actually moved here from dist.py) --
dump the Distribution's 'command_options' dict after parsing config files,
and then after parsing the command line.
2000-05-23 03:54:16 +00:00
Greg Ward 981f7368f6 Don't take advantage of OptionDummy's new "auto-initialization" feature
after all -- turns out it doesn't buy us much after all...
2000-05-23 03:53:10 +00:00
Greg Ward 474607777d Fixed so options from config files and command lines actually work:
* 'get_command_obj()' now sets command attributes based on
    the 'command_options' dictionary
  * some typos fixed
  * kludged 'parse_config_files()' to re-initialize the ConfigParser
    instance after each file, so we know for sure which config
    file each option comes form
  * added lots of handy debugging output
2000-05-23 03:47:35 +00:00
Greg Ward d7ad5039cb Fixed command description. 2000-05-23 01:55:16 +00:00
Greg Ward 5edcd90f8c Use 'get_command_obj()' instead of 'find_command_obj()'. 2000-05-23 01:55:01 +00:00
Greg Ward 3c67b1dd08 OptionDummy now has a constructor that takes a list of options: each string
in the option list is an attribute of the OptionDummy that will be
initialized to None.
2000-05-23 01:44:20 +00:00
Greg Ward 732745bb70 Tweaked usage message. 2000-05-23 01:43:08 +00:00
Greg Ward d5d8a9982b Marching towards full support of config files: thoroughly overhauled the
command-line parsing code, splitting it up into several methods (new
methods: '_parse_command_opts()', '_show_help()') and making it put options
into the 'command_options' dictionary rather than instantiating command
objects and putting them there.

Lots of other little changes:
  * merged 'find_command_class()' and 'create_command_obj()' and
    called the result 'get_command_class()'
  * renamed 'find_command_obj()' to 'get_command_obj()', and added
    command object creation and maintenance of the command object cache to
    its responsibilities (taken over from 'create_command_obj()')
  * parse config files one-at-a-time, so we can keep track of the
    filename for later error reporting
  * tweaked some help messages
  * fixed up many obsolete comments and docstrings
2000-05-23 01:42:17 +00:00
Guido van Rossum 1d10f3eac2 Changed list_directory() somewhat. It is now only called when there
is no index.htm[l] file, and when it is called, it also spits out the
headers.  When an index.htm[l] file is present, the regular (file
access) path is followed.  Also, when the guessed content-type matches
text/*, open the file in text mode; otherwise in binary mode.
2000-05-21 16:25:29 +00:00
Greg Ward 4355093f94 Tweaked output of 'copy_file()': if copying to a new name, show the whole
destination path, otherwise show just the directory.
2000-05-20 16:05:34 +00:00
Greg Ward a4adafd55b Changed the semantics of the 'sub_commands' list: instead of function
objects, it now has method names.
Added three methods, 'has_lib()', 'has_scripts()', and 'has_data()'
  to determine if we need to run each of the three possible sub-commands.
Added 'get_sub_commands()' to take care of finding the methods named
  in 'sub_commands', running them, and interpreting the results to
  build a list of sub-commands that actually have to be run.
2000-05-20 15:17:09 +00:00
Greg Ward f355d473fa Check if the claimed build directory doesn't exist, and warn that we don't
have any Python modules to install (rather than bomb when we try to copy
a non-existent directory).
2000-05-20 15:08:57 +00:00
Greg Ward 44a61bbb66 Added 'has_scripts()', 'has_data_files()' methods. 2000-05-20 15:06:48 +00:00
Greg Ward 36c36fec7c Added missing import. 2000-05-20 14:07:59 +00:00
Greg Ward f7edea749d Lyle Johnson: added stubs for the four miscellaneous methods that must be
implemented by subclasses, since they are needed by 'gen_lib_options()'.
2000-05-20 13:31:32 +00:00
Greg Ward 5299b6afc5 Added support for the 'export_symbols' parameter to 'link_shared_object()'
and 'link_shared_lib()'.  In MSVCCompiler, this is meaningful: it adds
/EXPORT: options to the linker command line.  In UnixCCompiler, it
is ignored.
2000-05-20 13:23:21 +00:00
Guido van Rossum 974f70d97b Add call to putheader('Host', 'www.python.org') to the example. 2000-05-19 23:06:45 +00:00
Gregory P. Smith 8711a2e150 Changed default developer name.
Added some guiding comments.
2000-05-13 03:35:05 +00:00
Gregory P. Smith 2c067ef904 Template for writing Distutils command modules. 2000-05-13 03:32:36 +00:00
Gregory P. Smith 86ee81e34b Contribution from Harry Henry Gebel: the 'bdist_rpm' command.
(Completely uninspected and untested by me, this is just to
get the code into CVS!)
2000-05-13 03:11:40 +00:00
Gregory P. Smith 21b9e910a5 In 'install_misc': 'self.outfiles' defaults to the empty list, so we don't
have to worry about "or []" in 'get_outputs()'.
2000-05-13 03:10:30 +00:00
Gregory P. Smith 6a901dd1bd List data files are listed in the Distribution attribute 'data_files',
rather than 'data'.
2000-05-13 03:09:50 +00:00
Gregory P. Smith c59d4e0777 Added the 'bdist_base' option, the base temp directory for all bdist commands. 2000-05-13 03:08:28 +00:00
Gregory P. Smith e30b7a91c7 Added 'get_inputs()' methods, needed by the "install" command's
'get_inputs()'.
2000-05-13 03:07:53 +00:00
Gregory P. Smith ba0506b349 Drastically simplified by taking advantage of the "install" command's
new flexibility, specifically the 'root' option.  Now, we just use
"install" to do a fake installation into a temporary directory
(the 'bdist_dir' option, which derives from the 'bdist_base' option of
"bdist"), and then tar/zip up that directory.  This means that dumb
built distributions are now relative to the root directory, rather than
the prefix or exec-prefix; this is probably a feature, but does make
them slightly less flexible.
2000-05-13 03:06:56 +00:00
Gregory P. Smith a04d807127 Rename 'build_bdist' to 'bdist_base', and get it by default from the
"bdist" command rather than "build".
2000-05-13 02:30:15 +00:00
Gregory P. Smith c008488981 Typo fix. 2000-05-13 02:20:43 +00:00
Gregory P. Smith 0ec8ef1601 Made the '--record' option take an argument, which is the name of the
file to write the list of installed files to.
2000-05-13 02:16:45 +00:00
Gregory P. Smith 7e855ef6ad Ditch the explicit search for *.py[co] files -- they're now included in
the list returned by 'get_outputs()', thanks to changes in the
"install_lib" command.
2000-05-13 02:13:53 +00:00
Gregory P. Smith 11fb783fa4 Added '_bytecode_filenames()' method, and use it in 'get_outputs()'
to ensure that compiled bytecode files are considered part of the output
of the "install_lib" command.
2000-05-13 02:11:10 +00:00
Gregory P. Smith f9ebf98725 Moved check for installation to non-sys.path location so it comes
last (after writing list of installed files) -- that way, the warning
is more visible.
2000-05-13 02:01:22 +00:00
Gregory P. Smith 8cb676195b Harry Henry Gebel: add the "--record" option to write the list of
installed files to INSTALLED_FILES.
2000-05-13 01:58:19 +00:00
Gregory P. Smith a190268bf6 Added the 'build_bdist' option and code to clean it up -- this is the
top-level temporary directory for creating built distributions.  (Won't
work yet, since the "build" command doesn't yet have a 'build_bdist'
option, and none of the "bdist" commands support it yet.)
2000-05-13 01:56:55 +00:00
Gregory P. Smith b5ebe5d640 Harry Henry Gebel: get extra compiler flags from the CFLAGS environment
variable.

(Is this really needed?  Can we drop it when the config file mechanism
allows users to set compiler flags in setup.cfg?)
2000-05-13 01:52:14 +00:00
Gregory P. Smith 52e399c904 Harry Henry Gebel: add support for the 'bdist_rpm' command, specifically
the 'no_format_option' class attribute.
2000-05-13 01:49:56 +00:00
Gregory P. Smith d5b53df18c Harry Henry Gebel: add 'bdist_rpm' command. 2000-05-13 01:48:15 +00:00
Gregory P. Smith de5c953a2b From Lyle Johnson: renamed 'implib_dir' to 'implib_file', and
correctly ensure that it's 'dirname' exists.
2000-05-13 01:35:33 +00:00