Showing newest posts with label foresight. Show older posts
Showing newest posts with label foresight. Show older posts

Sunday, March 7, 2010

what's good about conary

试图总结一下 conary 到底有什么独特之处... 不过我对其他的包管理不是很熟悉,所以不太好总结。

这样,以下内容基本上是这篇文章的意译。

包管理,也就是管理系统上所有其他软件的一个软件。但 conary 不只是一个包管理软件,更是一个强大的对软件系统的版本管理系统。

===========
第一个问题,如何组织软件源(repository)

在 deb/rpm 系统上,一个 repository 无非是某个服务器上的一个目录,其中存放着软件包(一些文件)。文件的命名无非就是"软件名",加上"软件版本"(当然一般还有其他部分,稍后再提)。

问题来自于文件的命名是任意的,手动的。比如有两个软件源,都提供了firefox-3.0 这个包,那么包管理就会搜索到两个"相同"的包,可能产生冲突。

而 conary 不这样处理软件源,conary 的 repository 并不是一个静态的目录,而是一个有版本的动态的分支。整个软件源都是处在版本控制下的,随着其中软件的更新,不断的向前发展,而不是像磁盘文件系统上的一个目录,新版本的文件会覆盖旧文件。

当然,conary 里面的包名字也必须有好几个部分,比如名字加版本。但这些都是由 conary 自动管理,没有手动的过程,conary 能保证两个不同的包,用户能识别出它们确实是不一样的。比如有两个 deb 的源,apt.joeschmoe.com 和 apt.joesmith.com,它们有同一个版本的 liferea,那包名可能是一样的,就会有问题,而 conary 不会遇到这个矛盾,因为,软件源的域名其实也是包名字的一部分。

如果 deb 要以域名来辨别不同的包,那只能把域名写到文件名里面,结果必然是,软件包的名字变得特别长。正因为 conary 下的“包”并不是以文件形式存在的,才能做到上边这一点。

而问题没有到此为止,一般发行版会支持多个硬件平台 (至少有 32 位或 64 位之分吧)。deb/rpm 的做法是什么?只能把 arch 写进文件名里面。结果就是这样的,liferea-1.2.2-2.el5.rf.x86_64.rpm。能看出跟 liferea-1.2.2-2.el5.rf.x86-64.rpm 的区别吗?

conary 也需要支持不用的 arch,包名字也会包含 x86, x86_64 等等。但由于 conary 的“自动管理”,默认情况下这些额外信息是被隐藏的。有时候一个简单的"liferea"就能识别一个包,有时候需要 "liferea=1.0"才能识别, 有时候需要 "liferea=foresight.rpath.org@fl:2-devel" (以区别 "liferea=foresight.rpath.org@fl:2-qa", 或者 "liferea=jesse.rpath.org@fl:2-devel"),有时候甚至需要"liferea=foresight.rpath.org@fl:2-devel/1.7.3-0.1-2",而这就是 conary 里面包的 full-name 的样子。

===========
正由于以上这些,conary 不需要复杂的 sources.list。如果你想从我的个人软件源安装 liferea,在 deb 世界里需要把我的源添加到 sources.list 里边,这样 apt 才能自动从那里查找更新。

而对于 conay, 只需要安装 liferea=jesse.rpath.org@fl:2-devel,conary 会记住这个源,以后只会从这里查找更新,即使 foresight 的官方源里面有更新的版本,也不会影响你的系统。

===========
细粒度的依赖关系

解决依赖是包管理的另一个基本作用,对于 deb/rpm 来说,依赖是定义在包的层面的,带来的一个问题是,有时候要安装某个包,需要先安装一系列的依赖,它们的体积加起来可能很大。另一个问题是,更新的时候,整个包都要重新下载,而好多时候这是不需要的,比如 man page 和一些图片,可能并没有任何变化。

conary 是在文件层次上解决依赖的,所以,一个包并不依赖于另"一个包",而是依赖某个文件的存在。conary 把包划分成几个部分,比如 :runtime, :doc, 或者 :devel,安装依赖包、更新包都是基于这个子部分的,用不到或没有变化的部分就不用下载。好处是可以节省带宽,节省硬盘空间,节省电力,节省能源...

而且这带来了另一个可能:系统可以定制得很小,能够把不需要的都删掉。比如最近我们在裁减 GNOME Developer Kit 的大小,在脚本里有这一句:

        r.removeComponents(['doc', 'supdoc', 'build-tree', 'devellib', 'devel'],
            'group-gnome-dist')

这样就把所有的文档、开发相关的文件移除了。

当然,deb 和 rpm 也能把一个包划分开 (也就是那些 -devel 包的由来)。问题是,手动。打包的开发者必须在 spec 文件里手动指明哪些文件是 liferea-doc 的,哪些是 liferea-devel 包的。但 conary 能自动完成这些,安装到 /etc 的,一般就是 :config 部分的;在 /user/share/man/ 下的,应该就是 :doc。conary 能识别出 general case 来,开发者只需要做剩下的那一点。

===========
回滚。由于整个系统都是在 conary 的版本管理之下,所以 conary 支持包管理操作的回滚。这个特性是最容易记住的,所以不细说了。

===========
给 conary 打包非常容易,所有的打包过程,都由简短的 python 脚本定义。在我看来,比 rpm 的 spec 文件清晰的多。而且像前面提到的,一般来说,开发者只处理特殊情况就行了,负担会大大减小。

===========
所以,无论对用户还是对开发者,conary 都是个不错的选择。

现在对用户存在的一个大问题呢,就是 conary 还缺少一个足够简单、但又能发挥其威力的前端,PackageKit 是当前的选择,但是还有很多的工作要做。

