aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-06-04 11:15:12 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-06-04 11:15:12 +0000
commit9ddd7d2c4763888c737030b03c04076c3a58e101 (patch)
tree50fd3be246ca1c07a5854c3ddc8b00bc19be87dc /pym
parentmake sure we filter $D when searching for $BUILDDIR in scanelf RPATH output (diff)
downloadportage-cvs-9ddd7d2c4763888c737030b03c04076c3a58e101.tar.gz
portage-cvs-9ddd7d2c4763888c737030b03c04076c3a58e101.tar.bz2
portage-cvs-9ddd7d2c4763888c737030b03c04076c3a58e101.zip
Brought forward fixes from stable
Diffstat (limited to 'pym')
-rw-r--r--pym/dispatch_conf.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/pym/dispatch_conf.py b/pym/dispatch_conf.py
index 3c529cb..79ad46d 100644
--- a/pym/dispatch_conf.py
+++ b/pym/dispatch_conf.py
@@ -1,8 +1,8 @@
# archive_conf.py -- functionality common to archive-conf and dispatch-conf
# Copyright 2003-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/dispatch_conf.py,v 1.4 2005/02/26 06:35:20 jstubbs Exp $
-cvs_id_string="$Id: dispatch_conf.py,v 1.4 2005/02/26 06:35:20 jstubbs Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/dispatch_conf.py,v 1.5 2005/06/04 11:15:12 jstubbs Exp $
+cvs_id_string="$Id: dispatch_conf.py,v 1.5 2005/06/04 11:15:12 jstubbs Exp $"[5:-2]
# Library by Wayne Davison <gentoo@blorf.net>, derived from code
# written by Jeremy Wohl (http://igmus.org)
@@ -33,9 +33,14 @@ def read_config(mandatory_opts):
for key in mandatory_opts:
if not opts.has_key(key):
- print >> sys.stderr, 'dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal' % (key,)
-
- if not (os.path.exists(opts['archive-dir']) and os.path.isdir(opts['archive-dir'])):
+ if key == "merge":
+ opts["merge"] = "sdiff --suppress-common-lines --output=%s %s %s"
+ else:
+ print >> sys.stderr, 'dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal' % (key,)
+
+ if not os.path.exists(opts['archive-dir']):
+ os.mkdir(opts['archive-dir'])
+ elif not os.path.isdir(opts['archive-dir']):
print >> sys.stderr, 'dispatch-conf: Config archive dir [%s] must exist; fatal' % (opts['archive-dir'],)
sys.exit(1)
@@ -63,6 +68,7 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
os.system(RCS_LOCK + ' ' + archive)
os.system(RCS_PUT + ' ' + archive)
+ ret = 0
if newconf != '':
os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive)
has_branch = os.path.exists(archive)
@@ -78,11 +84,12 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
if has_branch:
if mrgconf != '':
# This puts the results of the merge into mrgconf.
- os.system(RCS_MERGE % (archive, mrgconf))
+ ret = os.system(RCS_MERGE % (archive, mrgconf))
mystat = os.lstat(newconf)
os.chmod(mrgconf, mystat[ST_MODE])
os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
os.rename(archive, archive + '.dist.new')
+ return ret
def file_archive(archive, curconf, newconf, mrgconf):
@@ -125,13 +132,16 @@ def file_archive(archive, curconf, newconf, mrgconf):
print >> sys.stderr, 'dispatch-conf: Error copying %s to %s: %s; fatal' % \
(newconf, archive + '.dist.new', str(why))
+ ret = 0
if mrgconf != '' and os.path.exists(archive + '.dist'):
# This puts the results of the merge into mrgconf.
- os.system(DIFF3_MERGE % (curconf, archive + '.dist', newconf, mrgconf))
+ ret = os.system(DIFF3_MERGE % (curconf, archive + '.dist', newconf, mrgconf))
mystat = os.lstat(newconf)
os.chmod(mrgconf, mystat[ST_MODE])
os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
+ return ret
+
def rcs_archive_post_process(archive):
"""Check in the archive file with the .dist.new suffix on the branch