change transfer lock filenames to avoid ambiguity
foo.lck could be a lock file for a transfer of foo, or a transfer of a key that happened to end in ".lck". Fix this by using "lck.foo" instead.
This commit is contained in:
		
					parent
					
						
							
								30ac6d7be0
							
						
					
				
			
			
				commit
				
					
						9ab9ef3ebd
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -67,7 +67,7 @@ fieldTransfer direction key a = do | ||||||
| 		=<< Fields.getField Fields.remoteUUID | 		=<< Fields.getField Fields.remoteUUID | ||||||
| 
 | 
 | ||||||
| {- Runs a transfer action. Creates and locks the lock file while the | {- Runs a transfer action. Creates and locks the lock file while the | ||||||
|  - action is running, and stores into in the transfer information |  - action is running, and stores info in the transfer information | ||||||
|  - file. Will throw an error if the transfer is already in progress. |  - file. Will throw an error if the transfer is already in progress. | ||||||
|  -} |  -} | ||||||
| transfer :: Transfer -> Maybe FilePath -> Annex a -> Annex a | transfer :: Transfer -> Maybe FilePath -> Annex a -> Annex a | ||||||
|  | @ -139,7 +139,7 @@ transferFile (Transfer direction u key) r = gitAnnexTransferDir r | ||||||
| 
 | 
 | ||||||
| {- The transfer lock file corresponding to a given transfer info file. -} | {- The transfer lock file corresponding to a given transfer info file. -} | ||||||
| transferLockFile :: FilePath -> FilePath | transferLockFile :: FilePath -> FilePath | ||||||
| transferLockFile infofile = infofile ++ ".lck" | transferLockFile infofile = "lck." ++ infofile | ||||||
| 
 | 
 | ||||||
| {- Parses a transfer information filename to a Transfer. -} | {- Parses a transfer information filename to a Transfer. -} | ||||||
| parseTransferFile :: FilePath -> Maybe Transfer | parseTransferFile :: FilePath -> Maybe Transfer | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joey Hess
				Joey Hess