Lines 10-22
Link Here
|
10 |
#Get PORTDIR and PORTDIR_OVERLAY from portage |
10 |
#Get PORTDIR and PORTDIR_OVERLAY from portage |
11 |
PORTDIR_OVERLAY="$(/usr/lib/portage/bin/portageq portdir_overlay)" |
11 |
PORTDIR_OVERLAY="$(/usr/lib/portage/bin/portageq portdir_overlay)" |
12 |
PORTDIR="$(/usr/lib/portage/bin/portageq portdir)" |
12 |
PORTDIR="$(/usr/lib/portage/bin/portageq portdir)" |
|
|
13 |
PACKAGE_UNMASK="$(/usr/lib/portage/bin/portageq package_unmask)" |
13 |
|
14 |
|
14 |
rm -rf ${tmp} > /dev/null 2>&1 |
15 |
rm -rf ${tmp} > /dev/null 2>&1 |
15 |
mkdir ${tmp} > /dev/null 2>&1 |
16 |
mkdir ${tmp} > /dev/null 2>&1 |
16 |
|
17 |
|
17 |
declare -i i |
18 |
declare -i i |
18 |
|
19 |
|
19 |
set -- `getopt -n ${PROG} -o N,R,U,I,v,q,C,h -l needed,removed,unneeded,interactive,verbose,quiet,nocolor,help -- ${*/ --/};[ $? != 0 ] && echo "y"` |
20 |
set -- `getopt -n ${PROG} -o N,R,U,I,A,v,q,C,h -l needed,removed,unneeded,interactive,automatic,verbose,quiet,nocolor,help -- ${*/ --/};[ $? != 0 ] && echo "y"` |
20 |
|
21 |
|
21 |
while [ ${#} -gt 0 ] |
22 |
while [ ${#} -gt 0 ] |
22 |
do |
23 |
do |
Lines 24-29
Link Here
|
24 |
shift |
25 |
shift |
25 |
case "${a}" in |
26 |
case "${a}" in |
26 |
|
27 |
|
|
|
28 |
-A|--automatic) |
29 |
automatic=y |
30 |
;; |
31 |
|
27 |
-I|--interactive) |
32 |
-I|--interactive) |
28 |
interactive=y |
33 |
interactive=y |
29 |
;; |
34 |
;; |
Lines 113-118
Link Here
|
113 |
${GR}-R, --removed${NO} display installed packages not in portage (${YL}yellow${NO}) |
118 |
${GR}-R, --removed${NO} display installed packages not in portage (${YL}yellow${NO}) |
114 |
|
119 |
|
115 |
${GR}-I, --interactive${NO} interactively modify world file before proceeding |
120 |
${GR}-I, --interactive${NO} interactively modify world file before proceeding |
|
|
121 |
${GR}-A, --automatic${NO} modify the world file grepping out /etc/portage/packaces.unmask |
116 |
${GR}-C, --nocolor${NO} output without color, if necessary, package types are |
122 |
${GR}-C, --nocolor${NO} output without color, if necessary, package types are |
117 |
noted with ${GR}U, N${NO} and ${GR}R${NO} respectively |
123 |
noted with ${GR}U, N${NO} and ${GR}R${NO} respectively |
118 |
${GR}-v, --verbose${NO} be more verbose |
124 |
${GR}-v, --verbose${NO} be more verbose |
Lines 164-169
Link Here
|
164 |
|
170 |
|
165 |
if [ ${interactive} ]; then |
171 |
if [ ${interactive} ]; then |
166 |
${EDITOR} ${tmp}/world |
172 |
${EDITOR} ${tmp}/world |
|
|
173 |
elif [ ${automatic} ]; then |
174 |
egrep -v "`cat /etc/portage/package.unmask | xargs | sed -e 's/ /|/g'`" /var/cache/edb/world > ${tmp}/world.new && mv ${tmp}/world.new ${tmp}/world |
167 |
fi |
175 |
fi |
168 |
|
176 |
|
169 |
#Retrieve world packages and dependencies and add to image. |
177 |
#Retrieve world packages and dependencies and add to image. |