Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.216.68
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
Delete
Unzip
Name
Size
Permission
Date
Action
Automat-20.2.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
Babel-2.8.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
CommandNotFound
[ DIR ]
drwxr-xr-x
2024-02-17 03:50
ConfigArgParse-1.5.3.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
DistUpgrade
[ DIR ]
drwxr-xr-x
2024-10-14 20:22
HweSupportStatus
[ DIR ]
drwxr-xr-x
2025-12-31 20:42
Jinja2-3.0.3.egg-info
[ DIR ]
drwxr-xr-x
2025-03-13 06:42
Markdown-3.3.6.egg-info
[ DIR ]
drwxr-xr-x
2024-09-07 23:28
MarkupSafe-2.0.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
NvidiaDetector
[ DIR ]
drwxr-xr-x
2026-05-02 01:35
OpenSSL
[ DIR ]
drwxr-xr-x
2026-03-24 06:23
PyGObject-3.42.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
PyHamcrest-2.0.2.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
PyICU-2.8.1.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
PyJWT-2.3.0.egg-info
[ DIR ]
drwxr-xr-x
2026-04-02 06:36
PyYAML-5.4.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
Pygments-2.11.2.egg-info
[ DIR ]
drwxr-xr-x
2024-11-28 06:27
Quirks
[ DIR ]
drwxr-xr-x
2026-05-02 01:35
SecretStorage-3.3.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
Twisted-22.1.0.egg-info
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
UbuntuDrivers
[ DIR ]
drwxr-xr-x
2026-05-02 01:35
UpdateManager
[ DIR ]
drwxr-xr-x
2025-12-31 20:42
__pycache__
[ DIR ]
drwxr-xr-x
2025-08-05 06:05
_distutils_hack
[ DIR ]
drwxr-xr-x
2025-05-31 06:21
_yaml
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
acme
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
acme-1.21.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
apport
[ DIR ]
drwxr-xr-x
2025-08-05 06:05
apt
[ DIR ]
drwxr-xr-x
2025-12-31 20:41
apt_inst-stubs
[ DIR ]
drwxr-xr-x
2025-12-31 20:36
apt_pkg-stubs
[ DIR ]
drwxr-xr-x
2025-12-31 20:36
aptsources
[ DIR ]
drwxr-xr-x
2025-12-31 20:41
asgiref
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
asgiref-3.5.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
attr
[ DIR ]
drwxr-xr-x
2025-12-31 20:38
attrs-21.2.0.egg-info
[ DIR ]
drwxr-xr-x
2025-12-31 20:37
automat
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
babel
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
bcrypt
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
bcrypt-3.2.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
blinker
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
certbot
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
certbot-1.21.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
certbot_apache
[ DIR ]
drwxr-xr-x
2024-08-28 22:15
certbot_apache-1.21.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 22:15
certifi
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
certifi-2020.6.20.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
chardet
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
chardet-4.0.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
click
[ DIR ]
drwxr-xr-x
2024-02-17 03:46
click-8.0.3.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
cloud_init-26.1.egg-info
[ DIR ]
drwxr-xr-x
2026-06-23 20:31
cloudinit
[ DIR ]
drwxr-xr-x
2026-06-23 20:32
colorama
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
colorama-0.4.4.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
configobj-5.0.6.egg-info
[ DIR ]
drwxr-xr-x
2024-09-28 06:05
constantly
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
constantly-15.1.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
cryptography
[ DIR ]
drwxr-xr-x
2026-03-18 06:24
cryptography-3.4.8.egg-info
[ DIR ]
drwxr-xr-x
2026-03-18 06:24
dbus
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
dbus_python-1.2.18.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
debian
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
debian_bundle
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
distro
[ DIR ]
drwxr-xr-x
2024-02-17 03:46
distro-1.7.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
distro_info-1.1+ubuntu0.2.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
dns
[ DIR ]
drwxr-xr-x
2024-09-07 23:28
dnspython-2.1.0.egg-info
[ DIR ]
drwxr-xr-x
2024-09-07 23:28
elftools
[ DIR ]
drwxr-xr-x
2024-08-21 22:43
firewall
[ DIR ]
drwxr-xr-x
2024-08-29 14:24
gi
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
gpg
[ DIR ]
drwxr-xr-x
2024-09-07 23:28
h11
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
h11-0.13.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
hamcrest
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
httplib2
[ DIR ]
drwxr-xr-x
2026-07-16 06:20
httplib2-0.20.2.egg-info
[ DIR ]
drwxr-xr-x
2026-07-16 06:20
hyperlink
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
hyperlink-21.0.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
icu
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
idna
[ DIR ]
drwxr-xr-x
2026-07-17 06:48
idna-3.3.egg-info
[ DIR ]
drwxr-xr-x
2026-07-17 06:48
importlib_metadata
[ DIR ]
drwxr-xr-x
2024-02-17 03:46
importlib_metadata-4.6.4.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
incremental
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
incremental-21.3.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
janitor
[ DIR ]
drwxr-xr-x
2025-12-31 20:42
jeepney
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
jeepney-0.7.1.dist-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
jinja2
[ DIR ]
drwxr-xr-x
2025-03-13 06:42
josepy
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
josepy-1.10.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
jsonpatch-1.32.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
jsonpointer-2.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
jsonschema
[ DIR ]
drwxr-xr-x
2024-02-17 03:46
jsonschema-3.2.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
jwt
[ DIR ]
drwxr-xr-x
2026-04-02 06:36
keyring
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
keyring-23.5.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
landscape
[ DIR ]
drwxr-xr-x
2025-12-31 20:41
launchpadlib
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
launchpadlib-1.10.16.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
lazr
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
lazr.restfulclient-0.14.4.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
lazr.uri-1.0.6.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
magic
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
markdown
[ DIR ]
drwxr-xr-x
2024-09-07 23:28
markupsafe
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
more_itertools
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
more_itertools-8.10.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
netifaces-0.11.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
netplan
[ DIR ]
drwxr-xr-x
2026-06-23 20:30
nftables
[ DIR ]
drwxr-xr-x
2026-05-02 01:34
oauthlib
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
oauthlib-3.2.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
ovs
[ DIR ]
drwxr-xr-x
2026-06-23 20:31
ovs-2.17.9.egg-info
[ DIR ]
drwxr-xr-x
2026-06-23 20:31
packaging
[ DIR ]
drwxr-xr-x
2025-02-27 13:15
packaging-21.3.egg-info
[ DIR ]
drwxr-xr-x
2025-02-27 13:13
parsedatetime
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
parsedatetime-2.6.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
pexpect
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
pip
[ DIR ]
drwxr-xr-x
2025-12-31 20:39
pip-22.0.2.dist-info
[ DIR ]
drwxr-xr-x
2025-12-31 20:37
pkg_resources
[ DIR ]
drwxr-xr-x
2025-05-31 06:21
ptyprocess
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
ptyprocess-0.7.0.dist-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
pyOpenSSL-21.0.0.egg-info
[ DIR ]
drwxr-xr-x
2026-03-24 06:23
pyRFC3339-1.1.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
pyasn1
[ DIR ]
drwxr-xr-x
2026-03-31 06:50
pyasn1-0.4.8.egg-info
[ DIR ]
drwxr-xr-x
2026-03-31 06:50
pyasn1_modules
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
pyelftools-0.27.egg-info
[ DIR ]
drwxr-xr-x
2024-08-21 22:43
pygments
[ DIR ]
drwxr-xr-x
2024-11-28 06:27
pygtkcompat
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
pyparsing-2.4.7.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
pyrfc3339
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
pyrsistent
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
pyrsistent-0.18.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
pyserial-3.5.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
python_apt-2.4.0+ubuntu4.1.egg-info
[ DIR ]
drwxr-xr-x
2025-12-31 20:36
python_debian-0.1.43+ubuntu1.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
python_magic-0.4.24.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
pytz
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
pytz-2022.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
requests
[ DIR ]
drwxr-xr-x
2025-06-17 06:46
requests-2.25.1.egg-info
[ DIR ]
drwxr-xr-x
2025-06-17 06:46
requests_toolbelt
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
requests_toolbelt-0.9.1.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
samba
[ DIR ]
drwxr-xr-x
2026-05-28 07:00
secretstorage
[ DIR ]
drwxr-xr-x
2024-02-17 03:46
serial
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
service_identity
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
service_identity-18.1.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
setuptools
[ DIR ]
drwxr-xr-x
2025-05-31 06:21
setuptools-59.6.0.egg-info
[ DIR ]
drwxr-xr-x
2025-05-31 06:21
six-1.16.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:44
softwareproperties
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
sortedcontainers
[ DIR ]
drwxr-xr-x
2024-08-21 22:43
sortedcontainers-2.1.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-21 22:43
sos
[ DIR ]
drwxr-xr-x
2026-05-02 01:34
sos-4.10.2.egg-info
[ DIR ]
drwxr-xr-x
2026-05-02 01:33
speedtest_cli-2.1.3.egg-info
[ DIR ]
drwxr-xr-x
2025-03-14 22:12
ssh_import_id
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
ssh_import_id-5.11.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
supervisor
[ DIR ]
drwxr-xr-x
2025-02-27 19:58
supervisor-4.2.1.egg-info
[ DIR ]
drwxr-xr-x
2025-02-27 19:58
systemd
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
twisted
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
uaclient
[ DIR ]
drwxr-xr-x
2026-07-18 06:45
ubuntu_drivers_common-0.0.0.egg-info
[ DIR ]
drwxr-xr-x
2026-05-02 01:32
ubuntu_pro_client-8001.egg-info
[ DIR ]
drwxr-xr-x
2026-07-18 06:45
ufw
[ DIR ]
drwxr-xr-x
2024-02-17 03:50
unattended_upgrades-0.1.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
urllib3
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
urllib3-1.26.5.egg-info
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
uvicorn
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
uvicorn-0.15.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
wadllib
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
wadllib-1.3.6.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
wheel
[ DIR ]
drwxr-xr-x
2025-02-27 13:31
wheel-0.37.1.egg-info
[ DIR ]
drwxr-xr-x
2025-02-27 13:31
wsproto
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
wsproto-1.0.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
xkit
[ DIR ]
drwxr-xr-x
2024-02-17 03:45
yaml
[ DIR ]
drwxr-xr-x
2024-02-17 03:53
zipp-1.0.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-21 00:25
zope
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
zope.component-4.3.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
zope.event-4.4.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
zope.hookable-5.1.0.egg-info
[ DIR ]
drwxr-xr-x
2024-08-28 00:25
zope.interface-5.4.0.egg-info
[ DIR ]
drwxr-xr-x
2024-02-17 03:51
_capng.cpython-310-x86_64-linux-gnu.so
45.24
KB
-rw-r--r--
2022-01-14 04:33
_cffi_backend.cpython-310-x86_64-linux-gnu.so
189.91
KB
-rw-r--r--
2022-03-25 18:57
_dbus_bindings.cpython-310-x86_64-linux-gnu.so
164.21
KB
-rw-r--r--
2022-03-18 02:50
_dbus_glib_bindings.cpython-310-x86_64-linux-gnu.so
22.5
KB
-rw-r--r--
2022-03-18 02:50
_ldb_text.py
3.45
KB
-rw-r--r--
2020-08-28 22:28
_pyrsistent_version.py
23
B
-rw-r--r--
2022-01-15 04:50
_snack.cpython-310-x86_64-linux-gnu.so
46.77
KB
-rw-r--r--
2022-03-18 04:30
_tdb_text.py
3.27
KB
-rw-r--r--
2020-01-21 23:09
_version.py
21
B
-rw-r--r--
2014-08-26 10:11
apport_python_hook.py
7.87
KB
-rw-r--r--
2024-07-10 20:56
apt_inst.cpython-310-x86_64-linux-gnu.so
58.66
KB
-rw-r--r--
2025-12-06 02:18
apt_pkg.cpython-310-x86_64-linux-gnu.so
338.96
KB
-rw-r--r--
2025-12-06 02:18
augeas.py
23
KB
-rw-r--r--
2014-09-01 02:18
blinker-1.4.egg-info
3.81
KB
-rw-r--r--
2021-10-26 02:42
capng.py
6.09
KB
-rw-r--r--
2022-01-14 04:33
command_not_found-0.3.egg-info
189
B
-rw-r--r--
2021-12-08 19:53
configargparse.py
48.71
KB
-rw-r--r--
2021-10-03 09:15
configobj.py
87.51
KB
-rw-r--r--
2024-09-20 20:44
deb822.py
273
B
-rw-r--r--
2022-01-16 17:42
debconf.py
6.61
KB
-rw-r--r--
2022-02-20 23:42
distro_info.py
12.23
KB
-rw-r--r--
2023-11-28 21:16
gpg-1.16.0-py3.10.egg-info
2.21
KB
-rw-r--r--
2023-09-28 09:17
jsonpatch.py
28.14
KB
-rw-r--r--
2021-03-14 04:14
jsonpointer.py
9.57
KB
-rw-r--r--
2018-01-17 00:18
ldb.cpython-310-x86_64-linux-gnu.so
102.24
KB
-rw-r--r--
2023-03-30 21:16
lsb_release.py
14.55
KB
-rw-r--r--
2019-08-26 06:11
netifaces.cpython-310-x86_64-linux-gnu.so
22.69
KB
-rw-r--r--
2022-03-25 01:20
nftables-0.1-py3.10.egg-info
623
B
-rw-r--r--
2026-02-24 17:38
pexpect-4.8.0.egg-info
2.23
KB
-rw-r--r--
2021-08-09 19:01
problem_report.py
26.24
KB
-rw-r--r--
2024-07-10 20:56
pvectorc.cpython-310-x86_64-linux-gnu.so
36.67
KB
-rw-r--r--
2022-03-18 04:43
pyasn1_modules-0.2.1.egg-info
1.68
KB
-rw-r--r--
2020-04-05 09:09
pyparsing.py
266.96
KB
-rw-r--r--
2020-03-31 11:48
python_augeas-0.5.0.egg-info
238
B
-rw-r--r--
2019-10-17 11:17
six.py
33.74
KB
-rw-r--r--
2021-05-05 23:17
snack.py
30.4
KB
-rw-r--r--
2022-03-18 04:30
speedtest.py
63.6
KB
-rw-r--r--
2021-04-08 22:45
systemd_python-234.egg-info
586
B
-rw-r--r--
2022-03-18 05:07
talloc.cpython-310-x86_64-linux-gnu.so
15.63
KB
-rw-r--r--
2022-01-14 05:34
tdb.cpython-310-x86_64-linux-gnu.so
36.29
KB
-rw-r--r--
2022-01-14 05:34
ufw-0.36.1.egg-info
263
B
-rw-r--r--
2023-07-17 22:55
validate.py
46.14
KB
-rw-r--r--
2024-09-20 20:44
xkit-0.0.0.egg-info
266
B
-rw-r--r--
2022-03-24 17:20
zipp.py
6.75
KB
-rw-r--r--
2024-07-21 23:26
zope.component-4.3.0-nspkg.pth
529
B
-rw-r--r--
2019-09-21 21:28
zope.event-4.4-nspkg.pth
529
B
-rw-r--r--
2020-06-15 06:11
zope.hookable-5.1.0-nspkg.pth
529
B
-rw-r--r--
2022-03-18 05:18
zope.interface-5.4.0-nspkg.pth
529
B
-rw-r--r--
2022-03-18 02:51
Save
Rename
#!/usr/bin/python # LSB release detection module for Debian # (C) 2005-10 Chris Lawrence <lawrencc@debian.org> # (C) 2018 Didier Raboud <odyx@debian.org> # This package 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; version 2 dated June, 1991. # This package 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 package; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA # Python3-compatible print() function from __future__ import print_function import sys import subprocess import os import re import warnings import csv def get_distro_info(origin='Debian'): try: FileNotFoundException = FileNotFoundError except NameError: # There is no FileNotFoundError in python2 FileNotFoundException = IOError try: csvfile = open('/usr/share/distro-info/%s.csv' % origin.lower()) except FileNotFoundException: # Unknown distro, fallback to Debian csvfile = open('/usr/share/distro-info/debian.csv') reader = csv.DictReader(csvfile) global RELEASE_CODENAME_LOOKUP, RELEASES_ORDER, TESTING_CODENAME RELEASE_CODENAME_LOOKUP = { r['version']: r['series'] for r in reader if r['version']} RELEASES_ORDER = list(RELEASE_CODENAME_LOOKUP.items()) RELEASES_ORDER.sort(key=lambda n: float(n[0])) RELEASES_ORDER = list(list(zip(*RELEASES_ORDER))[1]) if origin.lower() == 'debian': TESTING_CODENAME = 'unknown.new.testing' RELEASES_ORDER.extend(['stable', 'proposed-updates', 'testing', 'testing-proposed-updates', 'unstable', 'sid']) csvfile.close() # Populate default distro info get_distro_info() def lookup_codename(release, unknown=None): m = re.match(r'(\d+)\.(\d+)(r(\d+))?', release) if not m: return unknown if int(m.group(1)) < 7: shortrelease = '%s.%s' % m.group(1,2) else: shortrelease = '%s' % m.group(1) return RELEASE_CODENAME_LOOKUP.get(shortrelease, unknown) # LSB compliance packages... may grow eventually PACKAGES = 'lsb-core lsb-cxx lsb-graphics lsb-desktop lsb-languages lsb-multimedia lsb-printing lsb-security' modnamere = re.compile(r'lsb-(?P<module>[a-z0-9]+)-(?P<arch>[^ ]+)(?: \(= (?P<version>[0-9.]+)\))?') def valid_lsb_versions(version, module): # If a module is ever released that only appears in >= version, deal # with that here if version == '3.0': return ['2.0', '3.0'] elif version == '3.1': if module in ('desktop', 'qt4'): return ['3.1'] elif module == 'cxx': return ['3.0', '3.1'] else: return ['2.0', '3.0', '3.1'] elif version == '3.2': if module == 'desktop': return ['3.1', '3.2'] elif module == 'qt4': return ['3.1'] elif module in ('printing', 'languages', 'multimedia'): return ['3.2'] elif module == 'cxx': return ['3.0', '3.1', '3.2'] else: return ['2.0', '3.0', '3.1', '3.2'] elif version == '4.0': if module == 'desktop': return ['3.1', '3.2', '4.0'] elif module == 'qt4': return ['3.1'] elif module in ('printing', 'languages', 'multimedia'): return ['3.2', '4.0'] elif module == 'security': return ['4.0'] elif module == 'cxx': return ['3.0', '3.1', '3.2', '4.0'] else: return ['2.0', '3.0', '3.1', '3.2', '4.0'] elif version == '4.1': if module == 'desktop': return ['3.1', '3.2', '4.0', '4.1'] elif module == 'qt4': return ['3.1'] elif module in ('printing', 'languages', 'multimedia'): return ['3.2', '4.0', '4.1'] elif module == 'security': return ['4.0', '4.1'] elif module == 'cxx': return ['3.0', '3.1', '3.2', '4.0', '4.1'] else: return ['2.0', '3.0', '3.1', '3.2', '4.0', '4.1'] return [version] try: set # introduced in 2.4 except NameError: import sets set = sets.Set # This is Debian-specific at present def check_modules_installed(): # Find which LSB modules are installed on this system C_env = os.environ.copy(); C_env['LC_ALL'] = 'C' output = subprocess.Popen(['dpkg-query','-f',"${Version} ${Provides}\n",'-W'] + PACKAGES.split(), env=C_env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True).communicate()[0].decode('utf-8') if not output: return [] modules = set() for line in output.split(os.linesep): if not line: break version, provides = line.split(' ', 1) # Debian package versions can be 3.2-$REV, 3.2+$REV or 3.2~$REV. version = re.split('[-+~]', version, 1)[0] for pkg in provides.split(','): mob = modnamere.search(pkg) if not mob: continue mgroups = mob.groupdict() # If no versioned provides... if mgroups.get('version'): module = '%(module)s-%(version)s-%(arch)s' % mgroups modules.add(module) else: module = mgroups['module'] for v in valid_lsb_versions(version, module): mgroups['version'] = v module = '%(module)s-%(version)s-%(arch)s' % mgroups modules.add(module) modules = list(modules) modules.sort() return modules longnames = {'v' : 'version', 'o': 'origin', 'a': 'suite', 'c' : 'component', 'l': 'label'} def parse_policy_line(data): retval = {} bits = data.split(',') for bit in bits: kv = bit.split('=', 1) if len(kv) > 1: k, v = kv[:2] if k in longnames: retval[longnames[k]] = v return retval def release_index(x): suite = x[1].get('suite') if suite: if suite in RELEASES_ORDER: return int(len(RELEASES_ORDER) - RELEASES_ORDER.index(suite)) else: try: return float(suite) except ValueError: return 0 return 0 def compare_release(x, y): warnings.warn('compare_release(x,y) is deprecated; please use the release_index(x) as key for sort() instead.', DeprecationWarning, stacklevel=2) suite_x_i = release_index(x) suite_y_i = release_index(y) try: return suite_x_i - suite_y_i except TypeError: return (suite_x_i > suite_y_i) - (suite_x_i < suite_y_i) def parse_apt_policy(): data = [] C_env = os.environ.copy(); C_env['LC_ALL'] = 'C.UTF-8' policy = subprocess.Popen(['apt-cache','policy'], env=C_env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True).communicate()[0].decode('utf-8') for line in policy.split('\n'): line = line.strip() m = re.match(r'(-?\d+)', line) if m: priority = int(m.group(1)) if line.startswith('release'): bits = line.split(' ', 1) if len(bits) > 1: data.append( (priority, parse_policy_line(bits[1])) ) return data def guess_release_from_apt(origin='Debian', component='main', ignoresuites=('experimental'), label='Debian', alternate_olabels={'Debian Ports': ('ftp.ports.debian.org', 'ftp.debian-ports.org')}): releases = parse_apt_policy() if not releases: return None # We only care about the specified origin, component, and label releases = [x for x in releases if ( x[1].get('origin', '') == origin and x[1].get('suite', '') not in ignoresuites and x[1].get('component', '') == component and x[1].get('label', '') == label) or ( x[1].get('origin', '') in alternate_olabels and x[1].get('label', '') in alternate_olabels.get(x[1].get('origin', '')))] # Check again to make sure we didn't wipe out all of the releases if not releases: return None releases.sort(key=lambda tuple: tuple[0],reverse=True) # We've sorted the list by descending priority, so the first entry should # be the "main" release in use on the system max_priority = releases[0][0] releases = [x for x in releases if x[0] == max_priority] releases.sort(key=release_index) return releases[0][1] def guess_debian_release(): distinfo = {} distinfo['ID'] = 'Debian' # Use /etc/dpkg/origins/default to fetch the distribution name etc_dpkg_origins_default = os.environ.get('LSB_ETC_DPKG_ORIGINS_DEFAULT','/etc/dpkg/origins/default') if os.path.exists(etc_dpkg_origins_default): try: with open(etc_dpkg_origins_default) as dpkg_origins_file: for line in dpkg_origins_file: try: (header, content) = line.split(': ', 1) header = header.lower() content = content.strip() if header == 'vendor': distinfo['ID'] = content except ValueError: pass except IOError as msg: print('Unable to open ' + etc_dpkg_origins_default + ':', str(msg), file=sys.stderr) # Populate RELEASES_ORDER for the correct distro get_distro_info(distinfo['ID']) kern = os.uname()[0] if kern in ('Linux', 'Hurd', 'NetBSD'): distinfo['OS'] = 'GNU/'+kern elif kern == 'FreeBSD': distinfo['OS'] = 'GNU/k'+kern elif kern in ('GNU/Linux', 'GNU/kFreeBSD'): distinfo['OS'] = kern else: distinfo['OS'] = 'GNU' distinfo['DESCRIPTION'] = '%(ID)s %(OS)s' % distinfo etc_debian_version = os.environ.get('LSB_ETC_DEBIAN_VERSION','/etc/debian_version') if os.path.exists(etc_debian_version): try: with open(etc_debian_version) as debian_version: release = debian_version.read().strip() except IOError as msg: print('Unable to open ' + etc_debian_version + ':', str(msg), file=sys.stderr) release = 'unknown' if not release[0:1].isalpha(): # /etc/debian_version should be numeric codename = lookup_codename(release, 'n/a') distinfo.update({ 'RELEASE' : release, 'CODENAME' : codename }) elif release.endswith('/sid'): if release.rstrip('/sid').lower() != 'testing': global TESTING_CODENAME TESTING_CODENAME = release.rstrip('/sid') distinfo['RELEASE'] = 'testing/unstable' else: distinfo['RELEASE'] = release # Only use apt information if we did not get the proper information # from /etc/debian_version or if we don't have a codename # (which will happen if /etc/debian_version does not contain a # number but some text like 'testing/unstable' or 'lenny/sid') # # This is slightly faster and less error prone in case the user # has an entry in his /etc/apt/sources.list but has not actually # upgraded the system. if not distinfo.get('CODENAME'): rinfo = guess_release_from_apt() if rinfo: release = rinfo.get('version') # Special case Debian-Ports as their Release file has 'version': '1.0' if release == '1.0' and rinfo.get('origin') == 'Debian Ports' and rinfo.get('label') in ('ftp.ports.debian.org', 'ftp.debian-ports.org'): release = None rinfo.update({'suite': 'unstable'}) if release: codename = lookup_codename(release, 'n/a') else: release = rinfo.get('suite', 'unstable') if release == 'testing': # Would be nice if I didn't have to hardcode this. codename = TESTING_CODENAME else: codename = 'sid' distinfo.update({ 'RELEASE' : release, 'CODENAME' : codename }) if distinfo.get('RELEASE'): distinfo['DESCRIPTION'] += ' %(RELEASE)s' % distinfo if distinfo.get('CODENAME'): distinfo['DESCRIPTION'] += ' (%(CODENAME)s)' % distinfo return distinfo # Whatever is guessed above can be overridden in /usr/lib/os-release by derivatives def get_os_release(): distinfo = {} os_release = os.environ.get('LSB_OS_RELEASE', '/usr/lib/os-release') if os.path.exists(os_release): try: with open(os_release) as os_release_file: for line in os_release_file: line = line.strip() if not line: continue # Skip invalid lines if not '=' in line: continue var, arg = line.split('=', 1) if arg.startswith('"') and arg.endswith('"'): arg = arg[1:-1] if arg: # Ignore empty arguments # Concert os-release to lsb-release-style if var == 'VERSION_ID': # It'll ignore point-releases distinfo['RELEASE'] = arg.strip() elif var == 'VERSION_CODENAME': distinfo['CODENAME'] = arg.strip() elif var == 'ID': # ID=debian distinfo['ID'] = arg.strip().title() elif var == 'PRETTY_NAME': distinfo['DESCRIPTION'] = arg.strip() except IOError as msg: print('Unable to open ' + os_release + ':', str(msg), file=sys.stderr) return distinfo def get_distro_information(): lsbinfo = get_os_release() # OS is only used inside guess_debian_release anyway for key in ('ID', 'RELEASE', 'CODENAME', 'DESCRIPTION',): if key not in lsbinfo: distinfo = guess_debian_release() distinfo.update(lsbinfo) return distinfo else: return lsbinfo def test(): print(get_distro_information()) print(check_modules_installed()) if __name__ == '__main__': test()