LinuxSir.cn,穿越时空的Linuxsir!

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

如何用pacman得到当前内核的源代码?

[复制链接]
发表于 2005-3-30 21:48:19 | 显示全部楼层 |阅读模式
如题!谢谢!
还有怎么用pacman升级内核?
发表于 2005-3-30 22:02:16 | 显示全部楼层
内核可以自己到www.kernel.org下最新的,pacman  -Sy kernel26就是最新的了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-30 22:41:19 | 显示全部楼层
原来如此,一直用pacman -Sy kernel   缺26
为什么pacman不会自动匹配然后给个选项呢?不是很爽
回复 支持 反对

使用道具 举报

发表于 2005-3-30 22:44:16 | 显示全部楼层
为什么不pacman -Ss kernel 然后看看呢?……
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-30 23:28:51 | 显示全部楼层
记下了,pacman只学了版上贴的“常见用法”一文,尚未学习其他
回复 支持 反对

使用道具 举报

发表于 2005-3-31 08:50:33 | 显示全部楼层
原来如此,一直用pacman -Sy kernel 缺26
为什么pacman不会自动匹配然后给个选项呢?不是很爽

我记得Arch的mailing list有人贴出了这个,你可以试试看(邮件附带的文件需要搜索了,如果没有搜索到,我也可以转发给你。坦白说,我不是很清楚怎么弄):
I've been playing around with zshcompsys and have made a start on some completion functions for the various archlinux tools.

Ideally the arch zsh package should ship with something like these, so I thought I'd post the scripts here for people to test out and then I'll see if I can get them added to the package.

In case you don't already know, zshcompsys is a programmable completion mechanism for zsh.  It allows you to use tab-completion to fill in program options and arguments.  For instance, if you type 'pacman --rem<TAB>' it'll complete this to 'pacman --remove' and if you type 'pacman --remove ab<TAB>' it'll try and complete this with the name of an installed package beginning with 'ab'.

zshcompsys is not loaded by default so you need to have (at a
minimum) 'autoload -U compinit && compinit' in your /etc/zshrc or ~/.zshrc.  You'll be able to tell if it's working as it'll make zsh's startup even slower.

There are lots of extra settings you can use to customise zshcompsys's behaviour - here's what I have in my .zshrc:

autoload -U compinit
compinit -D
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%BCompleting %d%b'
zstyle ':completion:*' group-name ''

Save the attached scripts somewhere in your $fpath (e.g. /usr/share/zsh/site-functions/) and they'll be available next time you start a shell.

I'm fairly sure these should mostly work, but I haven't tested them much, so use at your own risk.

pacman is fairly complicated in its options/arguments; to make things simpler I've assumed that the command (--sync/-S/whatever) is specified as the first option on the command-line.

Please try these out and let me know if there's anything wrong, or if everything works perfectly.  Or if anyone actually knows how to write zshcompsys functions properly I'd really appreciate some pointers as to how I should have written _pacman.

- olly
回复 支持 反对

使用道具 举报

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

本版积分规则

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