From fc05e6d767a4065f1fc82096d980bbfc9d7b68f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luis=20Guzm=C3=A1n?= <ark@switnet.org>
Date: Tue, 16 Nov 2021 03:51:21 +0000
Subject: [PATCH] Fix software properties

---
 ...=> remove_livepatch_from_gtk_uiv1_1.patch} | 40 +++++++++++++++----
 helpers/make-software-properties              |  5 ++-
 2 files changed, 36 insertions(+), 9 deletions(-)
 rename helpers/DATA/software-properties/{remove_livepatch_from_gtk_ui.patch => remove_livepatch_from_gtk_uiv1_1.patch} (85%)

diff --git a/helpers/DATA/software-properties/remove_livepatch_from_gtk_ui.patch b/helpers/DATA/software-properties/remove_livepatch_from_gtk_uiv1_1.patch
similarity index 85%
rename from helpers/DATA/software-properties/remove_livepatch_from_gtk_ui.patch
rename to helpers/DATA/software-properties/remove_livepatch_from_gtk_uiv1_1.patch
index 23200e05..f5704740 100644
--- a/helpers/DATA/software-properties/remove_livepatch_from_gtk_ui.patch
+++ b/helpers/DATA/software-properties/remove_livepatch_from_gtk_uiv1_1.patch
@@ -1,6 +1,7 @@
---- data/gtkbuilder/main.ui	2019-09-08 00:59:05.221188984 -0700
-+++ data/gtkbuilder/main.ui	2019-09-08 00:56:52.294542817 -0700
-@@ -1116,231 +1116,6 @@
+diff -Nru software-properties-0.99.9.8/data/gtkbuilder/main.ui software-properties-0.99.9.8_new/data/gtkbuilder/main.ui
+--- software-properties-0.99.9.8/data/gtkbuilder/main.ui	2021-10-26 07:27:56.000000000 -0500
++++ software-properties-0.99.9.8_new/data/gtkbuilder/main.ui	2021-11-15 21:32:20.534728294 -0600
+@@ -1241,256 +1241,6 @@
                  <property name="tab_fill">False</property>
                </packing>
              </child>
@@ -12,6 +13,35 @@
 -                <property name="orientation">vertical</property>
 -                <property name="spacing">12</property>
 -                <child>
+-                  <object class="GtkInfoBar" id="info_bar_ubuntu_pro">
+-                    <property name="visible">True</property>
+-                    <property name="show-close-button">True</property>
+-                    <signal name="response" handler="on_info_bar_ubuntu_pro_response" swapped="no"/>
+-                    <child internal-child="content_area">
+-                      <object class="GtkBox">
+-                        <property name="visible">True</property>
+-                        <property name="orientation">vertical</property>
+-                        <child>
+-                          <object class="GtkLabel">
+-                            <property name="visible">True</property>
+-                            <property name="label" translatable="yes">&lt;b&gt;Preview: Ubuntu Pro for Desktop&lt;/b&gt;. Automatic security updates to over 30,000 open source software packages.</property>
+-                            <property name="use_markup">True</property>
+-                            <property name="xalign">0</property>
+-                          </object>
+-                        </child>
+-                        <child>
+-                          <object class="GtkLabel">
+-                            <property name="visible">True</property>
+-                            <property name="label">&lt;a href="http://ubuntu.com/advantage"&gt;Join the beta programme&lt;/a&gt;.</property>
+-                            <property name="use_markup">True</property>
+-                            <property name="xalign">0</property>
+-                          </object>
+-                        </child>
+-                      </object>
+-                    </child>
+-                  </object>
+-                </child>
+-                <child>
 -                  <object class="GtkLabel" id="label_livepatch_description">
 -                    <property name="visible">True</property>
 -                    <property name="can_focus">False</property>
@@ -24,7 +54,6 @@
 -                  <packing>
 -                    <property name="expand">False</property>
 -                    <property name="fill">True</property>
--                    <property name="position">0</property>
 -                  </packing>
 -                </child>
 -                <child>
@@ -81,7 +110,6 @@
 -                  <packing>
 -                    <property name="expand">False</property>
 -                    <property name="fill">True</property>
--                    <property name="position">1</property>
 -                  </packing>
 -                </child>
 -                <child>
@@ -193,7 +221,6 @@
 -                  <packing>
 -                    <property name="expand">True</property>
 -                    <property name="fill">True</property>
--                    <property name="position">2</property>
 -                  </packing>
 -                </child>
 -                <child>
@@ -210,7 +237,6 @@
 -                    <property name="expand">False</property>
 -                    <property name="fill">True</property>
 -                    <property name="pack_type">end</property>
--                    <property name="position">3</property>
 -                  </packing>
 -                </child>
 -              </object>
diff --git a/helpers/make-software-properties b/helpers/make-software-properties
index 6b1b092d..58de8924 100644
--- a/helpers/make-software-properties
+++ b/helpers/make-software-properties
@@ -49,6 +49,9 @@ cat << EOF | patch -p1
      debsrc_line = debsrc_entry_type + deb_line[3:]
 EOF
 
+patch -p1 < $DATA/remove_livepatch_from_gtk_uiv1_1.patch
+patch -p1 < $DATA/disable-livepatch.patch
+
 sed '/UbuntuDrivers/d' -i softwareproperties/gtk/SoftwarePropertiesGtk.py
 sed '/vbox_drivers/,+1 s/True/False/' -i data/gtkbuilder/main.ui
 
@@ -69,8 +72,6 @@ rm -rf tests
 
 sed '/gir1.2-snapd-1/d' -i debian/control
 sed '/self.init_livepatch/d' -i softwareproperties/gtk/SoftwarePropertiesGtk.py
-patch -p0 < $DATA/remove_livepatch_from_gtk_ui.patch
-patch -p1 < $DATA/disable-livepatch.patch
 sed 's/status = self.get_status()/status = Snapd.SnapStatus.UNKNOWN/' -i softwareproperties/LivepatchSnap.py
 
 rm data/software-properties-drivers.desktop.in
-- 
GitLab