Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/
Date: Thu, 21 May 2020 20:25:38
Message-Id: 1589939370.5a8322accecab68d7b00637f288487354e7a01d3.mattst88@gentoo
1 commit: 5a8322accecab68d7b00637f288487354e7a01d3
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 20 01:20:02 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Wed May 20 01:49:30 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5a8322ac
7
8 targets: Remove copy_{file,symlink,lib} functions
9
10 Unused since the removal of the original netboot target.
11
12 I'm honestly kind of impressed with the strategy of running ldd and
13 recursively copying libraries to the netboot image. Unfortunately for
14 this strategy, dlopen() exists so this cannot work.
15
16 Fixes: 89f57e145f82 (targets: Delete the netboot target)
17 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
18
19 targets/support/chroot-functions.sh | 75 -------------------------------------
20 1 file changed, 75 deletions(-)
21
22 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
23 index d40279ae..d63e4918 100755
24 --- a/targets/support/chroot-functions.sh
25 +++ b/targets/support/chroot-functions.sh
26 @@ -335,81 +335,6 @@ run_default_funcs() {
27 fi
28 }
29
30 -# Functions
31 -# Copy libs of a executable in the chroot
32 -function copy_libs() {
33 - # Check if it's a dynamix exec
34 - ldd ${1} > /dev/null 2>&1 || return
35 -
36 - for lib in `ldd ${1} | awk '{ print $3 }'`
37 - do
38 - echo ${lib}
39 - if [ -e ${lib} ]
40 - then
41 - if [ ! -e ${clst_root_path}/${lib} ]
42 - then
43 - copy_file ${lib}
44 - [ -e "${clst_root_path}/${lib}" ] && \
45 - strip -R .comment -R .note ${clst_root_path}/${lib} \
46 - || echo "WARNING : Cannot strip lib ${clst_root_path}/${lib} !"
47 - fi
48 - else
49 - echo "WARNING : Some library was not found for ${lib} !"
50 - fi
51 - done
52 -}
53 -
54 -function copy_symlink() {
55 - STACK=${2}
56 - [ "${STACK}" = "" ] && STACK=16 || STACK=$((${STACK} - 1 ))
57 -
58 - if [ ${STACK} -le 0 ]
59 - then
60 - echo "WARNING : ${TARGET} : too many levels of symbolic links !"
61 - return
62 - fi
63 -
64 - [ ! -e ${clst_root_path}/`dirname ${1}` ] && \
65 - mkdir -p ${clst_root_path}/`dirname ${1}`
66 - [ ! -e ${clst_root_path}/${1} ] && \
67 - cp -vfdp ${1} ${clst_root_path}/${1}
68 -
69 - if [[ -n $(type -p realpath) ]]; then
70 - TARGET=`realpath ${1}`
71 - else
72 - TARGET=`readlink -f ${1}`
73 - fi
74 - if [ -h ${TARGET} ]
75 - then
76 - copy_symlink ${TARGET} ${STACK}
77 - else
78 - copy_file ${TARGET}
79 - fi
80 -}
81 -
82 -function copy_file() {
83 - f="${1}"
84 -
85 - if [ ! -e "${f}" ]
86 - then
87 - echo "WARNING : File not found : ${f}"
88 - continue
89 - fi
90 -
91 - [ ! -e ${clst_root_path}/`dirname ${f}` ] && \
92 - mkdir -p ${clst_root_path}/`dirname ${f}`
93 - [ ! -e ${clst_root_path}/${f} ] && \
94 - cp -vfdp ${f} ${clst_root_path}/${f}
95 - if [ -x ${f} -a ! -h ${f} ]
96 - then
97 - copy_libs ${f}
98 - strip -R .comment -R .note ${clst_root_path}/${f} > /dev/null 2>&1
99 - elif [ -h ${f} ]
100 - then
101 - copy_symlink ${f}
102 - fi
103 -}
104 -
105 create_handbook_icon() {
106 # This function creates a local icon to the Gentoo Handbook
107 echo "[Desktop Entry]