首页 | 我和企鹅 | 软件相关 | 乱七八糟 | 相册 | 留言 | 登陆 | 注册
3上一篇 (转贴)娶了四个妻子之后下一篇 今天买了第一个手机:NOKIA 31204
[更新]中文portage同步脚本:glc_sync
by xiaosuo | 软件相关 2004年11月20日23:36星期六
处理了本地中文portage的目录可能不是portage的情形,将配置独立出来到/etc/glc.conf
配置文件如下:
代码

###
###the glc portage config file
###

###the glc portage directory that you have set in /etc/make.conf
###WARNING:NO space near the "="

GLCPORTAGE=/usr/local/portage

警告:等号两边不要有空格。
glc_sync脚本下载
glc_sync脚本源码:
代码

#!/bin/bash
###
### sync with the chinese portages
###

source /etc/glc.conf
if [ -z ${ GLCPORTAGE } ]
then
       echo "!!!GLCPORTAGE is empty,so use the default value"
       GLCPORTAGE=/usr/local/portage
fi

TMPDIR=/tmp
PORTAGEDIR=${ GLCPORTAGE%/* }
PORTAGE=${ GLCPORTAGE##*/ }
# reset CTRL+C signal
trap "clean_and_exit" 2

function clean_and_exit ()
{
       printf "\n!!!Received KILL signal, NOW exit\n"
       rm -f ${ TMPDIR }/portage.tar.gz
       rm -rf ${ TMPDIR }/portage
       exit
}

if [ `whoami` != "root" ]
then
       echo "!!!Sorry, you need to be root to do this"
       exit
fi

#the download loop
#if something went wrong, retry
while :
do
       echo "Start downloading the glc snapshot...."
       wget http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar -O ${ TMPDIR }/portage.tar.gz

       if [ $? -ne 0 ]
       then
               echo "!!!Something went wrong when downloading"
               rm -f ${ TMPDIR }/portage.tar.gz
               echo "Now retry to download"
               continue
       fi

       echo "Download successfully"

       echo "Extracting files..."
       rm -rf ${ TMPDIR }/portage
       tar zxvf ${ TMPDIR }/portage.tar.gz -C ${ TMPDIR }

       if [ $? -ne 0 ]
       then
               echo "!!!Something went wrong when extracting"
               echo "Now retry to download"
               rm -f ${ TMPDIR }/portage.tar.gz
               continue
       fi

       #download successfully
       break
done

rm -rf ${ PORTAGEDIR }/${ PORTAGE }
mv ${ TMPDIR }/portage ${ PORTAGEDIR }/${ PORTAGE }

echo "Removing the temp file..."
rm -f ${ TMPDIR }/portage.tar.gz

echo "Sync completed successfully, enjoy!"
字体:
评论(0) | 引用(0) | 阅读18次

 
提示:  
此文还没有评论。
称呼:    登陆   注册
    不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
提交时自动将内容复制到剪贴板

 
快考试了,好好复习,少上网!
点击查看我的个人信息
xiaosuo
日志: 24
评论: 7
到访: 579 [统计]
今日: 2
用户: 3 [列表]
在线: 1
342006 - 0534
 123456
78910111213
14151617181920
21222324252627
28293031   
最新日志
· 无题 (2005-4-30)
· 疲惫的两天 (2005-4-17)
· 修正d4x的中文显示 (2004-12-31)
· 圣诞节 (2004-12-25)
· glc系列脚本 (2004-12-23)
· 生日 (2004-12-9)
· 联谊宿舍来看我们。 (2004-12-5)
· 无题 (2004-12-4)
· 沉痛悼念陈省身先生! (2004-12-3)
· [转贴]一个北大才子的失... (2004-12-2)
最新评论
· ft,昨天到注意到dow... (2005-1-3)
· 谢谢夸奖,我会继续努力的... (2004-12-23)
· 超好啊!在FC3安装,执... (2004-12-23)
· 当然是转贴了。<b... (2004-11-12)
· 是你自己写的吗?有点长,... (2004-11-12)
· 歌词路径就是你存放lrc... (2004-11-7)
· 请问怎样配置歌词路径和歌... (2004-11-7)
· 模板是不错的,就是很多人... (2004-10-25)
· 呵呵,不错的模板,稍微修... (2004-10-25)

搜索
高级
归档
友情链接
bob blog
黄嘴企鹅讨论区
gentoo linux
gentoo 中文社区
linux 伊甸园
linux 公社
maigc linux
我的另一个主页
我要安家
小企鹅输入法
lumaqq
openq
linux kernel
gnu
简体中文组
linux 源码
代码熔炉
freshmeat
linux packages
中文freebsd用户组
中文freebsd工程 (繁)
lucida's linux patch set
sunmoon1997的主页
杂项
Get RSS Feed (Version 1.0) Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3) 编码:  UTF-8
Creative Commons Powered by Bo-Blog V1.7.0108.2

 
5 reads, 2 writes, processed in 0.1496989s, Gzip enabled