LinuxSir.cn,穿越时空的Linuxsir!

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

使用layman来同步管理你远程的git,svn仓库的方法[分享]

[复制链接]
发表于 2009-3-6 17:40:30 | 显示全部楼层 |阅读模式
我BLOG上的地址 http://hi.baidu.com/3444542/blog ... c8a7dbfc1f10e4.html
linuxsir gentoo 版上的地址 http://www.linuxsir.cn/bbs/thread345898.html
cat /etc/layman/oahong-gentoo.xml

  1. <?xml version="1.0" ?>
  2. <layman>

  3.         <overlay
  4.                 type = "git"
  5.                 src = "git://gitorious.org/exherbo-cn/oahong-gentoo.git"
  6.                 contact = "oahong@gmail.com"
  7.                 status = "unofficial"
  8.                 name = "oahong-gentoo">

  9.                 <link>
  10.                     //http://www.gitorious.org/projects/exherbo-cn
  11.                 </link>

  12.                 <description>
  13.                         A collection of useful ebuilds from scratch.
  14.                 </description>
  15.         </overlay>

  16. </layman>
复制代码

rsync 版本 http://gentoo.o0o.nu/sectools.xml 这里可以下载

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <layman>
  3.   <overlay type="rsync" src="rsync://gentoo.o0o.nu/sectools" contact="anton.bugs.gm@il.com" name="sectools">

  4.     <link>
  5.       http://gentoo.o0o.nu/portage/
  6.     </link>
  7.     <description>Gentoo security tools overlay</description>

  8.   </overlay>
  9. </layman>
复制代码


svn版本

  1. <layman>
  2.   <overlay name = "betelgeuse"  status = "official"
  3.   contact = "betelgeuse@gentoo.org"
  4.   src = "https://overlays.gentoo.org/svn/dev/betelgeuse" type = "svn">
  5.   <link>https://overlays.gentoo.org/svn/dev/betelgeuse</link>
  6.   <description>Betelgeuse's developer overlay</description>
  7.   </overlay>

复制代码


简单的几个地方解释一下

  1.                type = "git"    <<<---- 这里是指远程仓库的类型,有svn, git, rsync, hg等
  2.                 src = "git://gitorious.org/exherbo-cn/oahong-gentoo.git"   <<<--- 这个是源地址很重要,会用git的朋友可能一眼就看明白了,比如在github把那个地址抄下来就是了
  3.                 contact = "oahong@gmail.com"   << --- 联系人
  4.                 status = "unofficial"                   << ---  非官方仓库 (进官方了就不用自己弄了,嘿嘿)
  5.                 name = "oahong-gentoo">          << --- overlay的名字,即是  layman -a  overlay_name 要用到的,如果要空格的话layman -a " abcd efgh " 括起来,不过不建议这么用
复制代码


cat /etc/layman/layman.cfg
------------------------------------------------------------

  1. [MAIN]

  2. #-----------------------------------------------------------
  3. # Defines the directory where overlays should be installed

  4. storage   : /usr/local/portage/layman

  5. #-----------------------------------------------------------
  6. # Remote overlay lists will be stored here
  7. # layman will append _md5(url).xml to each filename

  8. cache     : %(storage)s/cache

  9. #-----------------------------------------------------------
  10. # The list of locally installed overlays

  11. local_list: %(storage)s/overlays.xml

  12. #-----------------------------------------------------------
  13. # Path to the make.conf file that should be modified by
  14. # layman

  15. make_conf : %(storage)s/make.conf

  16. #-----------------------------------------------------------
  17. # URLs of the remote lists of overlays (one per line) or
  18. # local overlay definitions
  19. #
  20. #overlays : http://www.gentoo.org/proj/en/overlays/layman-global.txt
  21. #            http://dev.gentoo.org/~wrobel/layman/global-overlays.xml
  22. #            http://mydomain.org/my-layman-list.xml
  23. #            file:///usr/portage/local/layman/my-list.xml

  24. overlays : http://www.gentoo.org/proj/en/overlays/layman-global.txt
  25.             http://github.com/joshuar/ephemeral-gentoo-overlay/tree/master%2Foverlay.xml?raw=true
  26.             http://gentoo.o0o.nu/sectools.xml
  27.             file:///etc/layman/oahong-gentoo.xml
  28. #layman -f
  29. #layman -a xxx

  30. #-----------------------------------------------------------
  31. # Proxy support
  32. #
  33. #proxy : http://[user:pass@]www.my-proxy.org:3128

  34. #-----------------------------------------------------------
  35. # Strict checking of overlay definitions
  36. #
  37. # Set either to "yes" or "no". If "no" layman will issue
  38. # warnings if an overlay definition is missing either
  39. # description or contact information.
  40. #
  41. nocheck : yes

  42. #-----------------------------------------------------------
  43. # Umask settings
  44. #
  45. # layman should usually work with a umask of 0022. You should
  46. # only change this setting if you are absolutely certain that
  47. # you know what you are doing.
  48. #
  49. #umask : 0022
复制代码

------------------------------------------------------------

layman -f
layman -a oahong-gentoo
cd /usr/local/portage/layman 去ls一下
以后layman -S 就帮忙把它给同步了


  1. 在/etc/layman/layman.cfg文件中可以找到以下的备注信息
  2. #overlays : http://www.gentoo.org/proj/en/overlays/layman-global.txt
  3. #            http://dev.gentoo.org/~wrobel/layman/global-overlays.xml
  4. #            http://mydomain.org/my-layman-list.xml
  5. #            file:///usr/portage/local/layman/my-list.xml   <<---- 因为拷到本地来使用,所以就选它了
复制代码


其实xml看了一下英文也没啥好解释的,参考http://www.gentoo.org/proj/en/overlays/layman-global.txt 抄一个相同类型的照猫画虎就成了
同步到layman的目录中,我一般是不相接加入 make.conf 里,只是建一个本地的overlay,因为会跟现在有一些仓库冲突,然后软链接过来使用
嘿嘿,很简单了吧,以后自己建一个git的仓库就可以用上这招了,让gentoo来得更方便一点吧
PS: 要是能加注彩色就棒了,目前只会 [ code ]
发表于 2009-3-7 00:43:10 | 显示全部楼层
很好,很好!
回复 支持 反对

使用道具 举报

发表于 2009-3-9 09:12:54 | 显示全部楼层
好贴支持!回去就搞
回复 支持 反对

使用道具 举报

发表于 2009-3-9 09:36:22 | 显示全部楼层
我觉得这个做法好奇怪。。。。
update 那几个 repo , 写个脚本也就2分钟的事情。。。何必。。
回复 支持 反对

使用道具 举报

发表于 2009-3-9 12:57:10 | 显示全部楼层
有时间试一下
回复 支持 反对

使用道具 举报

发表于 2009-3-9 13:46:42 | 显示全部楼层
支持一下,自己用不上,但是了解了 !
回复 支持 反对

使用道具 举报

发表于 2010-1-6 18:55:09 | 显示全部楼层
很好啊,收藏了
回复 支持 反对

使用道具 举报

发表于 2010-1-7 20:23:27 | 显示全部楼层
很好,使用了.
回复 支持 反对

使用道具 举报

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

本版积分规则

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