mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 20:04:43 +00:00
See ChangeLog
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@32 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
e971098902
commit
d5360ad526
7 changed files with 44 additions and 23 deletions
|
|
@ -1,3 +1,6 @@
|
|||
21.3.2000
|
||||
* distutils fixes
|
||||
|
||||
20.3.2000
|
||||
* fix a bug in reporting download time
|
||||
* added the distutils package
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ __all__ = ['build',
|
|||
'install',
|
||||
'install_py',
|
||||
'install_ext',
|
||||
'install_bin',
|
||||
'clean',
|
||||
'sdist',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ __revision__ = "$Id$"
|
|||
import sys, os, string
|
||||
from types import *
|
||||
from distutils.core import Command
|
||||
from distutils.util import write_file
|
||||
from distutils import util
|
||||
from distutils.errors import DistutilsOptionError
|
||||
|
||||
_uninstall_template = """#!/usr/bin/env python
|
||||
|
|
@ -192,16 +192,25 @@ class install (Command):
|
|||
os.path.join (effective_prefix,
|
||||
"lib",
|
||||
"python") # + sys.version[:3] ???
|
||||
if self.install_bin is None:
|
||||
self.install_bin = os.path.join(self.exec_prefix,"bin")
|
||||
# end if self.install_platlib ...
|
||||
|
||||
elif os.name=='nt':
|
||||
if self.install_lib is None:
|
||||
self.install_lib = os.path.join(effective_prefix,
|
||||
"lib")
|
||||
if self.install_platlib is None:
|
||||
self.install_platlib = os.path.join(effective_prefix,
|
||||
"lib")
|
||||
if self.install_bin is None:
|
||||
self.install_bin = effective_prefix
|
||||
else:
|
||||
raise DistutilsPlatformError, \
|
||||
"duh, I'm clueless (for now) about installing on %s" % os.name
|
||||
|
||||
# end if/else on os.name
|
||||
|
||||
if self.install_bin is None:
|
||||
self.install_bin = os.path.join(self.exec_prefix,"bin")
|
||||
|
||||
# 'path_file' and 'extra_dirs' are how we handle distributions that
|
||||
# want to be installed to their own directory, but aren't
|
||||
|
|
@ -295,10 +304,11 @@ class install (Command):
|
|||
base = self.base
|
||||
|
||||
filename = os.path.join (base, self.path_file + ".pth")
|
||||
self.execute (write_file,
|
||||
self.execute (util.write_file,
|
||||
(filename, [self.extra_dirs]),
|
||||
"creating %s" % filename)
|
||||
|
||||
|
||||
def create_uninstall_file(self):
|
||||
"""Create an uninstall file <distribution name>_uninstall.py.
|
||||
The distribution name must be given!
|
||||
|
|
@ -325,7 +335,7 @@ class install (Command):
|
|||
self.distribution.outfiles.append(uninstall_script_c)
|
||||
|
||||
if self.destdir:
|
||||
base = self.destdir + base
|
||||
base = util.add_path_prefix(self.destdir,base)
|
||||
path = os.path.join(base, filename)
|
||||
cpath = os.path.join(base, cfilename)
|
||||
if not os.path.exists(path):
|
||||
|
|
@ -337,9 +347,10 @@ class install (Command):
|
|||
for f in self.distribution.outfiles:
|
||||
# to eliminate duplicates we use a dictionary
|
||||
filelist[f] = 1
|
||||
f = open(path, "w")
|
||||
f.write(_uninstall_template % filelist)
|
||||
f.close()
|
||||
if not self.dry_run:
|
||||
f = open(path, "w")
|
||||
f.write(_uninstall_template % filelist)
|
||||
f.close()
|
||||
# byte-compile the script
|
||||
from py_compile import compile
|
||||
self.make_file (path, cpath, compile, (path,),
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ Implement the Distutils "install_bin" command to install programs
|
|||
and scripts."""
|
||||
|
||||
from distutils.core import Command
|
||||
from distutils import util
|
||||
import os,types,string
|
||||
|
||||
class install_bin(Command):
|
||||
|
|
@ -50,8 +51,8 @@ class install_bin(Command):
|
|||
# (currently only @INSTALL_BIN@ with install_dir)
|
||||
real_install_dir = self.install_dir
|
||||
if self.destdir:
|
||||
self.install_dir = self.destdir+self.install_dir
|
||||
ddlen = len(self.destdir)
|
||||
self.install_dir = util.add_path_prefix(self.destdir,
|
||||
self.install_dir)
|
||||
# create the install directory
|
||||
outfiles = self.mkpath(self.install_dir)
|
||||
# copy the files
|
||||
|
|
@ -65,8 +66,9 @@ class install_bin(Command):
|
|||
else:
|
||||
outfiles.extend(self.run_copy_files(real_install_dir))
|
||||
if self.destdir:
|
||||
# cut off destdir prefix
|
||||
outfiles = map(lambda s,l=ddlen: s[l:], outfiles)
|
||||
for i in range(len(outfiles)):
|
||||
outfiles[i] = util.remove_path_prefix(self.destdir,
|
||||
outfiles[i])
|
||||
self.distribution.outfiles.extend(outfiles)
|
||||
|
||||
def run_copy_files(self, real_install_dir):
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ class install_ext (Command):
|
|||
# putting files in the right package dir is already done when we
|
||||
# build.
|
||||
if self.destdir:
|
||||
self.install_dir = self.destdir+self.install_dir
|
||||
ddlen = len(self.destdir)
|
||||
self.install_dir = util.add_path_prefix(self.destdir,
|
||||
self.install_dir)
|
||||
if self.create_uninstall and not self.force:
|
||||
# turn on self.force to catch all previous installed files
|
||||
oldforce = self.force
|
||||
|
|
@ -56,7 +56,9 @@ class install_ext (Command):
|
|||
else:
|
||||
outfiles = self.copy_tree (self.build_dir, self.install_dir)
|
||||
if self.destdir:
|
||||
outfiles = map(lambda s,l=ddlen: s[l:], outfiles)
|
||||
self.distribution.outfiles = self.distribution.outfiles + outfiles
|
||||
for i in range(len(outfiles)):
|
||||
outfiles[i] = util.remove_path_prefix(self.destdir,
|
||||
outfiles[i])
|
||||
self.distribution.outfiles.extend(outfiles)
|
||||
|
||||
# class InstallExt
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ __revision__ = "$Id$"
|
|||
|
||||
import sys, string
|
||||
from distutils.core import Command
|
||||
from distutils.util import copy_tree
|
||||
from distutils import util
|
||||
|
||||
class install_py (Command):
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ class install_py (Command):
|
|||
# directory to the installation directory (that's the beauty of
|
||||
# having a build directory!)
|
||||
if self.destdir:
|
||||
self.install_dir = self.destdir+self.install_dir
|
||||
ddlen = len(self.destdir)
|
||||
self.install_dir = util.add_path_prefix(self.destdir,
|
||||
self.install_dir)
|
||||
if self.create_uninstall and not self.force:
|
||||
# turn on self.force to catch all previous installed files
|
||||
oldforce = self.force
|
||||
|
|
@ -87,8 +87,10 @@ class install_py (Command):
|
|||
# we're compiling optimally or not, and couldn't pick what to do
|
||||
# even if we did know. ;-(
|
||||
if self.destdir:
|
||||
outfiles = map(lambda s,l=ddlen: s[l:], outfiles)
|
||||
self.distribution.outfiles = self.distribution.outfiles + outfiles
|
||||
for i in range(len(outfiles)):
|
||||
outfiles[i] = util.remove_path_prefix(self.destdir,
|
||||
outfiles[i])
|
||||
self.distribution.outfiles.extend(outfiles)
|
||||
|
||||
# run ()
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class FileUrlData(UrlData):
|
|||
not re.compile("^file:").search(self.urlName):
|
||||
winre = re.compile("^[a-zA-Z]:")
|
||||
if winre.search(self.urlName):
|
||||
self.adjustWindozePath()
|
||||
self.adjustWinPath()
|
||||
else:
|
||||
if self.urlName[0:1] != "/":
|
||||
self.urlName = os.getcwd()+"/"+self.urlName
|
||||
|
|
@ -34,7 +34,7 @@ class FileUrlData(UrlData):
|
|||
self.url = urlparse.urlunparse(self.urlTuple[:3] + ('','',''))
|
||||
|
||||
|
||||
def adjustWindozePath(self):
|
||||
def adjustWinPath(self):
|
||||
"c:\\windows ==> /c|\\windows"
|
||||
self.urlName = "/"+self.urlName[0]+"|"+self.urlName[2:]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue