Skip to content

Commit

Permalink
[debian][pkg] Update to latest packaging config
Browse files Browse the repository at this point in the history
Bringing in most of the relevant changes from downstream build environment

No transitional package to be used upstream

Signed-off-by: Arif Ali <arif.ali@canonical.com>
  • Loading branch information
arif-ali authored and TurboTurtle committed Feb 17, 2025
1 parent c506cee commit 9a91496
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 41 deletions.
5 changes: 3 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ deb_build_task:
apt update --allow-releaseinfo-change
apt -y install devscripts equivs python3-pip
mk-build-deps
apt -y install ./sosreport-build-deps*.deb
apt -y install ./sos-build-deps*.deb
[[ $(pip3 install --help | grep break-system) ]] && PIP_EXTRA="--break-system-packages"
pip3 install -r test-requirements.txt ${PIP_EXTRA}
main_script: |
Expand Down Expand Up @@ -243,7 +243,8 @@ report_stageone_task:
DEB_BUILD_NAME: ${BUILD_NAME}
setup_script: &setup |
if [ $(command -v apt) ]; then
apt -y purge sosreport
[[ "$(dpkg -l sos)" ]] && apt -y purge sos
[[ "$(dpkg -l sosreport)" ]] && apt -y purge sosreport
apt update --allow-releaseinfo-change
apt -y install python3-pip ethtool python3-systemd
if [ ${PKG} == "snap" ] ; then
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ docs/_build
.idea/

