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 / +29 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 borrow
29
	# WIFSIGNALED and WTERMSIG bitwise operations from
30
	# glibc's bits/waitstatus.h.
31
32
	local x pipestatus=${PIPESTATUS[*]}
33
	for x in $pipestatus ; do
34
		if [[ $x -ne 0 ]] ; then
35
			# WIFSIGNALED(status)
36
			(( ( ( ( x & 0x7f ) + 1 ) >> 1 ) > 0 )) || die "$@"
37
38
			# WTERMSIG(status) == SIGPIPE
39
			(( ( x & 0x7f ) == 13 )) || die "$@"
40
		fi
41
	done
42
43
	# Require normal success for the last process (tar).
44
	[[ $x -eq 0 ]] || die "$@"
45
}
46
18
shopt -s extdebug
47
shopt -s extdebug
19
48
20
# dump_trace([number of funcs on stack to skip],
49
# dump_trace([number of funcs on stack to skip],
21
- 

Return to bug 309001