darcs

Issue 266 wrong exit code and cryptic error message if dist fails

Title wrong exit code and cryptic error message if dist fails
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, markstos, thorkilnaur, tommy
Assigned To
Topics

Created on 2006-09-15.23:24:17 by tommy, last changed 2009-08-27.14:05:09 by admin.

Messages
msg990 (view) Author: tommy Date: 2006-09-15.23:24:11
If the file _repo.tar.gz exists and is non-writable, "darcs dist" prints

  gzip: compressed data not written to a terminal. Use -f to force compression.
  For help, type: gzip -h
  Created dist as _repo.tar.gz

and returns with success.
But the dist tar file has *not* been created (overwritten).

Darcs should catch the error and fail.
msg991 (view) Author: tommy Date: 2006-09-15.23:47:33
I suspect this has something to do with the exec function in Exec.lhs.
When it redirects to a file and the open fails, it seems to continue
with the redirection unchanged (the unix part of the code).

The windows part of exec (using system) complains with

  /bin/sh: line 1: _repo.tar.gz: Permission denied
  Created dist as _repo.tar.gz

and still exits with success.
msg1848 (view) Author: kowey Date: 2007-07-16.22:38:43
For what it's worth, the new current version under Unix exits with code 3 and
complains.  Still cryptic, though.

Failed to execute external command: gzip -c
Lowlevel error: open_write: Permission denied
Redirects: (File "/private/tmp/foo/darcsmdVEbo",File
"/private/tmp/foo/foo.tar.gz",AsIs)
msg3267 (view) Author: markstos Date: 2008-02-09.18:13:14
When I tried this today with "darcs dist" using darcs-unstable, I got a rather
clear error message after making the target file file not writable:

darcs: /home/mark/Haskell/tmp/tmp.tar.gz: openBinaryFile: permission denied
(Permission denied)

I tried again with darcs 1.0.9 and got a message like the ones reported below,
so I'm considering this resolved-in-unstable.
History
Date User Action Args
2006-09-15 23:24:17tommycreate
2006-09-15 23:47:47tommysetstatus: unread -> unknown
nosy: droundy, tommy, kowey
messages: + msg991
2007-07-16 22:38:45koweysetnosy: + beschmi
messages: + msg1848
2008-02-09 18:13:16markstossetstatus: unknown -> resolved-in-unstable
nosy: + markstos
messages: + msg3267
2008-09-04 21:29:16adminsetstatus: resolved-in-unstable -> resolved
nosy: + dagit
2009-08-06 17:51:13adminsetnosy: + jast, Serware, dmitry.kurochkin, darcs-devel, zooko, mornfall, simon, thorkilnaur, - droundy
2009-08-06 20:51:55adminsetnosy: - beschmi
2009-08-10 21:55:37adminsetnosy: - darcs-devel, zooko, jast, Serware, mornfall
2009-08-10 23:56:08adminsetnosy: - dagit
2009-08-25 18:02:35adminsetnosy: + darcs-devel, - simon
2009-08-27 14:05:09adminsetnosy: tommy, kowey, markstos, darcs-devel, thorkilnaur, dmitry.kurochkin