Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#9418 - Gajim is not able to read operating system information

Attached to Project: Arch Linux
Opened by Mihael Pranjić (tux) - Thursday, 31 January 2008, 16:13 GMT
Last edited by Simo Leone (neotuli) - Wednesday, 13 February 2008, 19:20 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Simo Leone (neotuli)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Gajim is not able to read operating system information due to the empty /etc/arch-release file..
The bug has been fixed in gajim and the gajim package for archlinux should beupdated

http://trac.gajim.org/changeset/9283

Additional info:
* The bug was recently fixed and the new version is in the svn repository



It should be enough just to change the following function in the file /usr/share/gajim/src/common/helpers.py :

def get_os_info():
if os.name == 'nt':
ver = os.sys.getwindowsversion()
ver_format = ver[3], ver[0], ver[1]
win_version = {
(1, 4, 0): '95',
(1, 4, 10): '98',
(1, 4, 90): 'ME',
(2, 4, 0): 'NT',
(2, 5, 0): '2000',
(2, 5, 1): 'XP',
(2, 5, 2): '2003',
(2, 6, 0): 'Vista',
}
if win_version.has_key(ver_format):
return 'Windows' + ' ' + win_version[ver_format]
else:
return 'Windows'
elif os.name == 'posix':
executable = 'lsb_release'
params = ' --id --codename --release --short'
full_path_to_executable = is_in_path(executable, return_abs_path = True)
if full_path_to_executable:
command = executable + params
child_stdin, child_stdout = os.popen2(command)
output = temp_failure_retry(child_stdout.readline).strip()
child_stdout.close()
child_stdin.close()
os.wait()
# some distros put n/a in places, so remove those
output = output.replace('n/a', '').replace('N/A', '')
return output

# lsb_release executable not available, so parse files
for distro_name in distro_info:
path_to_file = distro_info[distro_name]
if os.path.exists(path_to_file):
if os.access(path_to_file, os.X_OK):
# the file is executable (f.e. CRUX)
# yes, then run it and get the first line of output.
text = get_output_of_command(path_to_file)[0]
else:
fd = open(path_to_file)
text = fd.readline().strip() # get only first line
fd.close()
if path_to_file.endswith('version'):
# sourcemage_version and slackware-version files
# have all the info we need (name and version of distro)
if not os.path.basename(path_to_file).startswith(
'sourcemage') or not\
os.path.basename(path_to_file).startswith('slackware'):
text = distro_name + ' ' + text
elif path_to_file.endswith('aurox-release') or \
path_to_file.endswith('arch-release'):
# file doesn't have version
text = distro_name
elif path_to_file.endswith('lfs-release'): # file just has version
text = distro_name + ' ' + text
return text

# our last chance, ask uname and strip it
uname_output = get_output_of_command('uname -sr')
if uname_output is not None:
return uname_output[0] # only first line
return 'N/A'




This task depends upon

Closed by  Simo Leone (neotuli)
Wednesday, 13 February 2008, 19:20 GMT
Reason for closing:  Implemented

Loading...