Project

General

Profile

« Previous | Next » 

Revision 9015

lib/sh/util.sh: split archive (zip) utils out into separate archives.sh

View differences:

schemas/VegCore/VegCore.ERD.mwb.run
1 1
#!/bin/bash -e
2 2
# syncs VegCore.ERD.mwb's zip file contents
3 3
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/runscripts/util.run
4
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/sh/archives.sh
4 5
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/sh/local.sh
5 6

  
6 7
if self_not_included; then
lib/sh/util.sh
293 293
	)|echo_stdin) "$@"
294 294
}
295 295

  
296
#### compression
297

  
298
### zip
299

  
300
zip ()
301
{
302
	stdout2stderr=1 try limit_stderr_cmd self "$@"
303
	ignore 12 # "zip has nothing to do" (`man zip`)
304
	end_try
305
}
306

  
307
unzip () { stdout2stderr=1 limit_stderr_cmd self "$@"; }
308

  
309
set_inv force
310
alias zip_newer='zip ${no_force:+-u }'
311
alias unzip_newer='unzip ${no_force:+-u }-o'
312
	# -o is safe because -u only extracts newer files
313

  
314 296
#### URLs
315 297

  
316 298
localize_url () { test _"$1" = _"$(hostname -f)" || echo "$1"; }
lib/sh/archives.sh
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.sh
3

  
4
if self_not_included; then
5

  
6
### zip
7

  
8
zip ()
9
{
10
	stdout2stderr=1 try limit_stderr_cmd self "$@"
11
	ignore 12 # "zip has nothing to do" (`man zip`)
12
	end_try
13
}
14

  
15
unzip () { stdout2stderr=1 limit_stderr_cmd self "$@"; }
16

  
17
set_inv force
18
alias zip_newer='zip ${no_force:+-u }'
19
alias unzip_newer='unzip ${no_force:+-u }-o'
20
	# -o is safe because -u only extracts newer files
21

  
22
fi
0 23

  

Also available in: Unified diff