summaryrefslogtreecommitdiff
path: root/libre/octopi/parabola-support.patch
blob: 1e0d882919bdd58665b518972365a1990b8fb724 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
diff -Nur octopi-0.7.0.orig/src/mainwindow_news.cpp octopi-0.7.0/src/mainwindow_news.cpp
--- octopi-0.7.0.orig/src/mainwindow_news.cpp	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/mainwindow_news.cpp	2015-07-09 10:53:40.713803510 -0300
@@ -92,6 +92,11 @@
       writeToTabOutputExt("<b>" +
                           StrConstants::getSearchingForDistroNews().arg("Netrunner Rolling") + "</b>");
     }
+    else if (gotoNewsTab && distro == ectn_PARABOLA)
+    {
+      writeToTabOutputExt("<b>" +
+                          StrConstants::getSearchingForDistroNews().arg("Parabola GNU/Linux-libre") + "</b>");
+    }
 
     /*
      * Here, we retrieve distro's latest news without
diff -Nur octopi-0.7.0.orig/src/package.cpp octopi-0.7.0/src/package.cpp
--- octopi-0.7.0.orig/src/package.cpp	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/package.cpp	2015-07-09 10:53:40.713803510 -0300
@@ -1154,7 +1154,8 @@
   else if (UnixCommand::getLinuxDistro() == ectn_ARCHBANGLINUX ||
            UnixCommand::getLinuxDistro() == ectn_ARCHLINUX ||
            UnixCommand::getLinuxDistro() == ectn_KAOS ||
-           UnixCommand::getLinuxDistro() == ectn_MOOOSLINUX)
+           UnixCommand::getLinuxDistro() == ectn_MOOOSLINUX ||
+           UnixCommand::getLinuxDistro() == ectn_PARABOLA)
   {
     result = UnixCommand::getPackageContentsUsingPkgfile(pkgName);
   }
diff -Nur octopi-0.7.0.orig/src/strconstants.h octopi-0.7.0/src/strconstants.h
--- octopi-0.7.0.orig/src/strconstants.h	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/strconstants.h	2015-07-09 11:10:32.856845110 -0300
@@ -60,6 +60,9 @@
     if (UnixCommand::getLinuxDistro() == ectn_KAOS)
       return QLatin1String( "KCP" );
 
+    if (UnixCommand::getLinuxDistro() == ectn_PARABOLA)
+      return QLatin1String( "Custom" );
+
     return QLatin1String( "AUR" );
   }
 
@@ -68,6 +71,8 @@
       return QLatin1String( "ccr" );
     else if (UnixCommand::getLinuxDistro() == ectn_KAOS)
       return QLatin1String( "kcp" );
+    else if (UnixCommand::getLinuxDistro() == ectn_PARABOLA)
+      return QLatin1String( "custom" );
 
     return QLatin1String( "aur" );
   }
@@ -85,6 +90,8 @@
         ret = QLatin1String( "kcp" );
       else if (UnixCommand::hasTheExecutable("pacaur"))
         ret = QLatin1String( "pacaur" );
+      else if (UnixCommand::getLinuxDistro() == ectn_PARABOLA)
+        ret = QLatin1String( "custom" );
       else
         ret = QLatin1String( "yaourt" );
 
@@ -100,6 +107,8 @@
       return QLatin1String( "Ccr" );
     else if (UnixCommand::getLinuxDistro() == ectn_KAOS)
       return QLatin1String( "KCP" );
+    else if (UnixCommand::getLinuxDistro() == ectn_PARABOLA)
+      return QLatin1String( "Custom" );
 
     return QLatin1String( "AUR" );
   }
@@ -110,6 +119,8 @@
       return QLatin1String( "ccr/" );
     else if (UnixCommand::getLinuxDistro() == ectn_KAOS)
       return "kcp/";
+    else if (UnixCommand::getLinuxDistro() == ectn_PARABOLA)
+      return "custom/";
 
     return QLatin1String( "aur/" );
   }
@@ -142,12 +153,16 @@
     return QObject::tr("Netrunner Rolling news");
   }
 
+  static QString getParabolaNews(){
+    return QObject::tr("Parabola GNU/Linux-libre news");
+  }
+
   static QString getNewsErrorMessage(){
     return QObject::tr("No news could be found! Press Ctrl+G to download the latest news.");
   }
 
   static QString getIncompatibleLinuxDistroError(){
-    return QObject::tr("This Linux distro seems to be incompatible with Octopi!");
+    return QObject::tr("This GNU/Linux distro seems to be incompatible with Octopi!");
   }
 
   static QString getInternetUnavailableError(){
diff -Nur octopi-0.7.0.orig/src/unixcommand.cpp octopi-0.7.0/src/unixcommand.cpp
--- octopi-0.7.0.orig/src/unixcommand.cpp	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/unixcommand.cpp	2015-07-09 10:53:40.717136678 -0300
@@ -1036,6 +1036,10 @@
       {
         ret = ectn_NETRUNNER;
       }
+      else if (contents.contains(QRegExp("Parabola GNU/Linux-libre")))
+      {
+        ret = ectn_PARABOLA;
+      }
       else
       {
         ret = ectn_UNKNOWN;
diff -Nur octopi-0.7.0.orig/src/unixcommand.h octopi-0.7.0/src/unixcommand.h
--- octopi-0.7.0.orig/src/unixcommand.h	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/unixcommand.h	2015-07-09 10:53:40.717136678 -0300
@@ -37,7 +37,7 @@
                         ectn_RUN_IN_TERMINAL };
 
 enum LinuxDistro { ectn_ANTERGOS, ectn_ARCHBANGLINUX, ectn_ARCHBSD, ectn_ARCHLINUX, ectn_CHAKRA,
-                   ectn_KAOS, ectn_MANJAROLINUX, ectn_MOOOSLINUX, ectn_NETRUNNER, ectn_UNKNOWN };
+                   ectn_KAOS, ectn_MANJAROLINUX, ectn_MOOOSLINUX, ectn_NETRUNNER, ectn_PARABOLA, ectn_UNKNOWN };
 
 enum Language { ectn_LANG_ENGLISH, ectn_LANG_USER_DEFINED };
 
diff -Nur octopi-0.7.0.orig/src/utils.cpp octopi-0.7.0/src/utils.cpp
--- octopi-0.7.0.orig/src/utils.cpp	2015-04-27 20:05:43.000000000 -0300
+++ octopi-0.7.0/src/utils.cpp	2015-07-09 11:21:49.993222650 -0300
@@ -278,6 +278,7 @@
   //const QString ctn_MANJARO_LINUX_RSS_URL = "http://manjaro.org/feed/";
   const QString ctn_MANJARO_LINUX_RSS_URL = "https://manjaro.github.io/feed.xml";
   const QString ctn_NETRUNNER_RSS_URL = "http://www.netrunner-os.com/feed/";
+  const QString ctn_PARABOLA_RSS_URL = "https://www.parabola.nu/feeds/news/";
 
   LinuxDistro distro = UnixCommand::getLinuxDistro();
   QString res;
@@ -326,6 +327,10 @@
     {
       curlCommand = curlCommand.arg(ctn_NETRUNNER_RSS_URL).arg(tmpRssPath);
     }
+    else if (distro == ectn_PARABOLA)
+    {
+      curlCommand = curlCommand.arg(ctn_PARABOLA_RSS_URL).arg(tmpRssPath);
+    }
 
     if (UnixCommand::runCurlCommand(curlCommand).isEmpty())
     {
@@ -438,6 +443,10 @@
   {
     html = "<p align=\"center\"><h2>" + StrConstants::getNetrunnerNews() + "</h2></p><ul>";
   }
+  else if (distro == ectn_PARABOLA)
+  {
+    html = "<p align=\"center\"><h2>" + StrConstants::getParabolaNews() + "</h2></p><ul>";
+  }
 
   QString rssPath = QDir::homePath() + QDir::separator() + ".config/octopi/distro_rss.xml";
   QDomDocument doc("rss");