|
1.glc_list:
glc_list
查询glc的所有ebuild。
glc_list glc
查询glc自己的(官方没有的build)
glc_list new
glc没有升级的ebuild或者是缺少旧的build版本
glc_list old
过期的需要删除的glc ebuild
glc_list package1 package2 .....
列出package1 , package2的所有版本的ebuild
2.glc_sync_kw
因为glc cvs可能没有及时的更改ebuild的keywords,用这个脚本可以实现和官方的ebuild同步。
glc_sync_kw
同步所有的ebuild
glc_sync_kw [package list]
同步制定的ebuild。
[PHP]xiaosuo@center glc $ cat glc_sync_kw
#!/bin/bash
###
###sync KEYWORDS with the official portage
###
source /etc/glc.conf
if [ X${PORTAGE} = X ]
then
PORTAGE="/usr/portage"
fi
function re_sync_kw()
{
local ebuild
local glcebuild
local keywords
local glckeywords
while read glcebuild
do
ebuild=${glcebuild/${GLCPORTAGE}/${PORTAGE}}
if [ -f $ebuild ]
then
keywords=`grep ^KEYWORDS $ebuild`
glckeywords=`grep ^KEYWORDS $glcebuild`
if [ "X$glckeywords" = "X" ]
then
echo "KEYWORDS of $glcebuild not defined"
fi
if [ "X$keywords" = "X" ]
then
echo "KEYWORDS of $ebuild not defined"
fi
if [[ X$keywords != X$glckeywords ]]
then
echo $glcebuild
sed -i "s/^KEYWORDS.*$/$keywords/" $glcebuild
fi
fi
done
}
if [ $# -eq 0 ]
then
find ${GLCPORTAGE} -name "*.ebuild" -maxdepth 3 -mindepth 3 \
| re_sync_kw
else
for ebuild in $@
do
find ${GLCPORTAGE} -name "$ebuild-[0-9]*.ebuild" -maxdepth 3 -mindepth 3 \
| re_sync_kw
done
fi[/PHP]
- xiaosuo@center glc $ cat glc_list
- #!/bin/bash
- ###
- ###list the glc portage
- ###
- source /etc/glc.conf
- if [ X${PORTAGE} = X ]
- then
- PORTAGE="/usr/portage"
- fi
- if [ -z ${GLCPORTAGE} ]
- then
- echo /etc/glc.conf need to be configured
- exit
- fi
- #list the glc ebuilds not include in official
- function list_glc_ebuilds()
- {
- local ebuild
- while read ebuild
- do
- ebuild=${ebuild/${GLCPORTAGE}/${PORTAGE}}
- if [ ! -d $ebuild ]
- then
- echo ${ebuild##*/}
- fi
- done
- }
- #list the ebuilds not include in official
- #old ? newer ?
- function list_old_ebuilds()
- {
- local ebuild
- local ebuildpath
- while read ebuild_orig
- do
- ebuild=${ebuild_orig/${GLCPORTAGE}/${PORTAGE}}
- ebuildpath=${ebuild%/*}
- if [ -d $ebuildpath ]
- then
- if [ ! -f $ebuild ]
- then
- echo ${ebuild_orig}
- fi
- fi
- done
- }
- #list the ebuilds not include in glc portage
- #update ? not need glc ?
- function list_new_ebuilds()
- {
- local ebuild
- local ebuildpath
- while read ebuild_orig
- do
- ebuildpath=${ebuild_orig/${GLCPORTAGE}/${PORTAGE}}
- if [ -d $ebuildpath ]
- then
- for ebuild in $ebuildpath/*.ebuild
- do
- ebuild=${ebuild/${PORTAGE}/${GLCPORTAGE}}
- if [ ! -f $ebuild ]
- then
- echo $ebuild
- fi
- done
- fi
- done
- }
- #start this scripts
- if [ $# -gt 0 ]
- then
- if [ $1 = "glc" ]
- then
- find ${GLCPORTAGE} -type d -maxdepth 2 -mindepth 2 \
- | list_glc_ebuilds
- elif [ $1 = "old" ]
- then
- find ${GLCPORTAGE} -name "*.ebuild" -maxdepth 3 -mindepth 3 \
- | list_old_ebuilds
- elif [ $1 = "new" ]
- then
- find ${GLCPORTAGE} -type d -maxdepth 2 -mindepth 2 \
- | list_new_ebuilds
- else
- for ebuild in $*
- do
- find ${GLCPORTAGE} -name "$ebuild-[0-9]*.ebuild" -maxdepth 3 -mindepth 3 -printf "%f\n"
- done
- fi
- else
- find ${GLCPORTAGE} -type d -maxdepth 2 -mindepth 2 -printf "%f\n"
- fi
复制代码 |
|