From 0207425fed5380bfaaf47fba2ef2e17025253c1a Mon Sep 17 00:00:00 2001
From: Luis Guzman <ark@switnet.org>
Date: Wed, 6 Apr 2022 11:02:38 -0500
Subject: [PATCH] Mention distro-info-data dependency.

---
 .../distro-info/.distro_info_py.patch.swp     | Bin 0 -> 1024 bytes
 .../DATA/distro-info/distro-info-util_c.patch |  57 +++++++++++-------
 helpers/DATA/distro-info/distro_info_py.patch |  38 ++++++------
 helpers/make-distro-info                      |   1 +
 4 files changed, 55 insertions(+), 41 deletions(-)
 create mode 100644 helpers/DATA/distro-info/.distro_info_py.patch.swp

diff --git a/helpers/DATA/distro-info/.distro_info_py.patch.swp b/helpers/DATA/distro-info/.distro_info_py.patch.swp
new file mode 100644
index 0000000000000000000000000000000000000000..10b01415d4211b3e9e1bc817506a4941c233ff47
GIT binary patch
literal 1024
zcmYc?$V<%2S1{7E)H7y40)5F042ebANFunIC8@ausl_F@6+mTN977!SQ!<N7it=?c
h^V0I6?0676zMxXCAh9GlgP<v+3PwX<Gz6#>0su#K7M1`2

literal 0
HcmV?d00001

diff --git a/helpers/DATA/distro-info/distro-info-util_c.patch b/helpers/DATA/distro-info/distro-info-util_c.patch
index 690754ff0..fde54f21b 100644
--- a/helpers/DATA/distro-info/distro-info-util_c.patch
+++ b/helpers/DATA/distro-info/distro-info-util_c.patch
@@ -1,34 +1,45 @@
-diff -Nru source/distro-info-util.c source_b/distro-info-util.c
---- source/distro-info-util.c	2019-03-07 13:33:56.000000000 -0600
-+++ source_b/distro-info-util.c	2021-12-17 09:47:58.217720979 -0600
-@@ -545,7 +545,7 @@
+--- source/distro-info-util.c	2021-11-04 15:27:37.000000000 -0600
++++ source/distro-info-util.c_fix	2022-04-06 10:00:23.394992023 -0500
+@@ -423,10 +423,6 @@
+         free(list->distro->milestones[MILESTONE_EOL_LTS]);
+         free(list->distro->milestones[MILESTONE_EOL_ELTS]);
  #endif
-            "  -a  --all              list all known versions\n"
-            "  -d  --devel            latest development version\n"
+-#ifdef UBUNTU
+-        free(list->distro->milestones[MILESTONE_EOL_SERVER]);
+-        free(list->distro->milestones[MILESTONE_EOL_ESM]);
+-#endif
+         free(list->distro);
+         free(list);
+         list = next;
+@@ -581,7 +577,7 @@
+            "  -t  --testing          current testing version\n"
+ #endif
+            "  -s  --stable           latest stable version\n"
 -#ifdef UBUNTU
 +#ifdef TRISQUEL
             "      --lts              latest long term support (LTS) version\n"
  #endif
  #ifdef DEBIAN
-@@ -553,9 +553,6 @@
+@@ -592,9 +588,6 @@
+            "  -l  --lts              list of all LTS supported versions\n"
+            "  -e  --elts             list of all Extended LTS supported versions\n"
  #endif
-            "  -s  --stable           latest stable version\n"
-            "      --supported        list of all supported stable versions\n"
 -#ifdef UBUNTU
 -           "      --supported-esm    list of all Ubuntu Advantage supported stable versions\n"
 -#endif
+            "      --unsupported      list of all unsupported stable versions\n"
+            "  -c  --codename         print the codename (default)\n"
+            "  -f  --fullname         print the full name\n"
+@@ -612,7 +605,7 @@
  #ifdef DEBIAN
-            "  -t  --testing          current testing version\n"
+             "--elts, "
  #endif
-@@ -573,16 +570,13 @@
-             "--alias, "
- #endif
-             "--all, --devel, "
 -#ifdef UBUNTU
 +#ifdef TRISQUEL
-             "--latest, --lts, "
+             "--latest, "
  #endif
- #ifdef DEBIAN
+             "--lts, "
+@@ -620,9 +613,6 @@
              "--oldstable, "
  #endif
              "--stable, --supported, "
@@ -38,7 +49,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
              "--series, "
  #ifdef DEBIAN
              "--testing, "
-@@ -611,7 +605,7 @@
+@@ -651,7 +641,7 @@
  #ifdef DEBIAN
      char *alias_codename = NULL;
  #endif
@@ -47,7 +58,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
      bool filter_latest = false;
  #endif
  
-@@ -624,9 +618,6 @@
+@@ -664,9 +654,6 @@
          {"devel",         no_argument,       NULL, 'd' },
          {"stable",        no_argument,       NULL, 's' },
          {"supported",     no_argument,       NULL, 'S' },
@@ -57,7 +68,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
          {"unsupported",   no_argument,       NULL, 'U' },
          {"codename",      no_argument,       NULL, 'c' },
          {"fullname",      no_argument,       NULL, 'f' },
-@@ -636,14 +627,14 @@
+@@ -678,14 +665,14 @@
          {"oldstable",     no_argument,       NULL, 'o' },
          {"testing",       no_argument,       NULL, 't' },
  #endif
