Author: wade
Date: 2007-09-26 18:09:00 -0400 (Wed, 26 Sep 2007)
New Revision: 86453
Modified:
trunk/release/pyutils/packaging.py
trunk/release/pyutils/utils.py
Log:
Revert 86421... not quite ready yet.
Modified: trunk/release/pyutils/packaging.py
===================================================================
--- trunk/release/pyutils/packaging.py 2007-09-26 21:49:44 UTC (rev 86452)
+++ trunk/release/pyutils/packaging.py 2007-09-26 22:09:00 UTC (rev 86453)
@@ -296,7 +296,7 @@
"""Construct basepaths and relative paths for sources and
packages."""
# Set up full basepaths
- if self.package_env:
+ if self.package_env and not self.package_basepath:
# If it's a zipdir package
# Make an exception for noarch packages
if self.package_env.get_info_var('USE_ZIP_PKG') and
self.destroot != 'noarch':
@@ -310,13 +310,14 @@
self.package_basepath =
os.path.join(config.packaging_dir, packages_dir)
self.package_base_relpath = packages_dir
- # Point to snapshot sources if this is HEAD and if we build out
of Mono's svn repo
- if self.HEAD_or_RELEASE == "HEAD" and not
self.get_info_var('EXTERNAL_SOURCE'):
- sources_dir = "snapshot_sources"
- else:
- sources_dir = "sources"
- self.source_basepath = config.packaging_dir + os.sep +
sources_dir
- self.source_base_relpath = sources_dir
+ if not self.source_basepath:
+ # Point to snapshot sources if this is HEAD and if we
build out of Mono's svn repo
+ if self.HEAD_or_RELEASE == "HEAD" and not
self.get_info_var('EXTERNAL_SOURCE'):
+ sources_dir = "snapshot_sources"
+ else:
+ sources_dir = "sources"
+ self.source_basepath = config.packaging_dir + os.sep +
sources_dir
+ self.source_base_relpath = sources_dir
# Set up relative and full paths
if self.package_env:
@@ -453,23 +454,8 @@
version_selection_reg = ""
if self.HEAD_or_RELEASE == "RELEASE":
version_selection_reg =
self.get_info_var('version_selection_reg')
+ self.latest_version =
utils.get_latest_ver(self.package_fullpath, fail_on_missing=fail_on_missing,
version_reg=version_selection_reg )
- # If it's HEAD and not found, try RELEASE as
well
- try:
- self.latest_version =
utils.get_latest_ver(self.package_fullpath, fail_on_missing=fail_on_missing,
version_reg=version_selection_reg )
- except utils.VersionNotFound:
- if self.HEAD_or_RELEASE == "HEAD":
- print "Wanted HEAD packages...
trying RELEASE"
- self.HEAD_or_RELEASE = "RELEASE"
- # Will probably have to call
these... is that enough?
- self.setup_paths()
- self.setup_symlinks()
- try:
- self.latest_version =
utils.get_latest_ver(self.package_fullpath, fail_on_missing=fail_on_missing,
version_reg=version_selection_reg )
- except utils.VersionNotFound:
- print "RELEASE packages
also not found... exiting."
- sys.exit(1)
-
if self.bundle_obj.version_map_exists:
# Cases
# 1. version from bundle
@@ -497,11 +483,7 @@
self.version, =
re.compile('([\d\.]*)-0').search(self.version).groups(1)
# 5. If version doesn't have a release
(signified by a dash), get the latest release of that version
elif not
re.compile('[\d\.]*-').search(self.version):
- try:
- self.version =
utils.get_latest_ver(self.package_fullpath, version=self.version,
fail_on_missing=fail_on_missing)
- except VersionNotFound:
- print "Bundle version not
found: " + self.version
- sys.exit(1)
+ self.version =
utils.get_latest_ver(self.package_fullpath, version=self.version,
fail_on_missing=fail_on_missing)
if not os.path.exists(self.package_fullpath +
os.sep + self.version):
print "Trying to use %s/%s but this
path does not exist!" % (self.package_fullpath, self.version)
Modified: trunk/release/pyutils/utils.py
===================================================================
--- trunk/release/pyutils/utils.py 2007-09-26 21:49:44 UTC (rev 86452)
+++ trunk/release/pyutils/utils.py 2007-09-26 22:09:00 UTC (rev 86453)
@@ -512,9 +512,6 @@
# strip the whitespace off the end (makes it behave more like
commands.getxxx)
return exit_code, "".join(collected).rstrip()
-class VersionNotFound(Exception):
- def __init__(self, dir, version):
- print "utils.get_latest_ver: in %s: version '%s' not found" %
(dir, version)
def get_latest_ver(dir, version="", fail_on_missing=True, version_reg=""):
"""args: dir, and optional version.
@@ -529,7 +526,7 @@
files = os.listdir(dir)
elif fail_on_missing:
print "utils.get_latest_ver: Path does not exist: %s" % dir
- raise VersionNotFound(dir, 'latest')
+ sys.exit(1)
else:
print "utils.py: get_latest_ver: fail_on_missing=False,
Warning: path does not exist: " + dir
@@ -558,7 +555,7 @@
latest_version = ""
if fail_on_missing:
print "utils.get_latest_ver: No candidates for dir
entry for '%s/%s', exiting" % (dir, version)
- raise VersionNotFound(dir, version)
+ sys.exit(1)
else:
latest_version = version_sort(files).pop()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches