logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

darcs patch: fix bug in doesDirectoryReallyExist.: msg#00130

Subject: darcs patch: fix bug in doesDirectoryReallyExist.
Thu Oct 20 08:17:10 EDT 2005  David Roundy <droundy@xxxxxxxxx>
  * fix bug in doesDirectoryReallyExist.
  We were failing with an exception if there was no such object.  The error
  message was:
  
  Fail: getSymbolicLinkStatus: does not exist
New patches:

[fix bug in doesDirectoryReallyExist.
David Roundy <droundy@xxxxxxxxx>**20051020121710
 We were failing with an exception if there was no such object.  The error
 message was:
 
 Fail: getSymbolicLinkStatus: does not exist
] 
<
> {
hunk ./Lock.lhs 80
                                          else getlock l 0
 
 removeFileMayNotExist :: FilePath -> IO ()
-removeFileMayNotExist f = catchJust ioErrors (removeFile f) $
-                          \e -> if isDoesNotExistError e then return ()
-                                                         else ioError e
+removeFileMayNotExist f = catchNonExistence (removeFile f) ()
+
+catchNonExistence :: IO a -> a -> IO a
+catchNonExistence job nonexistval =
+    catchJust ioErrors job $
+    \e -> if isDoesNotExistError e then return nonexistval
+                                   else ioError e
 
 releaseLock s = removeFileMayNotExist s
 
hunk ./Lock.lhs 210
 withDelayedDir = withDir Delayed
 
 doesDirectoryReallyExist :: FilePath -> IO Bool
-doesDirectoryReallyExist f = do
-    fs <- getSymbolicLinkStatus f
-    return (isDirectory fs)
+doesDirectoryReallyExist f =
+    catchNonExistence (isDirectory `fmap` getSymbolicLinkStatus f) False
 
 rm_recursive :: FilePath -> IO ()
 rm_recursive d =
}

Context:

