/[gentoo-x86]/autocompile.sh
Gentoo

Contents of /autocompile.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Nov 18 09:45:50 2000 UTC (18 years, 10 months ago) by achim
Branch: MAIN
File MIME type: text/x-sh
Use this script to autocompile and merge a list of packages to ROOT

1 #!/bin/sh
2
3
4 C_NORMAL=$'\033[0m'
5 C_HILITE=$'\e[36;01m'
6 C_END=$'\e[A\e[73G'
7 C_OK=$'\e[32m'
8 C_NO=$'\e[31m'
9 PORTDIR=/portage
10
11 if [ -z "${ROOT}" ]
12 then
13 echo "ROOT not set !"
14 exit 1
15 fi
16
17 if [ -n "`ls ${ROOT}`" ]
18 then
19 echo "$C_HILITE>>>$C_NORMAL Cleaning ${ROOT}..."
20 rm -r ${ROOT}/*
21 fi
22
23 echo "$C_HILITE>>>$C_NORMAL Reading configuration..."
24 mylist=${PORTDIR}/gentoo-x86/current-packages
25
26 if [ -f "${1}" ]
27 then
28 mylist=${1}
29 fi
30
31 echo "$C_HILITE>>>$C_NORMAL Using ${mylist}"
32
33 mypackages="`grep -v "\#.*" $mylist`"
34
35 if [ -d "/tmp/portage-log" ]
36 then
37 rm -r /tmp/portage-log
38 fi
39
40 mkdir /tmp/portage-log
41
42 echo "$C_HILITE>>>$C_NORMAL Building ..."
43 for i in $mypackages
44 do
45
46 # full path
47 myd=${i/.\//$PORTDIR\/gentoo-x86\/}
48
49 # file name
50 myf="`basename $myd`"
51
52 # category
53 myc="`echo $i | sed -e "s:^\./\(.*\).*/.*/.*$:\1:"`"
54
55 # package name
56 myp=${myf%*.ebuild}
57
58 if [ -f "$myd" ]
59 then
60 echo "$C_NORMAL $myp ($myc)"
61
62 myl="/tmp/portage-log/$myc/$myp/"
63 install -d $myl
64
65 # Check dependencies
66 echo "$C_END $C_HILITE [CHECK] "
67 ebuild $myd check &> $myl/check
68 mye=$?
69 if [ $mye -ne 0 ]
70 then
71 echo "$C_END $C_NO [CHECK] "
72 echo $myd > /tmp/portage/check-failed
73 continue
74 fi
75
76 # Clean
77 echo "$C_END $C_HILITE [CLEAN] "
78 ebuild $myd clean &> $myl/clean
79 mye=$?
80 if [ $mye -ne 0 ]
81 then
82 echo "$C_END $C_NO [CLEAN] "
83 echo $myd > /tmp/portage/clean-failed
84 continue
85 fi
86
87 # Unpack
88 echo "$C_END $C_HILITE [UNPACK] "
89 ebuild $myd unpack &> $myl/unpack
90 mye=$?
91 if [ $mye -ne 0 ]
92 then
93 echo "$C_END $C_NO [UNPACK] "
94 echo $myd > /tmp/portage/unpack-failed
95 continue
96 fi
97
98 # Compile
99 echo "$C_END $C_HILITE [COMPILE]"
100 ebuild $myd compile &> $myl/compile
101 mye=$?
102 if [ $mye -ne 0 ]
103 then
104 echo "$C_END $C_NO [COMPILE]"
105 echo $myd > /tmp/portage/compile-failed
106 continue
107 fi
108
109 # Install
110 echo "$C_END $C_HILITE [INSTALL]"
111 ebuild $myd install &> $myl/install
112 mye=$?
113 if [ $mye -ne 0 ]
114 then
115 echo "$C_END $C_NO [INSTALL]"
116 echo $myd > /tmp/portage/install-failed
117 continue
118 fi
119
120 # Merge
121 echo "$C_END $C_HILITE [MERGE] "
122 ebuild $myd qmerge &> $myl/merge
123 mye=$?
124 if [ $mye -ne 0 ]
125 then
126 echo "$C_END $C_NO [MERGE] "
127 echo $myd > /tmp/portage/merge-failed
128 continue
129 fi
130
131 echo "$C_END $C_OK [OK] "
132
133 else
134 echo "!!! $myd does not exists !"
135 fi
136 done

  ViewVC Help
Powered by ViewVC 1.1.20