更新后的 smart 在读取安装某些包时出错(已解决)
比如搜索per-DBI和mozilla-devel,信息可以找到,但不能安装,我用其它方式下载这两个包正常安装,smart报错如下:Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/smart/interfaces/gtk/interactive.py", line 337, in <lambda>
lambda x, y: self._pi.setPackage(y))
File "/usr/lib/python2.4/site-packages/smart/interfaces/gtk/packageinfo.py", line 300, in setPackage
for url in info.getURLs():
File "/usr/lib/python2.4/site-packages/smart/backends/rpm/header.py", line 81, in getURLs
return
File "/usr/lib/python2.4/site-packages/smart/backends/rpm/header.py", line 507, in getFileName
filename = h
TypeError: unsubscriptable object 我安装 perl-DBI 成功, mozill-devel 太大,俺用 apt 就象蜗牛,无法测试。
查 google 的结果如下:
TypeError: unsubscriptable object
This Error Reference applies to: Any version.
This Error Reference is intended for: Any audience.
"Type Error: unsubscriptable object" occurs in an Archetypes based object after pressing the save button of the base_edit form.
The above error occurs in Archetypes and rely on a bad naming of a field in the schema of the archetypes based class.
For example it results in this error:
if the name contains spaces, special characters, etc.,
if the name is a reserved word (like roles, portal, ...)
other naming-conflicts.
楼上可如下改一下 /usr/lib/python2.4/site-packages/smart/backends/rpm/header.py 的 507 行,在命令行下运行smart install mozilla-devel 或 perl-DBI ,看看错误输出。
try:
filename = h[CRPMTAG_FILENAME]
except TypeError:
print "TypeError, h: ", repr(h)
filename=None
注意 try、except 要与下面的 if not filename: 对齐。 我试了,也正常。 smart install perl-DBI
Traceback (most recent call last):
File "/usr/bin/smart", line 194, in ?
main(sys.argv)
File "/usr/bin/smart", line 167, in main
exitcode = iface.run(opts.command, opts.argv)
File "/usr/lib/python2.4/site-packages/smart/interface.py", line 53, in run
result = _command.main(self._ctrl, opts)
File "/usr/lib/python2.4/site-packages/smart/commands/install.py", line 91, in main
ctrl.reloadChannels()
File "/usr/lib/python2.4/site-packages/smart/control.py", line 285, in reloadChannels
self.rebuildSysConfChannels()
File "/usr/lib/python2.4/site-packages/smart/control.py", line 258, in rebuildSysConfChannels
channel = createChannel(alias, data)
File "/usr/lib/python2.4/site-packages/smart/channel.py", line 160, in createChannel
smart = __import__("smart.channels."+type)
File "/usr/lib/python2.4/site-packages/smart/channels/apt_rpm.py", line 22, in ?
from smart.backends.rpm.header import RPMPackageListLoader
File "/usr/lib/python2.4/site-packages/smart/backends/rpm/header.py", line 508
filename = h
^
IndentationError: expected an indented block 如果不在smart-gui里尝试,用指令在没有修改header.py代码前可以安装,但给出这样的错误:
警告: 配置在只读模式!
警告: 组件 'experimental' 不在源 'Magic Linux 2.0 APT Os Repo
sitory' 的分发文件里
警告: 组件 'experimental' 不在源 'Magic Linux 2.0 APT Os Repo
sitory' 的分发文件里
警告: 组件 'experimental' 不在源 'Magic Linux 2.0 APT Os Repo
sitory' 的分发文件里
警告: 组件 'experimental' 不在源 'Magic Linux 2.0 APT Experim
ental Repository' 的分发文件里
警告: 组件 'updates' 不在源 'Magic Linux 2.0 APT Os Repositor
y' 的分发文件里
更新缓存... (
更新缓存... (
更新缓存... (
更新缓存... (
更新缓存... # (
更新缓存... # (
更新缓存... # (
更新缓存... ## (
更新缓存... ## (
更新缓存... ## (
更新缓存... ## ( 1
更新缓存... ### ( 1
更新缓存... ### ( 1
更新缓存... ### ( 1
更新缓存... #### ( 1
更新缓存... #### ( 1
更新缓存... #### ( 1 那是源的设置问题。不是出错。 到底哪里出问题不得而知,最后删除
/var/lib/smart
/usr/lib/smart
/etc/smart
/usr/lib/python2.4/site-packages/smart
重新下载smart包(没搞懂会不会上次下载时有错),然后重装smart后正常了。
没搞懂是否是没有删除smart直接updat安装导致smart部份更新?
页:
[1]