Ubuntu Pastebin

Paste from LaMont Jones at Wed, 6 Apr 2016 16:47:36 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff -ur t/distro-info-0.14build1/distro-info-util.c distro-info-0.14build1/distro-info-util.c
--- t/distro-info-0.14build1/distro-info-util.c	2014-10-21 02:06:31.000000000 -0600
+++ distro-info-0.14build1/distro-info-util.c	2016-04-06 10:45:57.935215287 -0600
@@ -587,6 +587,8 @@
 #endif
 #ifdef UBUNTU
     bool filter_latest = false;
+    bool lts_option = false;
+    bool devel_option = false;
 #endif
 
     const struct option long_options[] = {
@@ -661,7 +663,12 @@
                 selected_filters++;
                 filter_cb = filter_devel;
 #ifdef UBUNTU
-                select_cb = select_latest_created;
+                devel_option = true;
+                if (lts_option) {
+                    select_cb = select_latest_created;
+                    filter_cb = filter_lts_with_devel;
+                    selected_filters--;
+                }
 #endif
 #ifdef DEBIAN
                 select_cb = select_first;
@@ -722,8 +729,15 @@
             case 'L':
                 // Only long option --lts is used
                 selected_filters++;
-                filter_cb = filter_lts;
-                select_cb = select_latest_release;
+                lts_option = true;
+                if (unlikely(devel_option)) {
+                    select_cb = select_latest_created;
+                    filter_cb = filter_lts_with_devel;
+                    selected_filters--;
+                } else {
+                    select_cb = select_latest_release;
+                    filter_cb = filter_lts;
+                }
                 break;
 #endif
 
diff -ur t/distro-info-0.14build1/ubuntu-distro-info.c distro-info-0.14build1/ubuntu-distro-info.c
--- t/distro-info-0.14build1/ubuntu-distro-info.c	2014-10-21 01:58:51.000000000 -0600
+++ distro-info-0.14build1/ubuntu-distro-info.c	2016-04-06 10:46:17.159215779 -0600
@@ -34,4 +34,8 @@
            released(date, distro) && !eol(date, distro);
 }
 
+static bool filter_lts_with_devel(const date_t *date, const distro_t *distro) {
+    return strstr(distro->version, "LTS") != NULL && !eol(date, distro);
+}
+
 #include "distro-info-util.c"
Download as text