[MacPorts] #29223: if an install is interrupted, a later install of the same package can fail if version number has since changed.

MacPorts noreply at macports.org
Thu Apr 21 01:09:16 PDT 2011


#29223: if an install is interrupted, a later install of the same package can fail
if version number has since changed.
----------------------------------+-----------------------------------------
 Reporter:  rogerdpack@…          |       Owner:  macports-tickets@…                   
     Type:  defect                |      Status:  new                                  
 Priority:  Normal                |   Milestone:                                       
Component:  ports                 |     Version:  1.9.2                                
 Keywords:                        |        Port:                                       
----------------------------------+-----------------------------------------

Comment(by ryandesign@…):

 I looked at the code and it's actually using the mtime of the statefile,
 and not looking at the work directory itself, but that doesn't change the
 point I'm making.

 One could say that the problem is that we preserve the mtime when we sync.
 When using rsync (the default for MacPorts), it's the `-t` flag that
 preserves mtime; the default rsync_options in macports.conf do include
 `-t` (they're `-rtzv --delete-after`). If the user has configured to sync
 with Subversion instead, Subversion by default does not preserve mtime,
 but the user can edit the Subversion configuration file to make it do so.
 (See [http://svnbook.red-
 bean.com/en/1.5/svn.advanced.confarea.html#svn.advanced.confarea.opts.config
 "use-commit-times"] in the Subversion book.)

 One solution would therefore be to not preserve mtimes when we sync, by
 removing `-t` from the rsync_options, and for Subversion, by enforcing a
 config file that doesn't specify `use-commit-times`. However, I think
 preserving mtimes is nice for other reasons, so I'd like to find a fix
 that doesn't require us to destroy this piece of metadata.

 What we really want to know, in the case of resuming an interrupted
 install, is: is the portfile we're now using newer than the portfile we
 were using when we started? In order to answer that question, we need to
 keep track of the mtime of the portfile we were using when we started. I'd
 put that in a line in the statefile. Then we can check if the mtime of the
 portfile is newer (or, heck: is different at all -- newer or older) than
 the mtime previously recorded in the statefile; if so, delete the work
 directory and start over.

-- 
Ticket URL: <https://trac.macports.org/ticket/29223#comment:6>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list