[Spacewalk-devel] Fwd: Bug#703582: Possible fix for bug

2013-07-17 Thread Miroslav Suchý

Can someone please review this patch?
Mirek



 Original Message 
Subject:Bug#703582: Possible fix for bug
Resent-Date:Mon, 08 Jul 2013 06:36:02 +
Resent-From:carsten.men...@bechtle.com carsten.men...@bechtle.com
Resent-To:  debian-bugs-d...@lists.debian.org
Resent-CC:  Miroslav Suchý miros...@suchy.cz
Date:   Mon, 8 Jul 2013 06:20:33 +
From:   carsten.men...@bechtle.com carsten.men...@bechtle.com
Reply-To:   carsten.men...@bechtle.com carsten.men...@bechtle.com,
703...@bugs.debian.org
To: 703...@bugs.debian.org 703...@bugs.debian.org



Dear maintainer,

we at Bechtle AG would like to use Spacewalk to manage the software on
our Debian servers.

When registering a Debian Wheezy machine I experienced the bug 703582.

According to the hint in the bug report I was able to identify the
reason for the problem.

In the function getInstalledPackageList(), the installTime() function is
called with the package name only.

Unfortunately this name does not contain the architecture, so that the
installTime() function is not able to check the correct file
(/var/lib/dpkg/info/packagename:arch.list).

So I created a small fix for this in the file
/usr/share/rhn/up2date_client/debUtils.py:

def installTime(pkg_name,*pkg_arch*): *# additional parameter for the
package architecture*

 path = '/var/lib/dpkg/info/%s.list' % pkg_name

 if os.path.isfile(path):

return os.path.getmtime(path)

 else:

*   # fix for packages with architecture in the name of the list file*

*   path = '/var/lib/dpkg/info/%s:%s.list' %(pkg_name, pkg_arch)*

*   if os.path.isfile(path):*

*  return os.path.getmtime(path)*

else:

   return None

snip

….

def getInstalledPackageList(msgCallback = None, progressCallback = None,

 getArch=None, getInfo = None):

...

snip

package = {

 'name': pkg.name,

 'epoch': epoch,

 'version': version,

 'release': release,

 'arch': pkg.installed.architecture + '-deb',

 'installtime': installTime(pkg.name,
*pkg.installed.architecture*) *# additional parameter for the package
architecture*

 }

snip



With these modifications, it was possible to register my Debian Wheezy
machine with the package list in Spacewalk.

Could you please implement a fix like this in the rhn-client-tools
package (currently version 1.8.9-3) for Debian Wheezy?

Can you also please tell me, when we can expect, that the fix will be
deployed as an update?

Yours sincerely

Carsten Menzel

Bechtle AG

Bechtle Platz 1

D-74172 Neckarsulm





___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] Fwd: Bug#703582: Possible fix for bug

2013-07-17 Thread Michael Mraka
% Dear maintainer,
% 
% we at Bechtle AG would like to use Spacewalk to manage the software on
% our Debian servers.
% 
% When registering a Debian Wheezy machine I experienced the bug 703582.
% 
% According to the hint in the bug report I was able to identify the
% reason for the problem.
% 
% In the function getInstalledPackageList(), the installTime() function is
% called with the package name only.
% 
% Unfortunately this name does not contain the architecture, so that the
% installTime() function is not able to check the correct file
% (/var/lib/dpkg/info/packagename:arch.list).
% 
% So I created a small fix for this in the file
% /usr/share/rhn/up2date_client/debUtils.py:
% 
% def installTime(pkg_name,*pkg_arch*): *# additional parameter for the
% package architecture*
% 
%  path = '/var/lib/dpkg/info/%s.list' % pkg_name
%  if os.path.isfile(path):
% return os.path.getmtime(path)
%  else:
% *   # fix for packages with architecture in the name of the list file*
% *   path = '/var/lib/dpkg/info/%s:%s.list' %(pkg_name, pkg_arch)*
% *   if os.path.isfile(path):*
% *  return os.path.getmtime(path)*
% else:
%return None
% snip
% def getInstalledPackageList(msgCallback = None, progressCallback = None,
%  getArch=None, getInfo = None):
% snip
% package = {
%  'name': pkg.name,
%  'epoch': epoch,
%  'version': version,
%  'release': release,
%  'arch': pkg.installed.architecture + '-deb',
%  'installtime': installTime(pkg.name,
% *pkg.installed.architecture*) *# additional parameter for the package
% architecture*
%  }
% snip
% 
% With these modifications, it was possible to register my Debian Wheezy
% machine with the package list in Spacewalk.
% 
% Could you please implement a fix like this in the rhn-client-tools
% package (currently version 1.8.9-3) for Debian Wheezy?
% 
% Can you also please tell me, when we can expect, that the fix will be
% deployed as an update?
% 
% Yours sincerely
% Carsten Menzel
% Bechtle AG
% Bechtle Platz 1
% D-74172 Neckarsulm

Hello,

this issue has been fixed in spacewalk master (commit
db80b5977366f73243ed7014c808c70c97959650).
Thank you for your contribution.

--
Michael Mráka
Satellite Engineering, Red Hat

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel