|
|
发表于 2005-9-19 17:46:46
|
显示全部楼层
仔细看了一下blfs, 欣喜地发现这段建议与我的做法一模一样:
------------------
Install in Separate Directories
This is a simplistic package management that does not need any extra package to manage the installations. Each package is installed in a separate directory. For example, package foo-1.1 is installed in /usr/pkg/foo-1.1 and a symlink is made from /usr/pkg/foo to /usr/pkg/foo-1.1. When installing a new version foo-1.2, it is installed in /usr/pkg/foo-1.2 and the previous symlink is replaced by a symlink to the new version.
The environment variables such as those mentioned in the section called “Going Beyond BLFS” need to be expanded to include /usr/pkg/foo. For more than a few packages, this scheme becomes unmanageable.
------------------
对于最后一句话我很失望(For more than a few packages, this scheme becomes unmanageable. ),但我发现blfs的这个脚本正是解决这个问题的:
- cat > /etc/profile.d/extrapaths.sh << "EOF"
- if [ -d /usr/local/lib/pkgconfig ] ; then
- pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
- fi
- if [ -d /usr/local/bin ]; then
- pathprepend /usr/local/bin
- fi
- if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
- pathprepend /usr/local/sbin
- fi
- for directory in $(find /opt/*/lib/pkgconfig -type d 2>/dev/null); do
- pathappend $directory PKG_CONFIG_PATH
- done
- for directory in $(find /opt/*/bin -type d 2>/dev/null); do
- pathappend $directory
- done
- if [ -d ~/bin ]; then
- pathprepend ~/bin
- fi
- #if [ $EUID -gt 99 ]; then
- # pathappend .
- #fi
- EOF
复制代码
哈哈,blfs 里的那句话是 bug, 这种包管理方式一点问题没有 |
|