Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 273633
Collapse All | Expand All

(-)a/bin/ebuild-helpers/dodoc (-1 / +1 lines)
Lines 18-24 ret=0 Link Here
18
for x in "$@" ; do
18
for x in "$@" ; do
19
	if [ -s "${x}" ] ; then
19
	if [ -s "${x}" ] ; then
20
		install -m0644 "${x}" "${dir}"
20
		install -m0644 "${x}" "${dir}"
21
		ecompress --queue "${dir}/${x##*/}"
21
		hasq "${EAPI}" 0 1 2 3 && ecompress --queue "${dir}/${x##*/}"
22
	elif [ ! -e "${x}" ] ; then
22
	elif [ ! -e "${x}" ] ; then
23
		echo "!!! ${0##*/}: $x does not exist" 1>&2
23
		echo "!!! ${0##*/}: $x does not exist" 1>&2
24
		((ret|=1))
24
		((ret|=1))
(-)a/bin/ebuild-helpers/ecompressdir (-2 / +3 lines)
Lines 13-19 case $1 in Link Here
13
	--ignore)
13
	--ignore)
14
		shift
14
		shift
15
		for skip in "$@" ; do
15
		for skip in "$@" ; do
16
			[[ -d ${D}${skip} ]] && touch "${D}${skip}.ecompress.skip"
16
			[[ -d ${D}${skip} || -f ${D}${skip} ]] \
17
				&& touch "${D}${skip}.ecompress.skip"
17
		done
18
		done
18
		exit 0
19
		exit 0
19
		;;
20
		;;
