Aralık 31, 2008

gentoo: "NameError: global name 'parents_file' is not defined"

Gentoo'da
NameError: global name 'parents_file' is not defined
şeklinde hata alıyorsanız.
Örneğin; emerge --sync yaptığınızda;

Traceback (most recent call last):
File "/usr/bin/emerge", line 4049, in ?
emerge_main()
File "/usr/bin/emerge", line 3768, in emerge_main
settings, trees, mtimedb = load_emerge_config()
File "/usr/bin/emerge", line 3679, in load_emerge_config
trees = portage.create_trees(trees=trees, **kwargs)
File "/usr/lib/portage/pym/portage.py", line 6780, in create_trees
config_incrementals=portage_const.INCREMENTALS)
File "/usr/lib/portage/pym/portage.py", line 902, in __init__
addProfile(os.path.realpath(self.profile_path))
File "/usr/lib/portage/pym/portage.py", line 889, in addProfile
raise portage_exception.ParseError(
NameError: global name 'parents_file' is not defined

şeklinde hata mesajları alıyorsanız, aşağıdaki adımları takip edin.


rm /etc/make.profile
ARCH="x86" ACCEPT_KEYWORDS="x86" emerge portage --nodeps
(Burada elimdeki portage dizinini /usr/portage altına kopyalıyorum)
ln -s /usr/portage/profiles/default/linux/x86/2008.0 /etc/make.profile
emerge portage

Aralık 29, 2008

Bilişim ile ilgili söylenmiş favori sözlerim arasına bunu da koyuyorum;

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”

- Martin Fowler

Aralık 20, 2008

python'da tek satırda if else

ok="0"
if status:
ok="1"

Yukarıdaki kodun tek satırlık versiyonu:

ok = "1" if status else "0"