[RemoteApply no longer depends on cd, use --repodir instead.
vborja@xxxxxxxxxxxxxx**20051110140430
 
 This is a minor change to make darcs no longer use cd
 before applying patches to a remote repository. 
 Now the --repodir option for the apply command is used.
 
 This patch came from a hack to rssh[http://sf.net/projects/rssh]
 to allow using darcs as a restricted command without depending
 on the cd binary.
 
http://sf.net/tracker/index.php?func=detail&aid=1351939&group_id=65349&atid=510643
] 
[Support signed push
Esa Ilari Vuokko <ei@xxxxxxxxxxx>**20051129082159] 
[Fix typo in multirepo pull.
Juliusz Chroboczek <jch@xxxxxxxxxxxxxx>**20051217201918] 
[Fix merge conflicts.
Juliusz Chroboczek <jch@xxxxxxxxxxxxxx>**20051217201903] 
[Use POSIX-style option for 'head', instead of obsolescent syntax
Marnix Klooster <marnix.klooster@xxxxxxxxx>**20051216111731] 
[Clarify wording for changes that can't be unreverted
me@xxxxxxxxxxxxxxx**20051216151120] 
[Set attachment filename when sending a patch bundle by e-mail.
Zachary P. Landau <kapheine@xxxxxxxxxxxxxxxxxx>**20051217195009] 
[save long comment file if a test fails during record
Zachary P. Landau <kapheine@xxxxxxxxxxxxxxxxxx>**20051216023948] 
[properly quote paths so that paths with spaces in them are okay
zooko@xxxxxxxxx**20051121195057] 
[fix up debug printouts in cygwin-wrapper.bash
zooko@xxxxxxxxx**20051115011712] 
[smoother invocation of cygwin-wrapper.bash -- it detects fully-qualified path 
to itself by leading /
zooko@xxxxxxxxx**20051115011702] 
[modernize amend-record.pl to be more portable.
Mark Stosberg <mark@xxxxxxxxxxxxxxx>**20050402133417
 
 This depends on the new "echo_to_darcs()" function in Test::Darcs
] 
[add changelog entry for multirepo pull.
David Roundy <droundy@xxxxxxxxx>**20051215122808] 
[implementation of --set-scripts-executable on local darcs get
kow@xxxxxxxx**20051210215122
 proposed fix for issue38
 
 The --set-scripts-executable flag is normally evaluated when you apply
 patches.  But when you do a local darcs get, no patches are applied.
 So as a solution, we traverse the directory on local darcs get , and set
 any script files to be executable. 
 
 Note: one flaw in this patch is that it duplicates the definition of
 what a script is -- a file that starts with #! -- in PatchApply.lhs and
 Get.lhs.  It might be good to refactor these somehow.
 
] 
[extended set-scripts-executable test
kow@xxxxxxxx**20051210200615
 added check for local darcs get (issue 38) as well as initial sanity check
  
] 
[Fix merge conflicts.
Juliusz Chroboczek <jch@xxxxxxxxxxxxxx>**20051214223217] 
[Add --subject flag to 'darcs send'
Joeri van Ruth <jvr@xxxxxxxx>**20051205120301] 
[print out the patch name when a test fails.
Zachary P. Landau <kapheine@xxxxxxxxxxxxxxxxxx>**20051205055109] 
[Fix mistyped /dev/null, fixes --sendmail-command in Windows
Esa Ilari Vuokko <ei@xxxxxxxxxxx>**20051129160120] 
[Use \ as path separator for GnuPG in Windows -- makes apply --verify work
Esa Ilari Vuokko <ei@xxxxxxxxxxx>**20051129164533] 
[make dangers and recommended use of "Amend" clearer in the docs.
Mark Stosberg <mark@xxxxxxxxxxxxxxx>**20051213140523
 
 I think it's important to be clearer about when it's appropriate to use 
'amend',
 so I moved some notes into the short and mid-length help texts.
] 
[update web page to reflect 1.0.5 as latest stable source.
Tommy Pettersson <ptp@xxxxxxxxxxxxxx>**20051213111137] 
[fix handling of absolute paths containing drive letters
Will <will@xxxxxxxxxx>**20051208054737
 This fixes issue 47 where paths containing drive letters (i.e. on windows)
 are not treated as absolute paths.
] 
[bump version to 1.0.6pre1
Tommy Pettersson <ptp@xxxxxxxxxxxxxx>**20051208092839] 
[revert maybe_relink and atomic_create to original C code.
David Roundy <droundy@xxxxxxxxx>**20051208131213] 
[resolve conflicts between stable and unstable.
David Roundy <droundy@xxxxxxxxx>**20051206134818] 
[Merge changes
Ian Lynagh <igloo@xxxxxxxx>**20051008225210] 
[add support for pulling from multiple repositories simultaneously.
David Roundy <droundy@xxxxxxxxx>**20050919125012] 
[fix mkstemp implementation for win32
Peter Strand <peter@xxxxxxxxxx>**20050810211303] 
[Implement parts of System.Posix.(IO|Files) for win32
peter@xxxxxxxxxx**20050809200433] 
[implement RawMode with library functions instead of ffi
peter@xxxxxxxxxx**20050809200148] 
[call hsc2hs without output filename argument
peter@xxxxxxxxxx**20050808220444] 
[Rename compat.c to c_compat.c to avoid object filename conflict with Compat.hs
peter@xxxxxxxxxx**20050731114011] 
[Move atomic_create/sloppy_atomic_create to Compat
Ian Lynagh <igloo@xxxxxxxx>**20050730141703] 
[Split the raw mode stuff out into its own .hsc file. Windows needs some TLC
Ian Lynagh <igloo@xxxxxxxx>**20050730134030] 
[Move maybe_relink out of compat.c
Ian Lynagh <igloo@xxxxxxxx>**20050730131205] 
[Remove is_symlink
Ian Lynagh <igloo@xxxxxxxx>**20050730122255] 
[Move mkstemp to Compat.hs
Ian Lynagh <igloo@xxxxxxxx>**20050730020918] 
[Start Compat.hs, and move stdout_is_a_pipe from compat.c
Ian Lynagh <igloo@xxxxxxxx>**20050730004829] 
[TAG 1.0.5
Tommy Pettersson <ptp@xxxxxxxxxxxxxx>**20051207112730] 
Patch bundle hash:
ee877b323dbdc8f295fc16d9499e83ceefb4f4b2
_______________________________________________
darcs-devel mailing list
darcs-devel@xxxxxxxxx
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
<Prev in Thread] Current Thread [Next in Thread>