Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 71963 Details for
Bug 111299
scan and Update ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
update-ebuild.sh
update-ebuild.sh (text/plain), 4.46 KB, created by
INODE64 Sistemas
on 2005-11-02 15:17:51 UTC
(
hide
)
Description:
update-ebuild.sh
Filename:
MIME Type:
Creator:
INODE64 Sistemas
Created:
2005-11-02 15:17:51 UTC
Size:
4.46 KB
patch
obsolete
>#!/bin/sh > >. /etc/make.conf >. /etc/make.globals > >check() { > cat $1|grep -v ".*#.*\|^KEYWORDS\|^DESCRIPTION\|^IUSE\|^SRC_URI\|.\|HOMEPAGE"|md5sum >} > >function get_config() { > item=$1 > > # First strip off comment lines, then grab the configuration > # item. If there's more than one of the same configuration item, > # then allow the last setting to take precedence. > cut -d'#' -f1-1 /etc/etc-update.conf | \ > sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d' >} > >scan() { > echo -e "${GR}Scanning Ebuild files...${NO}" > rm -rf ${TMP}/files > /dev/null 2>&1 > mkdir ${TMP}/files || die "Failed mkdir command!" 1 > count=0 > input=0 > > cd /var/db/pkg > > for FILE in `find -type f -name *.ebuild` > do > diff1=`check $FILE` > FILE1=`echo $FILE|sed -n 's/\.\/\(.*\)\/\(.*\)-[0-9].*\/\(.*\)/\1\/\2\/\3/p'` > > for PORTAGE in $PORTDIR $PORTDIR_OVERLAY > do > if [ -e $PORTAGE/$FILE1 ] > then > diff2=`check $PORTAGE/$FILE1` > if [ "$diff1" != "$diff2" ] > then > count=${count}+1 > echo "/var/db/pkg/`echo $FILE|cut -b3-`" > ${TMP}/files/${count} > echo "$PORTAGE/$FILE1" >> ${TMP}/files/${count} > fi > fi > done > done >} > >function sel_file() { > local -i isfirst=0 > until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ] || [ ${input} == -5 ]; do > for file in `ls ${TMP}/files|sort -n`; do > if (( ${isfirst} == 0 )); then > isfirst=${file} > fi > echo -n "${file}${PAR} " > tail -n1 ${TMP}/files/${file} > done > ${TMP}/menuitems > > if (( ${mode} == 0 )); then > echo "The following is the list of ebuilds which need updating" > else > local my_title="Please select a ebuild to update" > fi > > if (( ${mode} == 0 )); then > cat ${TMP}/menuitems > echo "Please select a ebuild to edit by entering the corresponding number." > echo " (don't use -5 if you're unsure what to do)" > echo -n " (-1 to exit) (-5 to run emerge): " > read input > else > dialog --title "${title}" --menu "${my_title}" \ > 0 0 0 `echo "-1 Exit";echo "-5 Emerge";cat ${TMP}/menuitems` \ > 2> ${TMP}/input > input=`cat ${TMP}/input` > fi > if (( ${input} == -5 )); then > local REBUILD_LIST="emerge -v --nodeps --oneshot" > for file in `ls ${TMP}/files|sort -n`; do > REBUILD_LIST="$REBUILD_LIST =`head -n1 ${TMP}/files/${file}|sed -n 's/.*\/\(.*\)\/.*\/\(.*\)\.ebuild/\1\/\2/p'`" > done > echo > echo -e "${GR}All prepared. Starting rebuild...${NO}" > echo "$REBUILD_LIST" > for i in . . . . . . . . . . ; do > echo -n -e '\a.' > sleep 1 > done > echo > > $REBUILD_LIST > exit > fi > if (( ${input} == 0 )); then > input=${isfirst} > fi > done >} > >function do_file() { > > file=`tail -n1 ${TMP}/files/${input}` > ofile=`head -n1 ${TMP}/files/${input}` > > local -i my_input=0 > > until (( ${my_input} == 1 || ${my_input} == 2 )); do > showdiffcmd=$(echo "${diff_command}" | > sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:") > > ( > echo -e "${BR}Showing differences between ${ofile} and ${file}${NO}" > ${showdiffcmd} > ) | ${pager} > > if [ -L "${file}" ]; then > echo > echo "-------------------------------------------------------------" > echo "NOTE: File is a symlink to another file. REPLACE recommended." > echo " The original file may simply have moved. Please review." > echo "-------------------------------------------------------------" > echo > fi > echo -n "1) to ignore this update >2) Accept this update >3) Show differences again >Please select from the menu above: " > read my_input > > done > > if (( ${my_input} == 1 )); then > rm ${TMP}/files/${input} > count=${count}-1 > fi > > input=0 >} > >function die() { > trap "" term > trap "" kill > echo "Exiting: ${1}" > rm -rf ${TMP} > exit ${2} >} > > ># ># Run the script ># >scriptname=`basename $0` > >trap die term > >TMP=/tmp/$$ >rm -rf ${TMP} 2> /dev/null >mkdir ${TMP} || die "failed mkdir command!" 1 > >pager=`get_config pager` >diff_command=`get_config diff_command` >declare -i mode=`get_config mode` >[ -z ${mode} ] && mode=0 >[ -z "${pager}" ] && pager="cat" > >if (( ${mode} == 0 )); then > PAR=")" >else > PAR="" >fi > >NO="\x1b[0;0m" >BR="\x1b[0;01m" >CY="\x1b[36;01m" >GR="\x1b[32;01m" >RD="\x1b[31;01m" >YL="\x1b[33;01m" >BL="\x1b[34;01m" > >declare -i count=0 >declare -i input=0 >declare title="Gentoolkit's update-ebuild tool!" > >scan > >until (( ${input} == -1 )); do > if (( ${count} == 0 )); then > die "Nothing left to do; exiting. :)" 0 > fi > sel_file > if (( ${input} != -1 )); then > do_file > fi >done > >die "User termination!" 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 111299
: 71963