Created attachment 1032080 [details]
Error with original packages file for jessie main (binary-amd64)
Description of problem:
The "Packages.gz" file created by spacewalk is slightly wrong formated, so that a this file is not parseable by Debian systems.
Version-Release number of selected component (if applicable):
2.2 (also tested with 2.3)
Steps to Reproduce:
Sync all debian 8 packages of "main" (binary-amd64) into a spacewalk channel
Install a debian 8 client and manually register it to spacewalk and add channel to client
Run "apt-get update" (twice). Very first run after registration ok
see attachment apt-get_update_error_jessie.txt
No errors while parsing Packages.gz file
It turns out, that there is a space character missing within the parenthesis where the package version is listed.
Wrong "Depends" line of package "games-sport" (mentioned in attachment)
Depends: games-tasks (=1)
RIGHT "Depends" line (from original Debian Packages.gz)
Depends: games-tasks (= 1) <== Space (" ") between operator and version string.
Modify the generated Packages file with
sed -e 's#(\([<>=]*\)\([^)]*\))#(\1 \2)#g' Packages | gzip -c > Packages.gz
Just add a space between the operator and the version.
I followed the source until this file (funktion addPackageDebData)
Note: it looks the package capabilities are parsed incorrectly.
I suppose, the operator should not be a part of the version entry:
# select * from rhnPackageCapability where version like '>%';
id | name | version | created | modified
5961575 | libc6_0 | >=2.7 | 2015-06-01 10:38:42.641241+02 | 2015-06-01 10:38:42.641241+02
Then there should either be another field within the DB to hold the operator or - meybe easier, the operator and version be separated with a " "
When I read the code right, then the "deb822.py" file in /usr/lib/python2.6/site-packages/debian writes the version string correct.
"""Format to string structured inter-package relationships
Perform the inverse operation of parse_relations, returning a string
suitable to be written in a package stanza.
(excl, arch) = arch_spec
return '!' + arch
s = dep['name']
if dep.get('version') is not None:
s += ' (%s %s)' % dep['version']
if dep.get('arch') is not None:
s += ' [%s]' % ' '.join(map(pp_arch, dep['arch']))
pp_or_dep = lambda deps: ' | '.join(map(pp_atomic_dep, deps))
return ', '.join(map(pp_or_dep, rels))
So the "space" character seems to be stripped away somewhere else.
(In reply to Robert Paschedag from comment #2)
> Then there should either be another field within the DB to hold the operator
it's the 'sense' column.
That's why I suppose, the debian package capabilities get incorrectly parsed.
(It's possible, they're written incorrectly as well, but the primary issue I see here is the parsing.)
Made a pull request to introduce a workaround (not a real fix) that just puts a space character between the operator and the version number if an operator is found within a "version" string. Only when generating the Packages.gz file.
I can confirm this workaround works and would like to see this merged until a proper fix is found.
Another attempt to fix this bug: https://github.com/spacewalkproject/spacewalk/pull/399
Spacewalk 2.8 (and older) has already reached it's End Of Life.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before end of life. If you would still like
to see this bug fixed and are able to reproduce it against current version
of Spacewalk 2.9, you are encouraged change the 'version' and re-open it.