summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-16 07:40:33 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-16 07:40:33 +0000
commit3d817b06a8a848fae137ffb47c1d8fdb41923505 (patch)
tree45e59d0bbaa33637bfa33caf94c37c518b254468 /bin
parent5781834223e0eab17167b8a5d98744ac3050933c (diff)
downloadportage-3d817b06a8a848fae137ffb47c1d8fdb41923505.tar.gz
portage-3d817b06a8a848fae137ffb47c1d8fdb41923505.tar.bz2
portage-3d817b06a8a848fae137ffb47c1d8fdb41923505.zip
Fix broken commitmessagefile handling.
svn path=/main/trunk/; revision=5668
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman22
1 files changed, 13 insertions, 9 deletions
diff --git a/bin/repoman b/bin/repoman
index d609e166d..a9c05c6c1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1572,7 +1572,7 @@ else:
print "myupdates:",myupdates
print "myheaders:",myheaders
print
- unlinkfile=0
+
if commitmessagefile:
try:
f = open(commitmessagefile)
@@ -1600,10 +1600,7 @@ else:
commitmessage+="\n(Portage version: Unknown)"
if myupdates or myremoved:
myfiles = myupdates + myremoved
- unlinkfile=1
commitmessagefile=tempfile.mktemp(".repoman.msg")
- if os.path.exists(commitmessagefile):
- os.unlink(commitmessagefile)
mymsg=open(commitmessagefile,"w")
mymsg.write(commitmessage)
mymsg.close()
@@ -1623,9 +1620,13 @@ else:
retval = spawn(["/usr/bin/cvs", "-q", "commit",
"-F", commitmessagefile] + myfiles,
env=os.environ)
- if retval:
- print "!!! Exiting on cvs (shell) error code:",retval
- sys.exit(retval)
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
+ if retval:
+ print "!!! Exiting on cvs (shell) error code:",retval
+ sys.exit(retval)
# Setup the GPG commands
def gpgsign(filename):
@@ -1751,6 +1752,7 @@ else:
if "--pretend" in myoptions:
print "(/usr/bin/cvs -q commit -F "+commitmessagefile+")"
else:
+ commitmessagefile = tempfile.mktemp(".repoman.msg")
mymsg=open(commitmessagefile,"w")
mymsg.write(commitmessage)
if signed:
@@ -1759,12 +1761,14 @@ else:
mymsg.write("\n (Unsigned Manifest commit)")
mymsg.close()
retval=os.system("/usr/bin/cvs -q commit -F "+commitmessagefile)
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
if retval:
print "!!! Exiting on cvs (shell) error code:",retval
sys.exit(retval)
- if unlinkfile:
- os.unlink(commitmessagefile)
print
if isCvs:
print "CVS commit complete."