# debian files
debian/sosreport*
debian/sosreport/*
debian/sos/*
debian/files
debian/.debhelper
debian/debhelper-build-stamp
Expand Down
8 changes: 7 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
sosreport (4.8.2) New upstream release; urgency=medium
sos (4.8.2-4) oracular; urgency=medium

* Update to new sos package and version for Breakage.

-- Arif Ali <arif.ali@canonical.com> Mon, 17 Feb 2025 10:39:30 +0000

sosreport (4.8.2) oracular; urgency=medium

* New upstream release

Expand Down
38 changes: 27 additions & 11 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
Source: sosreport
Maintainer: David Negreira <david.negreira@canonical.com>
Source: sos
Maintainer: sosreport Dev Team <sosreport-dev@lists.canonical.com>
Uploaders:
Arif Ali <arif.ali@canonical.com>,
Section: admin
Priority: optional
Standards-Version: 4.5.1
Standards-Version: 4.7.0
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
dh-python,
fdisk,
gettext,
python3-all,
python3-coverage,
python3-nose,
python3-setuptools,
python3-sphinx,
python3-magic,
python3-pexpect,
python3-packaging,
python3-pexpect,
python3-setuptools,
python3-sphinx,
python3-yaml,
Homepage: https://github.com/sosreport/sos
Vcs-Browser: https://salsa.debian.org/sosreport-team/sosreport
Vcs-Git: https://salsa.debian.org/sosreport-team/sosreport.git
X-Python3-Version: >= 3.6

Package: sosreport
Package: sos
Replaces:
sosreport (<< 4.8.2-4~),
Breaks:
sosreport (<< 4.8.2-4~),
Architecture: any
Depends: ${python3:Depends}, ${misc:Depends}, python3-pexpect, python3-magic, python3-packaging, python3-boto3, python3-yaml
Depends:
python3-magic,
python3-packaging,
python3-pexpect,
python3-yaml,
${misc:Depends},
${python3:Depends},
Recommends:
e2fsprogs,
lsof,
mount,
python3-boto3,
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
Expand Down
109 changes: 107 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,94 @@ Source: https://github.com/sosreport/sos

Files: *
Copyright: (C) 2012-2017 Bryn M. Reeves
(C) 2007-2024 Red Hat, Inc.
(C) 2012-2024 Canonical Ltd.
(C) 2007-2025 Red Hat, Inc.
(C) 2012-2025 Canonical Ltd.
License: GPL-2

Files: sos/policies/distros/almalinux.py
Copyright: (C) Eduard Abdullin <eabdullin@almalinux.org>
License: GPL-2

Files: sos/policies/distros/azure.py
Copyright: (C) Eric Desrochers <edesrochers@microsoft.com>
License: GPL-2

Files: sos/report/plugins/bird.py
Copyright: (C) 2024 Jake Hunsaker <jacob.r.hunsaker@gmail.com>
(C) 2019 Alexander Petrovskiy <alexpe@mellanox.com>
License: GPL-2

Files: sos/policies/distros/circle.py
Copyright: (C) Bella Zhang <bella@cclinux.org>
License: GPL-2

Files: sos/policies/distros/opencloudos.py
Copyright: (C) 2022 Tencent., ZoeDong <zoedong@tencent.com>
License: GPL-2

Files: sos/policies/distros/rocky.py
Copyright: (C) Louis Abel <label@rockylinux.org>
License: GPL-2

Files: sos/report/plugins/elastic.py
Copyright: (C) 2018 Amit Ghadge <amitg.b14@gmail.com>
License: GPL-2

Files: sos/report/plugins/kimchi.py
Copyright: (C) IBM, Corp. 2014, Christy Perez <christy@linux.vnet.ibm.com>
License: GPL-2

Files: sos/report/plugins/mellanox_firmware.py
Copyright: (C) 2023 Nvidia Corporation, Alin Serdean <aserdean@nvidia.com>
License: GPL-2

Files: sos/report/plugins/memcached.py
Copyright: (C) 2018 Mikel Olasagasti Uranga <mikel@olasagasti.info>
License: GPL-2

Files: sos/report/plugins/navicli.py
sos/report/plugins/powerpath.py
sos/report/plugins/symcli.py
Copyright: (C) 2008 EMC Corporation. Keith Kearnan <kearnan_keith@emc.com>
License: GPL-2

Files: sos/report/plugins/opencontrail.py
Copyright: (C) 2021 Mirantis, Inc., Oleksii Molchanov <omolchanov@mirantis.com>
License: GPL-2

Files: sos/report/plugins/openstack_ansible.py
Copyright: (C) 2017 Major Hayden <major@mhtx.net>
License: GPL-2

Files: sos/report/plugins/openstack_barbican.py
Copyright: (C) 2019 Mirantis, Inc., Denis Egorenko <degorenko@mirantis.com>
License: GPL-2

Files: sos/report/plugins/openstack_ceilometer.py
sos/report/plugins/openstack_cinder.py
sos/report/plugins/openstack_glance.py
sos/report/plugins/openstack_horizon.py
sos/report/plugins/openstack_nova.py
sos/report/plugins/openstack_swift.py
Copyright: (C) 2012 Rackspace US, Inc.
License: GPL-2

Files: sos/report/plugins/pcp.py
Copyright: (C) 2014 Michele Baldessari <michele at acksyn.org>
License: GPL-2

Files: sos/report/plugins/proxmox.py
Copyright: (C) 2024 ORNESS/Ditrit Drien Breton <drien.breton@orness.com>
License: GPL-2

Files: debian/*
Copyright: 2013 Adam Stokes <adam.stokes@ubuntu.com>
(C) 2013-2025 Canonical Ltd.
License: GPL-2+

Files: debian/tests/simple.sh
Copyright: 2020 Eric Desrochers <eric.desrochers@canonical.com>
(C) 2020-2025 Canonical Ltd.
License: GPL-2

License: GPL-2
Expand All @@ -23,3 +109,22 @@ License: GPL-2
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
USA.

License: GPL-2+
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.
12 changes: 11 additions & 1 deletion debian/patches/0001-debian-change-tmp-dir-location.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Description: Change default location to /tmp
From: Eric Desrochers <slashd@ubuntu.com>
Date: Wed, 19 Aug 2020 22:49:24 +0000
Subject: Change default location to /tmp

Forwarded: not-needed
---
sos.conf | 1 +
1 file changed, 1 insertion(+)

diff --git a/sos.conf b/sos.conf
index 2be22a3..26778d2 100644
--- a/sos.conf
+++ b/sos.conf
@@ -7,6 +7,7 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From: Marc Leeman <marc.leeman@gmail.com>
Date: Mon, 8 Jul 2024 09:53:51 +0100
Subject: Do not install LICENSE file

Last-Update: 2024-08-29
Forwarded: not-needed

The LICENSE in debian is contained in the copyright file that contains
the same information.

The files in share/doc/sos are already being populated into share/doc/sosreport
so we don't want them to be duplicated.
---
setup.py | 2 --
1 file changed, 2 deletions(-)

diff --git a/setup.py b/setup.py
index 6c0b09a1..c214570d 100644
--- a/setup.py
+++ b/setup.py
@@ -26,8 +26,6 @@ setup(
'man/en/sos-mask.1', 'man/en/sos-help.1',
'man/en/sos-upload.1']),
('share/man/man5', ['man/en/sos.conf.5']),
- ('share/licenses/sos', ['LICENSE']),
- ('share/doc/sos', ['AUTHORS', 'README.md']),
('config', ['sos.conf', 'tmpfiles/tmpfilesd-sos-rh.conf'])
],
packages=find_packages(include=['sos', 'sos.*'])
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0001-debian-change-tmp-dir-location.patch
0002-debian-do-not-install-LICENSE-README-AUTHORS.patch
12 changes: 8 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/usr/bin/make -f

export PYBUILD_NAME=sosreport
export PYBUILD_NAME=sos
export PYBUILD_DESTDIR=debian/$(PYBUILD_NAME)

%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_install:
# Move config file to the right location.
mv debian/sosreport/usr/config/sos.conf debian/sosreport/etc/sos/sos.conf
mkdir -p debian/sos/etc/sos
mv debian/sos/usr/config/sos.conf debian/sos/etc/sos/sos.conf
# Remove unnecessary unused dir.
rm -rf debian/sosreport/usr/config
rm -rf debian/sos/usr/config

override_dh_auto_test:
nosetests3 -v --with-cover --cover-package=sos tests/unittests --ignore-files="policy_tests\.py"
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
python3 -m unittest -v $(shell find tests/unittests -name "*_tests.py" -not -path "*policy_tests.py")
endif
3 changes: 3 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sos source: debian-watch-does-not-check-openpgp-signature [debian/watch]
sos source: very-long-line-length-in-source-file 1039 > 512 [tests/report_tests/plugin_tests/juju/agent.conf:188]
sos source: very-long-line-length-in-source-file 2374 > 512 [tests/report_tests/plugin_tests/curtin/curtin-install.log:883]
13 changes: 10 additions & 3 deletions debian/tests/control
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Tests: simple.sh
Depends: sosreport
Restrictions: needs-root, allow-stderr, isolation-machine
Tests:
simple.sh,
Depends:
iproute2,
kmod,
lshw,
sos,
Restrictions:
allow-stderr,
needs-root,
26 changes: 13 additions & 13 deletions debian/tests/simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ run_expecting_success () {
echo "#### Sos Total time (seconds):" $runtime

if [ -s /dev/shm/stderr ]; then
add_failure "test generated stderr output, see above"
echo "### start stderr"
cat /dev/shm/stderr
echo "### end stderr"
if [ "$(grep -v -E "Unable to read kernel|Unable to find booted" /dev/shm/stderr)" ] ; then
add_failure "test generated stderr output, see above"
echo "### start stderr"
cat /dev/shm/stderr
echo "### end stderr"
fi
fi

echo "### start stdout"
Expand Down Expand Up @@ -111,9 +113,6 @@ test_normal_report () {
if [ ! -f /tmp/sosreport_test/sos_reports/manifest.json ]; then
add_failure "did not generate manifest.json"
fi
if [ ! -f /tmp/sosreport_test/free ]; then
add_failure "did not create free symlink in archive root"
fi
if [ ! "$(grep "DEBUG" /tmp/sosreport_test/sos_logs/sos.log)" ]; then
add_failure "did not find debug logging when using -vvv"
fi
Expand Down Expand Up @@ -145,7 +144,7 @@ test_noreport_label_only () {
fi
update_failures
fi
update_summary "$cmd"
update_summary "$cmd"
}

# test using mask
Expand All @@ -157,9 +156,10 @@ test_mask () {
add_failure "hostname not obfuscated with --mask"
fi
# we don't yet support binary obfuscation, so skip binary matches
if [ "$(grep -rI `hostname` /tmp/sosreport_test/*)" ]; then
hostname_check=$(grep -rI $(hostname) /tmp/sosreport_test/* | grep -v -E "autopkgtest-run|autopkgtest-vir|S01autopkgtest|autopkgtest root shell|90autopkgtest|debug.*autopkgtest")
if [ "${hostname_check}" ]; then
add_failure "hostname not obfuscated in all places"
echo "$(grep -rI `hostname` /tmp/sosreport_test/*)"
echo "${hostname_check}"
fi
# only tests first interface
mac_addr=$(cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address)
Expand All @@ -168,7 +168,7 @@ test_mask () {
echo "$(grep -rI $mac_addr /tmp/sosreport_test/*)"
fi
# only tests first interface
ip_addr=$(ip route show default | awk '/default/ {print $3}')
ip_addr=$(ip route show default | awk '/default/ {print $3}' | sed 's/\./\\\./g')
if [ "$(grep -rI $ip_addr /tmp/sosreport_test/*)" ]; then
add_failure "IP address not obfuscated in all places"
echo "$(grep -rI $ip_addr /tmp/sosreport_test/*)"
Expand Down Expand Up @@ -202,7 +202,7 @@ test_enable_opts_postproc () {
if [ ! "$(grep "opencl" /dev/shm/stdout)" ]; then
add_failure "force enabled plugin opencl did not run"
fi
if [ ! -f /tmp/sosreport_test/proc/timer* ]; then
if [ ! "$(uname -a | grep -v armhf)" ] && [ ! -f /tmp/sosreport_test/proc/timer* ]; then
add_failure "/proc/timer* not captured when using -k kernel.with-timer"
fi
if [ ! -f /tmp/sosreport_test/sos_commands/libraries/ldconfig_-v* ]; then
Expand All @@ -222,7 +222,7 @@ test_build_threads () {
cmd="--build -t1 -o host,kernel,filesys,hardware,date,logs"
run_expecting_success "$cmd"
if [ $? -eq 0 ]; then
if [ ! "$(grep "Your sosreport build tree" /dev/shm/stdout)" ]; then
if [ ! "$(grep "Your sos report build tree" /dev/shm/stdout)" ]; then
add_failure "did not save the build tree"
fi
if [ $(grep "Finishing plugins" /dev/shm/stdout) ]; then
Expand Down
6 changes: 6 additions & 0 deletions debian/upstream/metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bug-Database: https://github.com/sosreport/sos/issues
Bug-Submit: https://github.com/sosreport/sos/issues/new
Documentation: https://github.com/sosreport/sos/wiki
https://sos.readthedocs.io/
Repository: https://github.com/sosreport/sos.git
Repository-Browse: https://github.com/sosreport/sos
4 changes: 1 addition & 3 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%sos-$1.tar.gz%" \
https://github.com/sosreport/sos/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
https://github.com/sosreport/sos/tags .*/v?(\d.*)@ARCHIVE_EXT@

0 comments on commit 9a91496

Please sign in to comment.