LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4136|回复: 15

中文 portage CVS 和更新方法.

[复制链接]
发表于 2004-11-13 14:52:21 | 显示全部楼层 |阅读模式
中文 portage CVS & 下载地址:

http://www.magiclinux.org/cgi-bin/viewcvs.cgi/
http://www.magiclinux.org/cgi-bi ... age.tar.gz?view=tar

小锁兄的下载脚本:
cat glc_sync
  1. #!/bin/bash
  2. ###
  3. ### sync with the chinese portages
  4. ###

  5. WORKDIR=.
  6. PORTAGEDIR=/usr/local

  7. if [ `whoami` != "root" ]
  8. then
  9.         echo "!!!You are not root"
  10.         exit
  11. fi

  12. echo "Begin download the portage"
  13. wget [url]http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar[/url] -O ${WORKDIR}/portage.tar.gz

  14. if [ $? -ne 0 ]
  15. then
  16.         echo "!!!Some error happend when downloading"
  17.         exit
  18. fi

  19. echo "Download successed"

  20. echo "Remove the old portage"
  21. rm -rf ${PORTAGEDIR}/portage
  22. echo "Extract the portage file"
  23. tar zxvf ${WORKDIR}/portage.tar.gz -C ${PORTAGEDIR}

  24. if [ $? -ne 0 ]
  25. then
  26.         echo "!!!Some error happend when extracting"
  27.         exit
  28. fi

  29. echo "Clear the temp file"
  30. rm -f ${WORKDIR}/portage.tar.gz

  31. echo "All successed Enjoy it"
复制代码
发表于 2004-11-13 16:07:19 | 显示全部楼层
喜欢把中文portage摆至/usr/local/glc的人可以使用以下的脚本,当然首先你得:

# mkdir -p /usr/local/glc

并在make.conf里加上这样一行:

PORTDIR_OVERLAY="/usr/local/glc /usr/local/portage"

