Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 309001 | Differences between
and this patch

Collapse All | Expand All

(-)a/bin/ebuild.sh (-2 / +2 lines)
Lines 348-354 unpack() { Link Here
348
		_unpack_tar() {
348
		_unpack_tar() {
349
			if [ "${y}" == "tar" ]; then
349
			if [ "${y}" == "tar" ]; then
350
				$1 -dc "$srcdir$x" | tar xof -
350
				$1 -dc "$srcdir$x" | tar xof -
351
				assert "$myfail"
351
				assert_tar_extract "$myfail"
352
			else
352
			else
353
				$1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
353
				$1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
354
			fi
354
			fi
Lines 364-370 unpack() { Link Here
364
				;;
364
				;;
365
			tbz|tbz2)
365
			tbz|tbz2)
366
				bzip2 -dc "$srcdir$x" | tar xof -
366
				bzip2 -dc "$srcdir$x" | tar xof -
367
				assert "$myfail"
367
				assert_tar_extract "$myfail"
368
				;;
368
				;;
369
			ZIP|zip|jar)
369
			ZIP|zip|jar)
370
				unzip -qo "${srcdir}${x}" || die "$myfail"
370
				unzip -qo "${srcdir}${x}" || die "$myfail"
(-)a/bin/isolated-functions.sh (-1 / +26 lines)
Lines 15-20 assert() { Link Here
15
	done
15
	done
16
}
16
}
17
17
18
assert_tar_extract() {
19
	# When extracting a tar file like this:
20
	#
21
	#     bzip2 -dc foo.tar.bz2 | tar xof -
22
	#
23
	# For some tar files (see bug #309001), tar will
24
	# close its stdin pipe when the decompressor still has
25
	# remaining data to be written to its stdout pipe. This
26
	# causes the decompressor to be killed by SIGPIPE. In
27
	# this case, we want to ignore pipe writers killed by
28
	# SIGPIPE, and trust the exit status of tar. We refer
29
	# to the bash manual section "3.7.5 Exit Status"
30
	# which says, "When a command terminates on a fatal
31
	# signal whose number is N, Bash uses the value 128+N
32
	# as the exit status."
33
34
	local x pipestatus=${PIPESTATUS[*]}
35
	for x in $pipestatus ; do
36
		# Allow SIGPIPE through (128 + 13)
37
		[[ $x -ne 0 && $x -ne 141 ]] && die "$@"
38
	done
39
40
	# Require normal success for the last process (tar).
41
	[[ $x -eq 0 ]] || die "$@"
42
}
43
18
shopt -s extdebug
44
shopt -s extdebug
19
45
20
# dump_trace([number of funcs on stack to skip],
46
# dump_trace([number of funcs on stack to skip],
21
- 

Return to bug 309001