@@ -74,7 +85,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
      const char *short_options = "hadscrfly::";
  #endif
  #ifdef DEBIAN
-@@ -689,7 +680,7 @@
+@@ -731,7 +718,7 @@
              case 'd':
                  selected_filters++;
                  filter_cb = filter_devel;
@@ -83,7 +94,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
                  select_cb = select_latest_created;
  #endif
  #ifdef DEBIAN
-@@ -740,7 +731,7 @@
+@@ -782,7 +769,7 @@
                  free(date);
                  return EXIT_SUCCESS;
  
@@ -92,7 +103,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
              case 'l':
                  selected_filters++;
                  filter_latest = true;
-@@ -782,15 +773,6 @@
+@@ -836,15 +823,6 @@
                  select_cb = NULL;
                  break;
  
@@ -108,7 +119,7 @@ diff -Nru source/distro-info-util.c source_b/distro-info-util.c
  #ifdef DEBIAN
              case 't':
                  selected_filters++;
-@@ -922,7 +904,7 @@
+@@ -976,7 +954,7 @@
              selected = select_series(distro_list, series_name);
          } else {
              selected = get_distro(distro_list, date, filter_cb, select_cb);
diff --git a/helpers/DATA/distro-info/distro_info_py.patch b/helpers/DATA/distro-info/distro_info_py.patch
index d3cd5a96f..efd916b97 100644
--- a/helpers/DATA/distro-info/distro_info_py.patch
+++ b/helpers/DATA/distro-info/distro_info_py.patch
@@ -1,6 +1,5 @@
-diff -Nru source/python/distro_info.py source_b/python/distro_info.py
---- source/python/distro_info.py	2019-03-07 13:33:56.000000000 -0600
-+++ source_b/python/distro_info.py	2021-12-17 15:44:54.509722643 -0600
+--- source/python/distro_info.py	2021-11-04 15:27:37.000000000 -0600
++++ source/python/distro_info.py_fix	2022-04-06 10:20:39.217365952 -0500
 @@ -1,3 +1,4 @@
 +# Copyright (C) 2021, Trisquel GNU/Linux developers <trisquel-devel@listas.trisquel.info>
  # Copyright (C) 2009-2012, Benjamin Drung <bdrung@debian.org>
@@ -15,17 +14,17 @@ diff -Nru source/python/distro_info.py source_b/python/distro_info.py
  
  import csv
  import datetime
-@@ -83,7 +84,7 @@
+@@ -100,7 +101,7 @@
  
- class DistroInfo(object):
+ class DistroInfo:
      """Base class for distribution information.
 -    Use DebianDistroInfo or UbuntuDistroInfo instead of using this directly.
 +    Use DebianDistroInfo or TrisquelDistroInfo instead of using this directly.
      """
  
      def __init__(self, distro):
-@@ -237,14 +238,14 @@
-                 codename in ["unstable", "testing", "stable", "oldstable"])
+@@ -311,14 +312,14 @@
+         ]
  
  
 -class UbuntuDistroInfo(DistroInfo):
@@ -34,34 +33,37 @@ diff -Nru source/python/distro_info.py source_b/python/distro_info.py
 +    """provides information about Trisquel's distributions"""
  
      def __init__(self):
--        super(UbuntuDistroInfo, self).__init__("Ubuntu")
-+        super(TrisquelDistroInfo, self).__init__("Trisquel")
+-        super().__init__("Ubuntu")
++        super().__init__("Trisquel")
  
      def lts(self, date=None, result="codename"):
 -        """Get latest long term support (LTS) Ubuntu distribution based on the
 +        """Get latest long term support (LTS) Trisquel distribution based on the
-            given date."""
+         given date."""
          if date is None:
              date = self._date
-@@ -262,7 +263,7 @@
+@@ -337,7 +338,7 @@
          return "LTS" in distros[0].version
  
      def supported(self, date=None, result="codename"):
 -        """Get list of all supported Ubuntu distributions based on the given
 +        """Get list of all supported Trisquel distributions based on the given
-            date."""
+         date."""
          if date is None:
              date = self._date
-@@ -270,12 +271,3 @@
-                    if date <= x.eol or
-                    (x.eol_server is not None and date <= x.eol_server)]
+@@ -347,15 +348,3 @@
+             if date <= x.eol or (x.eol_server is not None and date <= x.eol_server)
+         ]
          return distros
 -
 -    def supported_esm(self, date=None, result="codename"):
 -        """Get list of all ESM supported Ubuntu distributions based on the
--           given date."""
+-        given date."""
 -        if date is None:
 -            date = self._date
--        distros = [self._format(result, x) for x in self._avail(date)
--                   if x.eol_esm is not None and date <= x.eol_esm]
+-        distros = [
+-            self._format(result, x)
+-            for x in self._avail(date)
+-            if x.eol_esm is not None and date <= x.eol_esm
+-        ]
 -        return distros
diff --git a/helpers/make-distro-info b/helpers/make-distro-info
index 5b837e304..f30eeeed7 100644
--- a/helpers/make-distro-info
+++ b/helpers/make-distro-info
@@ -18,6 +18,7 @@
 #
 
 VERSION=1
+DEPENDS=distro-info-data
 
 . ./config
 
-- 
GitLab