只是将小锁兄的下载脚本稍作了点修改: ;)
# cat /usr/sbin/glc-sync
  1. #!/bin/bash
  2. ###
  3. ### sync with the chinese portages
  4. ###

  5. WORKDIR=.
  6. PORTAGEDIR=/usr/local/glc

  7. if [ `whoami` != "root" ]
  8. then
  9.         echo "!!Sorry dude, you need to be root to do this!"
  10.         exit
  11. fi

  12. echo "Start downloading the glc snapshot"
  13. wget http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar -O ${WORKDIR}/portage.tar.gz

  14. if [ $? -ne 0 ]
  15. then
  16.         echo "!!Oho! Something went wrong with the download!"
  17.         exit
  18. fi

  19. echo "Download successful!"

  20. echo "Removing the old snapshot..."
  21. rm -rf ${PORTAGEDIR}/portage
  22. echo "Extracting files..."
  23. tar zxvf ${WORKDIR}/portage.tar.gz -C ${PORTAGEDIR}
  24. mv ${PORTAGEDIR}/portage/* ${PORTAGEDIR}
  25. rmdir ${PORTAGEDIR}/portage

  26. if [ $? -ne 0 ]
  27. then
  28.         echo "!!!Something went wrong in extracting files!"
  29.         exit
  30. fi

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

  33. echo "Sync completed successfully, enjoy!"
复制代码
发表于 2004-11-13 17:44:10 | 显示全部楼层
好,日月教主对版民的要求反应很快啊,赞一下!:thank
发表于 2004-11-13 18:35:38 | 显示全部楼层
更新一下脚本:
主要处理了CTRL+C改变了portage的下载目录
放置出现垃圾:

  1. #!/bin/bash
  2. ###
  3. ### sync with the chinese portages
  4. ###

  5. WORKDIR=/tmp
  6. PORTAGEDIR=/usr/local
  7. # reset CTRL+C signal
  8. trap "clean_and_exit" 2

  9. function clean_and_exit ()
  10. {
  11.         printf "\nReceived KILL signal NOW exit\n"
  12.         rm -f ${WORKDIR}/portage.tar.gz
  13.         exit
  14. }

  15. if [ `whoami` != "root" ]
  16. then
  17.         echo "!!!You are not root"
  18.         exit
  19. fi

  20. echo "Begin download the portage"
  21. wget http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar -O ${WORKDIR}/portage.tar.gz

  22. if [ $? -ne 0 ]
  23. then
  24.         echo "!!!Some error happend when downloading"
  25.         rm -f ${WORKDIR}/portage.tar.gz
  26.         exit
  27. fi

  28. echo "Download successed"

  29. echo "Remove the old portage"
  30. rm -rf ${PORTAGEDIR}/portage
  31. echo "Extract the portage file"
  32. tar zxvf ${WORKDIR}/portage.tar.gz -C ${PORTAGEDIR}

  33. if [ $? -ne 0 ]
  34. then
  35.         echo "!!!Some error happend when extracting"
  36.         rm -f ${WORKDIR}/portage.tar.gz
  37.         exit
  38. fi

  39. echo "Clear the temp file"
  40. rm -f ${WORKDIR}/portage.tar.gz

  41. echo "All successed Enjoy it"
复制代码
发表于 2004-11-14 13:45:07 | 显示全部楼层
最初由 Fleta 发表
喜欢把中文portage摆至/usr/local/glc的人可以使用以下的脚本,当然首先你得:

# mkdir -p /usr/local/glc

并在make.conf里加上这样一行:

PORTDIR_OVERLAY="/usr/local/glc /usr/local/portage"

只是将小锁兄的下载脚本稍作了点修改: ;)
# cat /usr/sbin/glc-sync

这个好!再也不用人手去做一次移动了。
发表于 2004-11-14 14:10:10 | 显示全部楼层
建议将这个脚本也做成一个ebuild的包。放到中文portage中。

以后有什么变化都可以更新升级了。

发表于 2004-11-14 18:04:48 | 显示全部楼层
这个建议好。
发表于 2004-11-16 12:18:22 | 显示全部楼层
目录为/usr/local/glc的修订版
  1. #!/bin/bash
  2. ###
  3. ### sync with the chinese portages
  4. ###

  5. WORKDIR=/tmp
  6. PORTAGEDIR=/usr/local/glc

  7. # reset CTRL+C signal
  8. trap "clean_and_exit" 2

  9. function clean_and_exit ()
  10. {
  11.         printf " ....Received KILL signal, NOW exit!!
  12. "
  13.         rm -f ${WORKDIR}/portage.tar.gz
  14.         exit
  15. }

  16. if [ `whoami` != "root" ]
  17. then
  18.         echo "....Sorry dude, you need to be root to do this!"
  19.         exit
  20. fi

  21. echo "Start downloading the glc snapshot...."
  22. wget http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar -O ${WORKDIR}/portage.tar.gz

  23. if [ $? -ne 0 ]
  24. then
  25.         echo "....Oho! Something went wrong with the download!"
  26.         exit
  27. fi

  28. echo "Download successful!"

  29. echo "Removing the old snapshot..."
  30. rm -rf ${PORTAGEDIR}/*
  31. echo "Extracting files..."
  32. tar zxvf ${WORKDIR}/portage.tar.gz -C ${PORTAGEDIR}
  33. mv ${PORTAGEDIR}/portage/* ${PORTAGEDIR}
  34. rmdir ${PORTAGEDIR}/portage

  35. if [ $? -ne 0 ]
  36. then
  37.         echo "....Something went wrong in extracting files!"
  38.         exit
  39. fi

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

  42. echo "Sync completed successfully, enjoy!"
复制代码
发表于 2004-11-18 11:56:57 | 显示全部楼层
顶!
发表于 2005-1-14 10:18:01 | 显示全部楼层
中文portage多少时间更新一次?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表