Skip to content

Commit

Permalink
Merge branch 'shell-fix-debian-packaging'
Browse files Browse the repository at this point in the history
Conflicts:
	sos/plugins/hardware.py
  • Loading branch information
bmr-cymru committed Apr 16, 2013
2 parents d7b6b62 + 9a007ea commit be1ed81
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 46 deletions.
7 changes: 4 additions & 3 deletions debian/changelog
@@ -1,5 +1,6 @@
sos (2.3) unstable; urgency=low
sosreport (2.3+git20130411-1) unstable; urgency=low

* Initial release.
* Package updated from git rev 1baf743
Closes: #698329

-- Adam Stokes <adam.stokes@canonical.com> Mon, 20 Feb 2012 16:41:39 +0000
-- Adam Stokes <adam.stokes@ubuntu.com> Thu, 11 Apr 2013 20:55:56 -0400
2 changes: 1 addition & 1 deletion debian/compat
@@ -1 +1 @@
8
9
15 changes: 8 additions & 7 deletions debian/control
@@ -1,14 +1,15 @@
Source: sos
Maintainer: Adam Stokes <adam.stokes@canonical.com>
Source: sosreport
Maintainer: Adam Stokes <adam.stokes@ubuntu.com>
Section: python
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 8), python-support, python (>=2.7), gettext
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9), python (>=2.7), gettext, python-nose
Homepage: https://github.com/sosreport/sosreport

Package: sos
Package: sosreport
Architecture: any
Depends: ${python:Depends}, ${misc:Depends}, python-selinux
Description: A set of tools to gather troubleshooting information from a system
Depends: ${python:Depends}, ${misc:Depends}
Description: Set of tools to gather troubleshooting data from a system
Sos is a set of tools that gathers information about system
hardware and configuration. The information can then be used for
diagnostic purposes and debugging. Sos is commonly used to help
Expand Down
31 changes: 31 additions & 0 deletions debian/copyright
@@ -0,0 +1,31 @@
This package was originally debianized by Adam Stokes
<adam.stokes@ubuntu.com> on Thu Apr 11 18:48:47 EST 2013

It was downloaded from https://github.com/sosreport/sosreport

Author: Bryn Reeves: <bmr@redhat.com>
https://github.com/sosreport

Copyright: 2007-2013 Red Hat, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301, USA.

On Debian systems, the complete text of the GNU General Public
License, version 2, can be found in /usr/share/common-licenses/GPL-2.

The Debian packaging is (C) 2012-2013, Adam Stokes <adam.stokes@ubuntu.com>
and is licensed under the GPL, see above.

13 changes: 5 additions & 8 deletions debian/rules
Expand Up @@ -3,11 +3,8 @@
DH_ALWAYS_EXCLUDE=.git

%:
dh $@

override_dh_pysupport:
dh_python2 -p sos
override_dh_fixperms:
dh_fixperms -Xsos
override_dh_auto_test:

dh $@ --with python2

override_dh_auto_install:
dh_auto_install
rm -f $(CURDIR)/debian/sosreport/usr/share/sos/LICENSE
1 change: 1 addition & 0 deletions debian/source/format
@@ -0,0 +1 @@
1.0
6 changes: 3 additions & 3 deletions sos.conf
@@ -1,8 +1,8 @@
[general]

ftp_upload_url = ftp://dropbox.redhat.com/incoming
gpg_keyring = /usr/share/sos/rhsupport.pub
gpg_recipient = support@redhat.com
#ftp_upload_url = ftp://example.com/incoming
#gpg_keyring = /usr/share/sos/rhsupport.pub
#gpg_recipient = support@redhat.com
smtp_server = None

[plugins]
Expand Down
46 changes: 23 additions & 23 deletions sos/plugins/__init__.py
Expand Up @@ -246,41 +246,41 @@ def _path_in_path_list(self, path, path_list):
return False

def copy_symlink(self, srcpath, sub=None):
# the target stored in the original symlink
# the target stored in the original symlink
linkdest = os.readlink(srcpath)
# absolute path to the link target
absdest = os.path.normpath(os.path.join(
os.path.dirname(srcpath), linkdest))
# adjust the target used inside the report to always be relative
if os.path.isabs(linkdest):
reldest = os.path.relpath(linkdest,
os.path.dirname(srcpath))
self.soslog.debug("made link target %s relative as %s"
% (linkdest, reldest))
else:
reldest = linkdest

self.soslog.debug(
"copying link %s pointing to %s with sub=%s, isdir=%s"
% (srcpath, linkdest, sub, os.path.isdir(absdest)))
# absolute path to the link target
absdest = os.path.normpath(os.path.join(
os.path.dirname(srcpath), linkdest))
# adjust the target used inside the report to always be relative
if os.path.isabs(linkdest):
reldest = os.path.relpath(linkdest,
os.path.dirname(srcpath))
self.soslog.debug("made link target %s relative as %s"
% (linkdest, reldest))
else:
reldest = linkdest

self.soslog.debug(
"copying link %s pointing to %s with sub=%s, isdir=%s"
% (srcpath, linkdest, sub, os.path.isdir(absdest)))

if os.path.isdir(absdest):
self.soslog.debug("link %s is a directory, skipping..."
% linkdest)
% linkdest)
return

if sub:
old, new = sub
reldest = srcpath.replace(old, new)

# use the relative target path in the tarball
# use the relative target path in the tarball
self.archive.add_link(reldest,srcpath)

# copy the symlink target translating relative targets
# to absolute paths to pass to do_copy_file_or_dir.
self.soslog.debug("normalized link target %s as %s"
%(linkdest, absdest))
self.do_copy_file_or_dir(absdest)
# copy the symlink target translating relative targets
# to absolute paths to pass to do_copy_file_or_dir.
self.soslog.debug("normalized link target %s as %s"
%(linkdest, absdest))
self.do_copy_file_or_dir(absdest)

self.copied_files.append({
'srcpath':srcpath,
Expand Down
2 changes: 1 addition & 1 deletion sos/plugins/hardware.py
Expand Up @@ -71,7 +71,7 @@ class RedHatHardware(hardware, RedHatPlugin):
def setup(self):
super(RedHatHardware, self).setup()
hwpaths = glob("/usr/share/rhn/up2date*client/hardware.py")
if (len(hwpaths) == 0):
if (len(hwpaths) == 0):
return
self.add_cmd_output(hwpaths[0])

Expand Down

0 comments on commit be1ed81

Please sign in to comment.