Lines 74-80 funk_up_dir() { Link Here
74
}
75
}
75
76
76
# _relocate_skip_dirs(srctree, dsttree)
77
# _relocate_skip_dirs(srctree, dsttree)
77
# Move all the directories we want to skip running compression
78
# Move all files and directories we want to skip running compression
78
# on from srctree to dsttree.
79
# on from srctree to dsttree.
79
_relocate_skip_dirs() {
80
_relocate_skip_dirs() {
80
	local srctree="$1" dsttree="$2"
81
	local srctree="$1" dsttree="$2"
(-)a/bin/ebuild-helpers/prepalldocs (+5 lines)
Lines 4-9 Link Here
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if ! hasq "${EAPI}" 0 1 2 3; then
8
	eqawarn "QA Notice: Deprecated call to 'prepalldocs'"
9
	exit 0
10
fi
11
7
if [[ -n $1 ]] ; then
12
if [[ -n $1 ]] ; then
8
	vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
13
	vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
9
fi
14
fi
(-)a/bin/ebuild-helpers/prepallman (+3 lines)
Lines 4-9 Link Here
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
# replaced by controllable compression in EAPI 4
8
hasq "${EAPI}" 0 1 2 3 || exit 0
9
7
ret=0
10
ret=0
8
11
9
find "${D}" -type d -name man > "${T}"/prepallman.filelist
12
find "${D}" -type d -name man > "${T}"/prepallman.filelist
(-)a/bin/ebuild-helpers/prepinfo (+1 lines)
Lines 27-30 find "${D}${infodir}" -type d -print0 | while read -d $'\0' x ; do Link Here
27
	rm -f "${x}"/dir{,.info}{,.gz,.bz2}
27
	rm -f "${x}"/dir{,.info}{,.gz,.bz2}
28
done
28
done
29
29
30
hasq "${EAPI}" 0 1 2 3 || exit 0
30
exec ecompressdir --queue "${infodir}"
31
exec ecompressdir --queue "${infodir}"
(-)a/bin/ebuild-helpers/prepman (+3 lines)
Lines 15-20 if [[ ! -d ${mandir} ]] ; then Link Here
15
	exit 0
15
	exit 0
16
fi
16
fi
17
17
18
# replaced by controllable compression in EAPI 4
19
hasq "${EAPI}" 0 1 2 3 || exit 0
20
18
shopt -s nullglob
21
shopt -s nullglob
19
22
20
really_is_mandir=0
23
really_is_mandir=0
(-)a/bin/ebuild.sh (+28 lines)
Lines 303-308 export EXEOPTIONS="-m0755" Link Here
303
export LIBOPTIONS="-m0644"
303
export LIBOPTIONS="-m0644"
304
export DIROPTIONS="-m0755"
304
export DIROPTIONS="-m0755"
305
export MOPREFIX=${PN}
305
export MOPREFIX=${PN}
306
declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
307
declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
306
308
307
# adds ".keep" files so that dirs aren't auto-cleaned
309
# adds ".keep" files so that dirs aren't auto-cleaned
308
keepdir() {
310
keepdir() {
Lines 860-865 libopts() { Link Here
860
	hasq -s ${LIBOPTIONS} && die "Never call libopts() with -s"
862
	hasq -s ${LIBOPTIONS} && die "Never call libopts() with -s"
861
}
863
}
862
864
865
docompress() {
866
	hasq "${EAPI}" 0 1 2 3 && die "'docompress' not supported in this EAPI"
867
868
	local f g
869
	if [[ $1 = "-x" ]]; then
870
		shift
871
		for f; do
872
			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
873
			[[ ${f:0:1} = / ]] || f="/${f}"
874
			for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
875
				[[ ${f} = ${g} ]] && continue 2
876
			done
877
			PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
878
		done
879
	else
880
		for f; do
881
			f=$(strip_duplicate_slashes "${f}"); f=${f%/}
882
			[[ ${f:0:1} = / ]] || f="/${f}"
883
			for g in "${PORTAGE_DOCOMPRESS[@]}"; do
884
				[[ ${f} = ${g} ]] && continue 2
885
			done
886
			PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
887
		done
888
	fi
889
}
890
863
abort_handler() {
891
abort_handler() {
864
	local msg
892
	local msg
865
	if [ "$2" != "fail" ]; then
893
	if [ "$2" != "fail" ]; then
(-)a/bin/isolated-functions.sh (-1 / +1 lines)
Lines 572-578 save_ebuild_env() { Link Here
572
			best_version use_with use_enable register_die_hook \
572
			best_version use_with use_enable register_die_hook \
573
			keepdir unpack strip_duplicate_slashes econf einstall \
573
			keepdir unpack strip_duplicate_slashes econf einstall \
574
			dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
574
			dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
575
			insopts diropts exeopts libopts \
575
			insopts diropts exeopts libopts docompress \
576
			abort_handler abort_prepare abort_configure abort_compile \
576
			abort_handler abort_prepare abort_configure abort_compile \
577
			abort_test abort_install dyn_prepare dyn_configure \
577
			abort_test abort_install dyn_prepare dyn_configure \
578
			dyn_compile dyn_test dyn_install \
578
			dyn_compile dyn_test dyn_install \
(-)a/bin/misc-functions.sh (-2 / +97 lines)
Lines 40-45 install_symlink_html_docs() { Link Here
40
	fi
40
	fi
41
}
41
}
42
42
43
# similar to readlink -f, but only expands symlinks up to the last
44
# directory component of the path
45
canonicalise_dir() {
46
	local ret wd=$(pwd)
47
	if [[ -d $1 ]]; then
48
		cd -P "$1" 2>/dev/null && pwd -P
49
		ret=$?
50
	else
51
		cd -P "${1%"${1##*/}"}" 2>/dev/null && echo "$(pwd -P)/${1##*/}"
52
		ret=$?
53
	fi
54
	cd "${wd}"
55
	return ${ret}
56
}
57
58
prepcompress() {
59
	local -a include exclude incl_d incl_f
60
	local f g i real_f real_d
61
62
	# Canonicalise path names and check for their existence.
63
	real_d=$(canonicalise_dir "${D}")
64
	for (( i = 0; i < ${#PORTAGE_DOCOMPRESS[@]}; i++ )); do
65
		real_f=$(canonicalise_dir "${D}${PORTAGE_DOCOMPRESS[i]}")
66
		f=${real_f#"${real_d}"}
67
		if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
68
		then
69
			include[${#include[@]}]=${f:-/}
70
		elif [[ ${i} -ge 3 ]]; then
71
			ewarn "prepcompress:" \
72
				"ignoring nonexistent path '${PORTAGE_DOCOMPRESS[i]}'"
73
		fi
74
	done
75
	for (( i = 0; i < ${#PORTAGE_DOCOMPRESS_SKIP[@]}; i++ )); do
76
		real_f=$(canonicalise_dir "${D}${PORTAGE_DOCOMPRESS_SKIP[i]}")
77
		f=${real_f#"${real_d}"}
78
		if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
79
		then
80
			exclude[${#exclude[@]}]=${f:-/}
81
		elif [[ ${i} -ge 1 ]]; then
82
			ewarn "prepcompress:" \
83
				"ignoring nonexistent path '${PORTAGE_DOCOMPRESS_SKIP[i]}'"
84
		fi
85
	done
86
87
	# Remove redundant entries from lists.
88
	# For the include list, remove any entries that are
89
	# contained in a directory in the include or exclude lists.
90
	for (( i = ${#include[@]} - 1; i >= 0; i-- )); do
91
		f=${include[i]}
92
		for g in "${include[@]}"; do
93
			if [[ ${f} == "${g%/}"/* ]]; then
94
				unset include[i]
95
				continue 2
96
			fi
97
		done
98
		for g in "${exclude[@]}"; do
99
			if [[ ${f} = ${g} || ${f} == "${g%/}"/* ]]; then
100
				unset include[i]
101
				continue 2
102
			fi
103
		done
104
	done
105
	# For the exclude list, remove any entries that are:
106
	# a) contained in a directory in the exclude list, or
107
	# b) _not_ contained in a directory in the include list.
108
	for (( i = ${#exclude[@]} - 1; i >= 0; i-- )); do
109
		f=${exclude[i]}
110
		for g in "${exclude[@]}"; do
111
			if [[ ${f} == "${g%/}"/* ]]; then
112
				unset exclude[i]
113
				continue 2
114
			fi
115
		done
116
		for g in "${include[@]}"; do
117
			[[ ${f} == "${g%/}"/* ]] && continue 2
118
		done
119
		unset exclude[i]
120
	done
121
122
	# Split the include list into directories and files
123
	for f in "${include[@]}"; do
124
		if [[ -d ${D}${f} ]]; then
125
			incl_d[${#incl_d[@]}]=${f}
126
		else
127
			incl_f[${#incl_f[@]}]=${f}
128
		fi
129
	done
130
131
	# Queue up for compression.
132
	# ecompress{,dir} doesn't like to be called with empty argument lists.
133
	[[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --queue "${incl_d[@]}"
134
	[[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${D}}"
135
	[[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}"
136
	return 0
137
}
138
43
install_qa_check() {
139
install_qa_check() {
44
	local f
140
	local f
45
141
Lines 47-52 install_qa_check() { Link Here
47
143
48
	export STRIP_MASK
144
	export STRIP_MASK
49
	prepall
145
	prepall
146
	hasq "${EAPI}" 0 1 2 3 || prepcompress
50
	ecompressdir --dequeue
147
	ecompressdir --dequeue
51
	ecompress --dequeue
148
	ecompress --dequeue
52
149
53
- 
54
--
55
bin/ebuild-helpers/prepalldocs |    2 +-
150
bin/ebuild-helpers/prepalldocs |    2 +-
56
bin/ebuild-helpers/prepallman  |    2 +-
151
bin/ebuild-helpers/prepallman  |    2 +-
57
bin/ebuild-helpers/prepinfo    |    2 +-
152
bin/ebuild-helpers/prepinfo    |    2 +-
58
bin/ebuild-helpers/prepman     |    2 +-
153
bin/ebuild-helpers/prepman     |    2 +-
59
4 files changed, 4 insertions(+), 4 deletions(-)
154
4 files changed, 4 insertions(+), 4 deletions(-)
(-)a/bin/ebuild-helpers/prepalldocs (-1 / +1 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2010 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
(-)a/bin/ebuild-helpers/prepallman (-1 / +1 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2010 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
(-)a/bin/ebuild-helpers/prepinfo (-1 / +1 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2010 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
(-)a/bin/ebuild-helpers/prepman (-2 / +1 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2010 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
- 

Return to bug 273633