LinuxSir.cn,穿越时空的Linuxsir!

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

问个有意思的问题

[复制链接]
发表于 2011-8-18 08:00:52 | 显示全部楼层 |阅读模式
有时候有大量的软件包编译,
由于断电或者机器过热导致关机而中断,
会发现一切都要从来,这是非常痛苦的一件事情。

目前有没有监控emerge 编译过程的工具或者数据库,
使得某个编译过程的信息会实时写入并保存,
等到emerge下次运行时可以先读入作校验,
并作适当的询问之后才开始新的动作?

谢谢。
发表于 2011-8-18 08:06:18 | 显示全部楼层
要重来?emerge --resume是干什么的?
回复 支持 反对

使用道具 举报

发表于 2011-8-18 08:14:31 | 显示全部楼层
方法一:
  1. FEATURES="keepwork keeptemp" emerge --resume
  2. # 确认无误后:
  3. rm -r /var/tmp/portage/*
复制代码

方法二:
  1. ebuild PATH_TO_EBUILD compile install qmerge
  2. # 当然,如果您的emerge不是在compile阶段出错的话...
  3. # 确认无误后:
  4. ebuild PATH_TO_EBUILD clean
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-8-18 08:50:41 | 显示全部楼层
emerge --resume是在emerge中断后使用吗?
它是根据emerge中断前的信息还是仅仅根据/var/tmp/portage中的信息继续的?

另,--resume的用法是不是要把它添加到前一次emerge命令项的后面,
还是直接emerge --resume即可?
回复 支持 反对

使用道具 举报

发表于 2011-8-18 09:09:33 | 显示全部楼层
man emerge :

   --resume(-r)
              Resumes the most recent merge list that has been aborted due to an error.  Please note that this operation will  only  return  an  error  on  failure.   If  there is nothing for portage to do, then portage will exit with a message and a success condition. A resume list will persist until it has been completed in entirety or until another aborted merge list replaces it.  The resume history is capable of storing two merge lists.  After one resume list completes, it is possible to invoke --resume once again in order to resume an older list.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-8-18 09:20:49 | 显示全部楼层
Post by zhou3345;2146931
man emerge :

   --resume(-r)
              Resumes the most recent merge list that has been aborted due to an error.  Please note that this operation will  only  return  an  error  on  failure.   If  there is nothing for portage to do, then portage will exit with a message and a success condition. A resume list will persist until it has been completed in entirety or until another aborted merge list replaces it.  The resume history is capable of storing two merge lists.  After one resume list completes, it is possible to invoke --resume once again in order to resume an older list.


大概明白了--resume的工作机制。
回复 支持 反对

使用道具 举报

发表于 2011-8-18 10:19:26 | 显示全部楼层
Post by easior lars;2146930
emerge --resume是在emerge中断后使用吗?
它是根据emerge中断前的信息还是仅仅根据/var/tmp/portage中的信息继续的?

另,--resume的用法是不是要把它添加到前一次emerge命令项的后面,
还是直接emerge --resume即可?


呃,另外需要注意的是,如果FEATURES没有keepwork和keeptemp,emerge --resume是会清空编译时的临时文件(/var/tmp/portage)重新emerge未完成的包的。如果被中断的包是gcc、libreoffice、firefox、chromium之类的庞然大物,重新编译会花很多时间。可以临时启用keepwork和keeptemp以自动忽略已编译完成的部分:
  1. FEATURES="keepwork keeptemp" emerge --resume
复制代码


注意keepwork和keeptemp最好不要放入make.conf中的FEATURES:
...Due to lack of proper cleanup, this feature can  interfere  with  normal  emerge operation  and  therefore it should not be left enabled for more than a short period of time.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-8-18 10:36:46 | 显示全部楼层
Post by RichardGv;2146947
呃,另外需要注意的是,如果FEATURES没有keepwork和keeptemp,emerge --resume是会清空编译时的临时文件(/var/tmp/portage)重新emerge未完成的包的。如果被中断的包是gcc、libreoffice、firefox、chromium之类的庞然大物,重新编译会花很多时间。可以临时启用keepwork和keeptemp以自动忽略已编译完成的部分:
  1. FEATURES="keepwork keeptemp" emerge --resume
复制代码


注意keepwork和keeptemp最好不要放入make.conf中的FEATURES:


谢谢你的提示,
这些对于不常更新系统的同志非常实用,
当然也包括我。
回复 支持 反对

使用道具 举报

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

本版积分规则

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