1 |
commit: 3762c6fa6c5c4214698512376fc10e0581956c6e |
2 |
Author: Yuta SATOH <nigoro.dev <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Jan 2 13:39:07 2018 +0000 |
4 |
Commit: Yuta SATOH <nigoro <AT> gentoo <DOT> gr <DOT> jp> |
5 |
CommitDate: Tue Jan 2 13:39:07 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-bsd.git/commit/?id=3762c6fa |
7 |
|
8 |
automatic_updater.sh: add the missing code to upgrade correctly. |
9 |
|
10 |
scripts/automatic_updater.sh | 36 ++++++++++++++++++++++++++++++------ |
11 |
1 file changed, 30 insertions(+), 6 deletions(-) |
12 |
|
13 |
diff --git a/scripts/automatic_updater.sh b/scripts/automatic_updater.sh |
14 |
index 2afa6f6..58e8ced 100755 |
15 |
--- a/scripts/automatic_updater.sh |
16 |
+++ b/scripts/automatic_updater.sh |
17 |
@@ -42,7 +42,7 @@ move_makeconf(){ |
18 |
} |
19 |
|
20 |
update_portage(){ |
21 |
- local dl_portage_ver="2.3.8" |
22 |
+ local dl_portage_ver="2.3.6" |
23 |
|
24 |
echo "Updating the sys-apps/portage with a manual method..." |
25 |
|
26 |
@@ -63,8 +63,8 @@ update_portage(){ |
27 |
eselect python set 1 |
28 |
} |
29 |
|
30 |
-update_bmake(){ |
31 |
- echo "Updating the bmake..." |
32 |
+update_bmake_command(){ |
33 |
+ echo "Updating bmake..." |
34 |
|
35 |
[[ -e /usr/local/bin/make ]] && exit 1 |
36 |
|
37 |
@@ -73,15 +73,32 @@ update_bmake(){ |
38 |
make |
39 |
cp -a make /usr/local/bin/ |
40 |
cd "${PORTDIR}/sys-freebsd/freebsd-ubin" && ebuild $(ls -1 freebsd-ubin-${TARGETVER}*.ebuild | tail -n 1) clean |
41 |
+ |
42 |
+ env-update |
43 |
+ source /etc/profile |
44 |
+} |
45 |
+ |
46 |
+update_config_command(){ |
47 |
+ echo "Updating config..." |
48 |
+ |
49 |
+ [[ -e /usr/local/sbin/config ]] && exit 1 |
50 |
+ |
51 |
+ cd "${PORTDIR}/sys-freebsd/freebsd-usbin" && ebuild $(ls -1 freebsd-usbin-${TARGETVER}*.ebuild | tail -n 1) prepare |
52 |
+ cd "${PORTAGE_TMPDIR}"/portage/sys-freebsd/freebsd-usbin-${TARGETVER}*/work/usr.sbin/config |
53 |
+ /usr/local/bin/make -m /usr/share/mk/system |
54 |
+ cp -a config /usr/local/sbin/ |
55 |
+ cd "${PORTDIR}/sys-freebsd/freebsd-usbin" && ebuild $(ls -1 freebsd-usbin-${TARGETVER}*.ebuild | tail -n 1) clean |
56 |
} |
57 |
|
58 |
update_minimal(){ |
59 |
echo "Updating the minimal packages to upgrade the Gentoo/FreeBSD..." |
60 |
|
61 |
emerge -u sys-devel/gcc-config --exclude sys-freebsd/* |
62 |
- update_bmake |
63 |
+ update_bmake_command |
64 |
|
65 |
emerge --nodeps sys-freebsd/freebsd-mk-defs |
66 |
+ update_config_command |
67 |
+ |
68 |
emerge -u '<sys-apps/findutils-4.6' --exclude sys-freebsd/* |
69 |
emerge sys-devel/libtool --exclude sys-freebsd/* |
70 |
|
71 |
@@ -118,7 +135,8 @@ update_toolchain(){ |
72 |
|
73 |
# https://bugs.gentoo.org/629128 |
74 |
[[ ! -e /etc/portage/package.unmask ]] && mkdir -p /etc/portage/package.unmask |
75 |
- echo "sys-devel/binutils" > /etc/portage/package.unmask/binutils-oldversion |
76 |
+ echo "sys-devel/binutils" > /etc/portage/package.unmask/toolchain-oldversion |
77 |
+ echo "sys-devel/gcc" >> /etc/portage/package.unmask/toolchain-oldversion |
78 |
emerge -u '<sys-devel/binutils-2.28' --exclude sys-freebsd/* |
79 |
emerge -u sys-devel/gcc-config --exclude sys-freebsd/* |
80 |
emerge -u '<sys-devel/gcc-5.0' --exclude sys-freebsd/* --exclude sys-devel/binutils |
81 |
@@ -167,6 +185,7 @@ update_freebsd_userland(){ |
82 |
emerge freebsd-bin freebsd-lib freebsd-mk-defs freebsd-pam-modules freebsd-sbin freebsd-share freebsd-sources freebsd-ubin freebsd-usbin |
83 |
|
84 |
[[ -e /usr/local/bin/make ]] && rm /usr/local/bin/make |
85 |
+ [[ -e /usr/local/sbin/config ]] && rm /usr/local/sbin/config |
86 |
env-update |
87 |
source /etc/profile |
88 |
} |
89 |
@@ -205,7 +224,11 @@ emerge_world(){ |
90 |
emerge -C \<$(emerge -pq --nodeps sys-devel/gcc --exclude sys-freebsd/* | grep ebuild | awk '{print $4}') && : |
91 |
gcc-config $(gcc-config -l | grep "${TARGETVER}" | awk '{print $1}' | sed 's:\[::g' | sed 's:\]::g' | tail -n 1) |
92 |
source /etc/profile |
93 |
- emerge -e @world --exclude dev-perl/libintl-perl |
94 |
+ if [[ ${REMOVEPERL} -ne 0 ]] ; then |
95 |
+ emerge -e @world --exclude dev-perl/libintl-perl |
96 |
+ else |
97 |
+ emerge -e @world |
98 |
+ fi |
99 |
emerge -C dev-lang/python:3.2 && : |
100 |
emerge -C '<sys-devel/binutils-2.28.1' && : |
101 |
emerge @preserved-rebuild |
102 |
@@ -215,6 +238,7 @@ emerge_world(){ |
103 |
|
104 |
cleanup(){ |
105 |
emerge sys-devel/libtool app-admin/eselect |
106 |
+ [[ -e /etc/portage/package.unmask/toolchain-oldversion ]] && rm /etc/portage/package.unmask/toolchain-oldversion |
107 |
echo "done!" |
108 |
} |