fix external script for filenames with spaces from protocol
Fix the external special remotes git-annex-remote-ipfs, git-annex-remote-torrent and the example.sh template to correctly support filenames with spaces. This commit was sponsored by John Peloquin on Patreon.
This commit is contained in:
		
					parent
					
						
							
								dafafad115
							
						
					
				
			
			
				commit
				
					
						fdbfe88168
					
				
			
		
					 4 changed files with 15 additions and 6 deletions
				
			
		|  | @ -31,6 +31,9 @@ git-annex (6.20170521) UNRELEASED; urgency=medium | ||||||
|     the filename parameter to the TRANSFER command could not contain |     the filename parameter to the TRANSFER command could not contain | ||||||
|     spaces. It can in fact contain spaces. Special remotes implementors |     spaces. It can in fact contain spaces. Special remotes implementors | ||||||
|     that relied on that may need to fix bugs in their special remotes. |     that relied on that may need to fix bugs in their special remotes. | ||||||
|  |   * Fix the external special remotes git-annex-remote-ipfs,  | ||||||
|  |     git-annex-remote-torrent and the example.sh template to correctly | ||||||
|  |     support filenames with spaces. | ||||||
| 
 | 
 | ||||||
|  -- Joey Hess <id@joeyh.name>  Sat, 17 Jun 2017 13:02:24 -0400 |  -- Joey Hess <id@joeyh.name>  Sat, 17 Jun 2017 13:02:24 -0400 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								doc/special_remotes/external/example.sh
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								doc/special_remotes/external/example.sh
									
										
									
									
										vendored
									
									
								
							|  | @ -122,9 +122,11 @@ while read line; do | ||||||
| 			fi | 			fi | ||||||
| 		;; | 		;; | ||||||
| 		TRANSFER) | 		TRANSFER) | ||||||
|  | 			op="$2" | ||||||
| 			key="$3" | 			key="$3" | ||||||
| 			file="$4" | 			shift 3 | ||||||
| 			case "$2" in | 			file="$@" | ||||||
|  | 			case "$op" in | ||||||
| 				STORE) | 				STORE) | ||||||
| 					# Store the file to a location | 					# Store the file to a location | ||||||
| 					# based on the key. | 					# based on the key. | ||||||
|  |  | ||||||
|  | @ -81,9 +81,11 @@ while read line; do | ||||||
| 			echo CHECKURL-CONTENTS UNKNOWN "$(urltoaddress "$url")" | 			echo CHECKURL-CONTENTS UNKNOWN "$(urltoaddress "$url")" | ||||||
| 		;; | 		;; | ||||||
| 		TRANSFER) | 		TRANSFER) | ||||||
|  | 			op="$2" | ||||||
| 			key="$3" | 			key="$3" | ||||||
| 			file="$4" | 			shift 3 | ||||||
| 			case "$2" in | 			file="$@" | ||||||
|  | 			case "$op" in | ||||||
| 				STORE) | 				STORE) | ||||||
| 					addr=$(ipfs add -q "$file" </dev/null) || true | 					addr=$(ipfs add -q "$file" </dev/null) || true | ||||||
| 					if [ -z "$addr" ]; then | 					if [ -z "$addr" ]; then | ||||||
|  |  | ||||||
|  | @ -149,9 +149,11 @@ while read line; do | ||||||
| 			rm -f "$tmp" | 			rm -f "$tmp" | ||||||
| 		;; | 		;; | ||||||
| 		TRANSFER) | 		TRANSFER) | ||||||
|  | 			op="$2" | ||||||
| 			key="$3" | 			key="$3" | ||||||
| 			file="$4" | 			shift 3 | ||||||
| 			case "$2" in | 			file="$@" | ||||||
|  | 			case "$op" in | ||||||
| 				STORE) | 				STORE) | ||||||
| 					echo TRANSFER-FAILURE STORE "$key" "upload not supported" | 					echo TRANSFER-FAILURE STORE "$key" "upload not supported" | ||||||
| 				;; | 				;; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joey Hess
				Joey Hess