[MacPorts] #42047: proc delete should not complain if file does not exist

MacPorts noreply at macports.org
Tue Jan 7 08:45:38 PST 2014


#42047: proc delete should not complain if file does not exist
--------------------------+-----------------------------
 Reporter:  ryandesign@…  |      Owner:  ryandesign@…
     Type:  defect        |     Status:  new
 Priority:  Normal        |  Milestone:  MacPorts Future
Component:  base          |    Version:  2.2.1
 Keywords:                |       Port:
--------------------------+-----------------------------
 The documentation for [http://wiki.tcl.tk/10058 Tcl's "file delete"] says
 "Trying to delete a non-existent file is not considered an error."
 MacPorts' "delete" is supposed to be a smarter "file delete", but it does
 consider attempting to delete a non-existent file to be an error.

 This was not always the case. Originally, proc delete was implemented in
 r18144 using `rm -rf` (which does not complain about non-existent items)
 because it was faster and more reliable than using "file delete".

 In r22007 it was rewritten to use Tcl code, traversing each directory and
 deleting each file individually. The comment was rewritten to specify that
 "file delete" doesn't handle deleting directories properly until Tiger.

 In r24435 it was reimplemented using proc fs-traverse, but there was no
 preceding check for whether the item being deleted is a directory or if it
 even exists. fs-traverse quite rightly complains when asked to traverse a
 non-existent directory.

 Now that MacPorts base has for years already required at least Tiger, we
 can remove all the code and make it simply call "file delete -force"
 directly.

-- 
Ticket URL: <https://trac.macports.org/ticket/42047>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list