# default request script - Is also wrapped around user's request script
# unless --no-autorelocate is requested. Finds the python site-packages
# directory and prompts for verification
-DEFAULT_REQUEST="""#!/bin/sh
+DEFAULT_REQUEST="""#!/bin/sh
######################################################################
# Distutils internal package relocation support #
######################################################################
/usr/bin/which python 2>&1 >/dev/null
if [ $? -ne 0 ]; then
echo "The python interpretor needs to be on your path!"
- echo
+ echo
echo "If you have more than one, make sure the first one is where"
echo "you want this module installed:"
exit 1
echo ""
if [ -z "${PY_DIR}" ]; then
- echo "I can't seem to find the python distribution."
- echo "I'm assuming the default path for site-packages"
+ echo "I can't seem to find the python distribution."
+ echo "I'm assuming the default path for site-packages"
else
- BASEDIR="${PY_PKG_DIR}"
- cat <<EOF
- Python found! The default path:
+ BASEDIR="${PY_PKG_DIR}"
+ cat <<EOF
+ Python found! The default path:
- ${BASEDIR}
+ ${BASEDIR}
- will install ${PRODUCT} such that all python users
- can import it.
+ will install ${PRODUCT} such that all python users
+ can import it.
- If you just want individual access, you can install into
- any directory and add that directory to your \$PYTHONPATH
+ If you just want individual access, you can install into
+ any directory and add that directory to your \$PYTHONPATH
EOF
fi
echo ""
BASEDIR=`ckpath -d ${BASEDIR} -ay \
- -p "Where should ${PRODUCT} be installed? [${BASEDIR}]"` || exit $?
+ -p "Where should ${PRODUCT} be installed? [${BASEDIR}]"` || exit $?
######################################################################
# user supplied request script follows #
DEFAULT_POSTINSTALL="""#!/bin/sh
/usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
if [ $? -eq 0 ]; then
- python -c "import compileall;compileall.compile_dir(\\"${BASEDIR}/__DISTUTILS_NAME__\\")"
- chown -R root:other ${BASEDIR}/__DISTUTILS_NAME__
+ python -c "import compileall;compileall.compile_dir(\\"${BASEDIR}/__DISTUTILS_NAME__\\")"
+ chown -R root:other ${BASEDIR}/__DISTUTILS_NAME__
fi
"""
/usr/bin/which python 2>&1 >/dev/null
if [ $? -ne 0 ]; then
echo "The python interpretor needs to be on your path!"
- echo
+ echo
echo "If you have more than one, make sure the first one is where"
echo "you want this module removed from"
exit 1
/usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
if [ $? -eq 0 ]; then
- find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyc" -exec rm {} \;
- find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyo" -exec rm {} \;
+ find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyc" -exec rm {} \;
+ find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyo" -exec rm {} \;
fi
"""
/usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
if [ $? -eq 0 ]; then
- if [ `find ${BASEDIR}/__DISTUTILS_NAME__ ! -type d | wc -l` -eq 0 ]; then
- rm -rf ${BASEDIR}/__DISTUTILS_NAME__
- fi
+ if [ `find ${BASEDIR}/__DISTUTILS_NAME__ ! -type d | wc -l` -eq 0 ]; then
+ rm -rf ${BASEDIR}/__DISTUTILS_NAME__
+ fi
fi
"""
self.ensure_script('postremove')
self.ensure_string('vendor', None)
if self.__dict__.has_key('author'):
- if self.__dict__.has_key('author_email'):
- self.ensure_string('vendor',
- "%s <%s>" % (self.author,
- self.author_email))
- else:
- self.ensure_string('vendor',
- "%s" % (self.author))
+ if self.__dict__.has_key('author_email'):
+ self.ensure_string('vendor',
+ "%s <%s>" % (self.author,
+ self.author_email))
+ else:
+ self.ensure_string('vendor',
+ "%s" % (self.author))
self.ensure_string('category', "System,application")
self.ensure_script('compver')
self.ensure_script('depend')
raise DistutilsOptionError, \
"pkg-abrev (%s) must be less than 9 characters" % self.pkg_abrev
# Update default scripts with our metadata name
- DEFAULT_REQUEST = string.replace(DEFAULT_REQUEST,
+ DEFAULT_REQUEST = string.replace(DEFAULT_REQUEST,
"__DISTUTILS_NAME__", self.root_package)
DEFAULT_POSTINSTALL = string.replace(DEFAULT_POSTINSTALL,
"__DISTUTILS_NAME__", self.root_package)
'compver',None)
self.write_script(os.path.join(pkg_dir, "depend"),
'depend',None)
-
+
self.announce('Creating prototype file')
path = os.path.join(pkg_dir, "prototype")
self.execute(write_file,
pkg_cmd.append(os.environ['PWD'])
self.spawn(pkg_cmd)
pkg_cmd = ['pkgtrans', '-s', '/var/spool/pkg']
- path = os.path.join(os.environ['PWD'],pkg_dir,
- self.get_binary_name() + ".pkg")
+ path = os.path.join(os.environ['PWD'],pkg_dir,
+ self.get_binary_name() + ".pkg")
self.announce('Transferring package to ' + pkg_dir)
pkg_cmd.append(path)
pkg_cmd.append(self.pkg_abrev)
self.spawn(pkg_cmd)
os.system("rm -rf /var/spool/pkg/%s" % self.pkg_abrev)
-
+
def run (self):
if self.subpackages:
self.make_package()
# run()
-
+
def _make_prototype(self):
proto_file = ["i pkginfo"]
if self.request:
build = self.get_finalized_command('build')
try:
- self.distribution.packages[0]
- file_list=string.split(
- getoutput("pkgproto %s/%s=%s" % (build.build_lib,
- self.distribution.packages[0],
- self.distribution.packages[0])),"\012")
+ self.distribution.packages[0]
+ file_list=string.split(
+ getoutput("pkgproto %s/%s=%s" % (build.build_lib,
+ self.distribution.packages[0],
+ self.distribution.packages[0])),"\012")
except:
- file_list=string.split(
- getoutput("pkgproto %s=" % (build.build_lib)),"\012")
- ownership="%s %s" % (pwd.getpwuid(os.getuid())[0],
+ file_list=string.split(
+ getoutput("pkgproto %s=" % (build.build_lib)),"\012")
+ ownership="%s %s" % (pwd.getpwuid(os.getuid())[0],
grp.getgrgid(os.getgid())[0])
for i in range(len(file_list)):
file_list[i] = string.replace(file_list[i],ownership,"root bin")
# script with the autorelocation script. If no script is provided,
# The request script will simply be the autorelocate script
if self.no_autorelocate==0:
- request=string.split(DEFAULT_REQUEST,"\012")
+ request=string.split(DEFAULT_REQUEST,"\012")
else:
self.announce('Creating relocation request script')
if self.request:
users_request.remove(users_request[0])
for i in users_request:
request.append(i)
-
+
if self.no_autorelocate==0:
request.append("#############################################")
request.append("# finalize relocation support #")
'PSTAMP="%s"' % self.revision,
]
info_file.extend(['VENDOR="%s (%s)"' % (self.distribution.maintainer, \
- self.distribution.license) ])
+ self.distribution.license) ])
info_file.extend(['EMAIL="%s"' % self.distribution.maintainer_email ])
-
+
p = self.distribution.get_platforms()
- if p is None or p==['UNKNOWN']:
- archs=getoutput('uname -p')
+ if p is None or p==['UNKNOWN']:
+ archs=getoutput('uname -p')
else:
archs=string.join(self.distribution.get_platforms(),',')
#else:
break
if site:
info_file.extend(['BASEDIR="%s"' % site ])
-
+
return info_file
# _make_info_file ()
new_changelog.append(line)
else:
new_changelog.append(' ' + line)
-
+
# strip trailing newline inserted by first changelog entry
if not new_changelog[0]:
del new_changelog[0]
-
+
return new_changelog
# _format_changelog()