想进一步了解的话,请登陆 #foresight (freenode)。

Thursday, July 30, 2009

RELEASE: GNOME Developer Kit 2.27.20090727

(Yes the version looks odd :)

Thanks for Bertrand joining the development of GNOME Developer Kit, we are now trying to drive things forward, which at these days unfortunately stayed still (except refreshing packages daily) and didn't show overall progress.

So now, we are pleased to announce the first step following our plan, the 090729 version!

Our current plan is that,
* refresh all packages daily from Git; (already been doing this)
* gradually add more GNOME modules into the Dev Kit; (in action, but slow)
* release new images every week. (This is the most difficult one, e.g. this 090727 release is taken back for THREE days, half of one week.)

What the hell is GNOME Developer Kit?
====
It's a full Linux distribution, but containing _fresh_ GNOME modules. Read more at the wiki. Yes we don't and can't put as much effort as maintaining a normal distro, but sharing everything with Foresight Linux.

The Dev Kit currently tracks ~100 GNOME packages, check it out here. This release contains the newest of these packages.

How to try out?
====
It comes in various forms of images and you can use it with your favorite virtual machine (QEMU/Parallels, VirtualBox/VMWare...)or install it with an ISO. We recommend virtual images since it's quite handy. Download from here.

If you already have the Dev Kit, you can update to the newest version without reinstalling or re-downloading, one command:
sudo conary updateall

Chat with us at #foresight (FreeNode), file bug reports at Bugzilla. Your comments and help are greatly appreciated!

Tuesday, May 19, 2009

evolution won't fetch mails?

OK, the solution turns out to be trivial, (however it caused big inconvenience for me).
If your evolution didn't get mails properly, make sure it's not marking all incoming mails as 'Junk'.
For me, it's 'Edit' => 'Preferences' => 'Mail Preferences' => 'Junk' => 'Check custom headers for junk', and this custom list contains:

HeaderContains Value
X-Spam-FlagYES
X-Spam-Level*****

Days ago, evolution stopped fetching mails (gmail, pop3), but gmail's web interface is all ok. I suspected google since there happened to be rumors about google servers at that time. And I suspected evolution too, since not long ago I experienced a problme with it.

Then it turned out to be the mail filter. I installed bogofilter to fix the 'Check junk failed' problem, but the configuration somehow messed up and it thought all the mails are junk.

Maybe it's a problem of Foresight packaging?

Wednesday, April 8, 2009

Firefox search-engine plugin for Foresight packges

I always search on rpath website to see if some application is already packaged in our repository. So here is a simple plugin to accelerate this, which adds a 'Foresight Packages' search engine in Firefox's search bar.

https://addons.mozilla.org/en-US/firefox/addon/11367

It does exactly the same thing as this:

type in the address bar "http://www.rpath.org/search?type=Packages&search=package-name", then press enter.

Or, go to http://www.rpath.org/ and then do the search.

Sunday, February 22, 2009

how to solve rmake build errors

1. First, all things have a source... all errors step from one single command failing. So, locate this failing command, find the cause and find the solution.

2. You can find out where a specific file comes from, using conary q --path or conary rq --path .

3. "No package blah found. Perhaps you should add the directory containing `blah.pc'."
Missing dependencies is a common error. Usually configure uses pkg-config to check the .pc files. The default dir containing *.pc is /usr/lib/pkgconfig (or /usr/lib64). So is /usr/lib/pkgconfig/blah.pc, apply it to conary q/rq --path and solve it.

4. Other missing file errors can be solved similarly, for example missing /usr/bin/git, missing /usr/include/GL/gl.h (from #include )

5. "flex: fatal internal error, exec failed"
Using strace/ltrace, for the particular case I encountered, the error turned out to be 'GNU M4' missing. conary q --path `which m4` tells me it's m4:runtime. Done.

6. Sometimes it fails just because of Internet problems, like this one,
InternalServerError:
There was an error contacting the repository. Either the server is
configured incorrectly or the request you sent to the server was invalid.

Thursday, February 19, 2009

site for my repository

I created this google site to write about the packages I built. I will include how to install each app from my rBo personal repository.

Monday, February 16, 2009

configure a fresh-installed Foresight Linux

[update]: The following may become obsoleted. I have changed some of it.

Recently I reinstalled my Foresight, well, because the root partition was too small. 10G root is never enough for a system where I do some packaging.

With a fresh-installed Foresight, some configure is needed. The "Foresight User Guide" is helpful, but besides that, here is what I do,

1) Chinese font
sudo conary update wqy-zenhei=jesse.rpath.org@fl:2-devel

2) input method - SCIM

3) $PATH
I want ~/bin to come before /usr/bin and others. Obviously there is something wrong with $PATH setup in Foresight... echo $PATH and see how it is messed up :)

Edit /etc/profile,
# Path manipulation
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
pathmunge /usr/local/bin
pathmunge $HOME/bin # add this line


(Still at mess but it works)

4) stardict
sudo conary update stardict

Saturday, January 17, 2009

setting up SCIM for Chinese on Foresight Linux

Note: the following instructions are out of date now. Please follow this page on Foresight Wiki.

1. Install scim and scim-pinyin, (also make sure scim:runtime is installed).
sudo conary update scim:runtime scim-pinyin=foresight.rpath.org@fl:2-devel

2.Add a file as /etc/X11/xinit/xinitrc.d/scim.sh, with the content:

#!/bin/sh
export XMODIFIERS="@im=SCIM"
export XIM_PROGRAM="/usr/bin/scim -d"
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
scim -d &;