software-properties: replace deprecated lsb_release and fix style.
This commit is contained in:
parent
ccc3d1bd30
commit
7ead729db4
4 changed files with 53 additions and 9 deletions
|
|
@ -0,0 +1,14 @@
|
||||||
|
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
index d76513f7..0a08c820 100644
|
||||||
|
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
@@ -454,9 +454,6 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
|
||||||
|
else:
|
||||||
|
eol_expiry_text = _("Active until %s") % eol_date.strftime("%x")
|
||||||
|
self.label_eol.set_label(eol_expiry_text)
|
||||||
|
- self.label_esm_subscribe.set_markup(
|
||||||
|
- "<a href=\"%s\">%s</a>" % (esm_url, _("Extend…"))
|
||||||
|
- )
|
||||||
|
self.label_esm_subscribe.set_visible(
|
||||||
|
esm_available and not esm_enabled
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
index a91d2595..940fd790 100644
|
||||||
|
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
@@ -251,9 +251,6 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
|
||||||
|
self.show_distro()
|
||||||
|
# Setup and show the Additonal Drivers tab
|
||||||
|
self.init_drivers()
|
||||||
|
- # Setup and show the Trisquel Pro tab if the serie is a LTS
|
||||||
|
- if is_current_distro_lts():
|
||||||
|
- self.init_ubuntu_pro()
|
||||||
|
|
||||||
|
# Connect to switch-page before setting initial tab. Otherwise the
|
||||||
|
# first switch goes unnoticed.
|
||||||
|
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
index c18bcd09..15f78ef3 100644
|
||||||
|
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
@@ -1636,5 +1636,3 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
|
||||||
|
else:
|
||||||
|
self.label_driver_action.set_label(_("No proprietary drivers are in use."))
|
||||||
|
|
||||||
|
- def init_ubuntu_pro(self):
|
||||||
|
- self.ubuntu_pro_page = TrisquelProPage(self)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021 Luis Guzman <ark@switnet.org>
|
# Copyright (C) 2024 Luis Guzman <ark@switnet.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -16,12 +16,15 @@
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# replaced lsb_release in favor of distro
|
||||||
import csv
|
import csv
|
||||||
import lsb_release
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from distro import distro
|
||||||
|
|
||||||
release_name = lsb_release.get_distro_information()['CODENAME']
|
release_name = distro.codename()
|
||||||
release_description = lsb_release.get_distro_information()['DESCRIPTION']
|
release_description = distro.name(pretty=True)
|
||||||
|
#print(release_name)
|
||||||
|
#print(release_description)
|
||||||
|
|
||||||
def trisquel_eol():
|
def trisquel_eol():
|
||||||
with open('/usr/share/distro-info/trisquel.csv', 'r') as distro_data:
|
with open('/usr/share/distro-info/trisquel.csv', 'r') as distro_data:
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
VERSION=15
|
VERSION=16
|
||||||
|
|
||||||
. ./config
|
. ./config
|
||||||
|
|
||||||
|
|
@ -33,7 +33,8 @@ patch_p1 $DATA/remove_snap_label.patch
|
||||||
|
|
||||||
#Python specific changes
|
#Python specific changes
|
||||||
cp $DATA/trisquel_info.py softwareproperties/
|
cp $DATA/trisquel_info.py softwareproperties/
|
||||||
sed -i '/import softwareproperties.SoftwareProperties/a from softwareproperties.trisquel_info import trisquel_rel_desc, trisquel_eol' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
sed -i '/import softwareproperties.SoftwareProperties/a from softwareproperties.trisquel_info import trisquel_rel_desc, trisquel_eol' \
|
||||||
|
softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
sed -i 's|eol_date = distro.eol|eol_date = trisquel_eol|' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
sed -i 's|eol_date = distro.eol|eol_date = trisquel_eol|' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
sed -i 's|eol_text = .*|eol_text = trisquel_rel_desc|' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
sed -i 's|eol_text = .*|eol_text = trisquel_rel_desc|' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
#Allow to start and remove drivers tab for qt flavor
|
#Allow to start and remove drivers tab for qt flavor
|
||||||
|
|
@ -71,8 +72,8 @@ sed -i '/software-properties-livepatch.desktop.in/d' setup.cfg
|
||||||
sed -i '/software-properties-livepatch.desktop/s|^|#|' debian/software-properties-gtk.install
|
sed -i '/software-properties-livepatch.desktop/s|^|#|' debian/software-properties-gtk.install
|
||||||
|
|
||||||
#Remove ProPage
|
#Remove ProPage
|
||||||
sed -i '/TrisquelProPage/d' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
patch_p1 $DATA/rm_init_ubuntu_pro_if_lts.patch
|
||||||
sed -i '/init_ubuntu_pro/d' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
sed -i '/.TrisquelProPage/d' softwareproperties/gtk/SoftwarePropertiesGtk.py
|
||||||
|
|
||||||
#Livepatch - aramo
|
#Livepatch - aramo
|
||||||
patch_p1 $DATA/remove_ubuntu_suscription_tab.patch
|
patch_p1 $DATA/remove_ubuntu_suscription_tab.patch
|
||||||
|
|
@ -81,12 +82,14 @@ patch_p1 $DATA/remove_proposed_updates.patch
|
||||||
patch_p1 $DATA/fix_PPA_upstream_codename.patch
|
patch_p1 $DATA/fix_PPA_upstream_codename.patch
|
||||||
#Fix mention of "other packages" as we don't distribute snap.
|
#Fix mention of "other packages" as we don't distribute snap.
|
||||||
patch_p1 $DATA/removal_of_snaps_other_packages_referral.patch
|
patch_p1 $DATA/removal_of_snaps_other_packages_referral.patch
|
||||||
|
# Remove extend esm url from update tabs
|
||||||
|
patch_p1 $DATA/rm_extend_esm_url_link.patch
|
||||||
|
|
||||||
# Trisquel l10n modifications using git patches.
|
# Trisquel l10n modifications using git patches.
|
||||||
for patch in $(ls -v ${DATA}/l10n/*.patch)
|
for patch in $(ls -v ${DATA}/l10n/*.patch)
|
||||||
do
|
do
|
||||||
echo "> Applying $(echo $patch|xargs basename)"
|
echo "> Applying $(echo $patch|xargs basename)"
|
||||||
patch --no-backup-if-mismatch -Np1 < $patch
|
patch_p1 $patch
|
||||||
done
|
done
|
||||||
|
|
||||||
changelog "Removed Ubuntu-specifc tests, Livepatch, Snap and fix PPA integration."
|
changelog "Removed Ubuntu-specifc tests, Livepatch, Snap and fix PPA integration."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue