Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fastfetch for openSUSE:Factory 
checked in at 2024-04-04 22:26:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fastfetch (Old)
 and      /work/SRC/openSUSE:Factory/.fastfetch.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fastfetch"

Thu Apr  4 22:26:14 2024 rev:22 rq:1164456 version:2.9.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/fastfetch/fastfetch.changes      2024-03-25 
21:19:11.781653733 +0100
+++ /work/SRC/openSUSE:Factory/.fastfetch.new.1905/fastfetch.changes    
2024-04-04 22:27:25.317880745 +0200
@@ -1,0 +2,16 @@
+Thu Apr  4 04:54:12 UTC 2024 - Gordon Leung <piratec...@protonmail.com>
+
+- update to 2.9.0:
+  Features:
+    * Support Lxterminal version detection (Terminal, Linux)
+    * Support weston-terminal version and font detection (TerminalFont, Linux)
+    * Support am package manager detection (Packages, Linux)
+    * Support network prefix length detection for IPv6 (LocalIP)
+    * Display all IPs when multiple IPs are assigned to the same interface 
(LocalIP)
+    * Add option --localip-show-prefix-len to show network prefix length for 
both IPv4 and IPv6. Defaults to true (LocalIP)
+  Bugfixes:
+    * Fix network prefix length detection when the value is greater than 24 
(LocalIP, Linux)
+    * For xfce4-terminal, use system mono font if no config file is found 
(TerminalFont, Linux)
+
+
+-------------------------------------------------------------------

Old:
----
  fastfetch-2.8.10.tar.gz

New:
----
  fastfetch-2.9.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fastfetch.spec ++++++
--- /var/tmp/diff_new_pack.54C200/_old  2024-04-04 22:27:25.845900185 +0200
+++ /var/tmp/diff_new_pack.54C200/_new  2024-04-04 22:27:25.849900331 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           fastfetch
-Version:        2.8.10
+Version:        2.9.0
 Release:        0
 Summary:        Neofetch-like tool written mostly in C
 License:        MIT

++++++ fastfetch-2.8.10.tar.gz -> fastfetch-2.9.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/CHANGELOG.md 
new/fastfetch-2.9.0/CHANGELOG.md
--- old/fastfetch-2.8.10/CHANGELOG.md   2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/CHANGELOG.md    2024-04-04 06:24:44.000000000 +0200
@@ -1,11 +1,18 @@
-# 2.8.10
+# 2.9.0
 
-Changes:
-* Use MS-DOS device name as mountFrom result, instead of useless GUID volume 
name (Windows, Disk)
-* Some adjustments to Terminal detection (Terminal, Windows)
-    * Don't pretty print CMD
-    * Print conhost as Windows Console
-    * Don't detect `wininit` as Terminal
+Features:
+* Support Lxterminal version detection (Terminal, Linux)
+* Support weston-terminal version and font detection (TerminalFont, Linux)
+* Support `am` package manager detection (#771, Packages, Linux)
+* Support network prefix length detection for IPv6 (LocalIP)
+* Display all IPs when multiple IPs are assigned to the same interface 
(LocalIP)
+* Add option `--localip-show-prefix-len` to show network prefix length for 
both IPv4 and IPv6. Defaults to `true` (LocalIP)
+
+Bugfixes:
+* Fix network prefix length detection when the value is greater than 24 (#773, 
LocalIP, Linux)
+* For xfce4-terminal, use system mono font if no config file is found 
(TerminalFont, Linux)
+
+# 2.8.10
 
 Bugfixes:
 * Don't display 0.00 GHz (CPU, FreeBSD)
@@ -17,6 +24,11 @@
 
 Features:
 * Improve stability; print more useful error message; avoid misuse (PublicIP / 
Weather)
+* Use MS-DOS device name as mountFrom result, instead of useless GUID volume 
name (Windows, Disk)
+* Some adjustments to Terminal detection (Terminal, Windows)
+    * Don't pretty print CMD
+    * Print conhost as Windows Console
+    * Don't detect `wininit` as Terminal
 
 Logo:
 * Fix color of Arco Linux
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/CMakeLists.txt 
new/fastfetch-2.9.0/CMakeLists.txt
--- old/fastfetch-2.8.10/CMakeLists.txt 2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/CMakeLists.txt  2024-04-04 06:24:44.000000000 +0200
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT 
libs & project homepage url
 
 project(fastfetch
-    VERSION 2.8.10
+    VERSION 2.9.0
     LANGUAGES C
     DESCRIPTION "Fast neofetch-like system information tool"
     HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/debian/changelog 
new/fastfetch-2.9.0/debian/changelog
--- old/fastfetch-2.8.10/debian/changelog       2024-03-25 07:22:43.000000000 
+0100
+++ new/fastfetch-2.9.0/debian/changelog        2024-04-04 06:24:44.000000000 
+0200
@@ -1,3 +1,9 @@
+fastfetch (2.8.10) jammy; urgency=medium
+
+  * Update to 2.8.10
+
+ -- Carter Li <zhangsong...@live.cn>  Mon, 25 Mar 2024 15:01:53 +0800
+
 fastfetch (2.8.9) jammy; urgency=medium
 
   * Update to 2.8.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/debian/files 
new/fastfetch-2.9.0/debian/files
--- old/fastfetch-2.8.10/debian/files   2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/debian/files    2024-04-04 06:24:44.000000000 +0200
@@ -1 +1 @@
-fastfetch_2.8.9_source.buildinfo universe/utils optional
+fastfetch_2.8.10_source.buildinfo universe/utils optional
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/doc/json_schema.json 
new/fastfetch-2.9.0/doc/json_schema.json
--- old/fastfetch-2.8.10/doc/json_schema.json   2024-03-25 07:22:43.000000000 
+0100
+++ new/fastfetch-2.9.0/doc/json_schema.json    2024-04-04 06:24:44.000000000 
+0200
@@ -1438,6 +1438,11 @@
                                         "type": "boolean",
                                         "default": false
                                     },
+                                    "showPrefixLen": {
+                                        "description": "Show network prefix 
length (/N)",
+                                        "type": "boolean",
+                                        "default": true
+                                    },
                                     "compact": {
                                         "description": "Show all IPs in one 
line",
                                         "type": "boolean",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/data/help.json 
new/fastfetch-2.9.0/src/data/help.json
--- old/fastfetch-2.8.10/src/data/help.json     2024-03-25 07:22:43.000000000 
+0100
+++ new/fastfetch-2.9.0/src/data/help.json      2024-04-04 06:24:44.000000000 
+0200
@@ -1262,6 +1262,15 @@
             }
         },
         {
+            "long": "localip-show-prefix-len",
+            "desc": "Show network prefix length (/N) in local ip module",
+            "arg": {
+                "type": "bool",
+                "optional": true,
+                "default": true
+            }
+        },
+        {
             "long": "localip-name-prefix",
             "desc": "Show interfaces with given interface name prefix only",
             "arg": {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fastfetch-2.8.10/src/detection/localip/localip_linux.c 
new/fastfetch-2.9.0/src/detection/localip/localip_linux.c
--- old/fastfetch-2.8.10/src/detection/localip/localip_linux.c  2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/localip/localip_linux.c   2024-04-04 
06:24:44.000000000 +0200
@@ -40,10 +40,12 @@
     switch (type)
     {
         case AF_INET:
-            ffStrbufSetS(&ip->ipv4, addr);
+            if (ip->ipv4.length) ffStrbufAppendC(&ip->ipv4, ',');
+            ffStrbufAppendS(&ip->ipv4, addr);
             break;
         case AF_INET6:
-            ffStrbufSetS(&ip->ipv6, addr);
+            if (ip->ipv6.length) ffStrbufAppendC(&ip->ipv6, ',');
+            ffStrbufAppendS(&ip->ipv6, addr);
             break;
         case -1:
             ffStrbufSetS(&ip->mac, addr);
@@ -83,12 +85,15 @@
             char addressBuffer[INET_ADDRSTRLEN + 4];
             inet_ntop(AF_INET, &ipv4->sin_addr, addressBuffer, 
INET_ADDRSTRLEN);
 
-            struct sockaddr_in* netmask = (struct sockaddr_in*) 
ifa->ifa_netmask;
-            int cidr = __builtin_popcount(inet_netof(netmask->sin_addr));
-            if (cidr != 0)
+            if (options->showType & FF_LOCALIP_TYPE_PREFIX_LEN_BIT)
             {
-                size_t len = strlen(addressBuffer);
-                snprintf(addressBuffer + len, 4, "/%d", cidr);
+                struct sockaddr_in* netmask = (struct sockaddr_in*) 
ifa->ifa_netmask;
+                int cidr = __builtin_popcount(netmask->sin_addr.s_addr);
+                if (cidr != 0)
+                {
+                    size_t len = strlen(addressBuffer);
+                    snprintf(addressBuffer + len, 4, "/%d", cidr);
+                }
             }
 
             addNewIp(results, ifa->ifa_name, addressBuffer, AF_INET, 
isDefaultRoute);
@@ -99,8 +104,23 @@
                 continue;
 
             struct sockaddr_in6* ipv6 = (struct sockaddr_in6 *)ifa->ifa_addr;
-            char addressBuffer[INET6_ADDRSTRLEN];
+            char addressBuffer[INET6_ADDRSTRLEN + 4];
             inet_ntop(AF_INET6, &ipv6->sin6_addr, addressBuffer, 
INET6_ADDRSTRLEN);
+
+            if (options->showType & FF_LOCALIP_TYPE_PREFIX_LEN_BIT)
+            {
+                struct sockaddr_in6* netmask = (struct sockaddr_in6*) 
ifa->ifa_netmask;
+                int cidr = 0;
+                static_assert(sizeof(netmask->sin6_addr) % sizeof(uint64_t) == 
0, "");
+                for (uint32_t i = 0; i < sizeof(netmask->sin6_addr) / 
sizeof(uint64_t); ++i)
+                    cidr += __builtin_popcountll(((uint64_t*) 
&netmask->sin6_addr)[i]);
+                if (cidr != 0)
+                {
+                    size_t len = strlen(addressBuffer);
+                    snprintf(addressBuffer + len, 4, "/%d", cidr);
+                }
+            }
+
             addNewIp(results, ifa->ifa_name, addressBuffer, AF_INET6, 
isDefaultRoute);
         }
         #if defined(__FreeBSD__) || defined(__APPLE__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fastfetch-2.8.10/src/detection/localip/localip_windows.c 
new/fastfetch-2.9.0/src/detection/localip/localip_windows.c
--- old/fastfetch-2.8.10/src/detection/localip/localip_windows.c        
2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/localip/localip_windows.c 2024-04-04 
06:24:44.000000000 +0200
@@ -6,7 +6,7 @@
 #include "util/windows/unicode.h"
 #include "localip.h"
 
-static void addNewIp(FFlist* list, const char* name, const char* value, int 
type, bool newIp, bool defaultRoute)
+static void addNewIp(FFlist* list, const char* name, const char* addr, int 
type, bool newIp, bool defaultRoute)
 {
     FFLocalIpResult* ip = NULL;
 
@@ -27,13 +27,15 @@
     switch (type)
     {
         case AF_INET:
-            ffStrbufSetS(&ip->ipv4, value);
+            if (ip->ipv4.length) ffStrbufAppendC(&ip->ipv4, ',');
+            ffStrbufAppendS(&ip->ipv4, addr);
             break;
         case AF_INET6:
-            ffStrbufSetS(&ip->ipv6, value);
+            if (ip->ipv6.length) ffStrbufAppendC(&ip->ipv6, ',');
+            ffStrbufAppendS(&ip->ipv6, addr);
             break;
         case -1:
-            ffStrbufSetS(&ip->mac, value);
+            ffStrbufSetS(&ip->mac, addr);
             break;
     }
 }
@@ -108,7 +110,7 @@
                 char addressBuffer[INET_ADDRSTRLEN + 4];
                 inet_ntop(AF_INET, &ipv4->sin_addr, addressBuffer, 
INET_ADDRSTRLEN);
 
-                if (ifa->OnLinkPrefixLength)
+                if ((options->showType & FF_LOCALIP_TYPE_PREFIX_LEN_BIT) && 
ifa->OnLinkPrefixLength)
                 {
                     size_t len = strlen(addressBuffer);
                     snprintf(addressBuffer + len, 4, "/%u", (unsigned) 
ifa->OnLinkPrefixLength);
@@ -120,8 +122,15 @@
             else if (ifa->Address.lpSockaddr->sa_family == AF_INET6)
             {
                 SOCKADDR_IN6* ipv6 = (SOCKADDR_IN6*) ifa->Address.lpSockaddr;
-                char addressBuffer[INET6_ADDRSTRLEN];
+                char addressBuffer[INET6_ADDRSTRLEN + 4];
                 inet_ntop(AF_INET6, &ipv6->sin6_addr, addressBuffer, 
INET6_ADDRSTRLEN);
+
+                if ((options->showType & FF_LOCALIP_TYPE_PREFIX_LEN_BIT) && 
ifa->OnLinkPrefixLength)
+                {
+                    size_t len = strlen(addressBuffer);
+                    snprintf(addressBuffer + len, 4, "/%u", (unsigned) 
ifa->OnLinkPrefixLength);
+                }
+
                 addNewIp(results, name, addressBuffer, AF_INET6, newIp, 
isDefaultRoute);
                 newIp = false;
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/detection/packages/packages.h 
new/fastfetch-2.9.0/src/detection/packages/packages.h
--- old/fastfetch-2.8.10/src/detection/packages/packages.h      2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/packages/packages.h       2024-04-04 
06:24:44.000000000 +0200
@@ -4,6 +4,7 @@
 
 typedef struct FFPackagesResult
 {
+    uint32_t am;
     uint32_t apk;
     uint32_t brew;
     uint32_t brewCask;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fastfetch-2.8.10/src/detection/packages/packages_linux.c 
new/fastfetch-2.9.0/src/detection/packages/packages_linux.c
--- old/fastfetch-2.8.10/src/detection/packages/packages_linux.c        
2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/packages/packages_linux.c 2024-04-04 
06:24:44.000000000 +0200
@@ -253,6 +253,43 @@
 
 #endif //FF_HAVE_RPM
 
+static uint32_t getAM(FFstrbuf* baseDir)
+{
+    // #771
+    uint32_t baseDirLength = baseDir->length;
+
+    ffStrbufAppendS(baseDir, "/opt");
+    uint32_t optDirLength = baseDir->length;
+
+    uint32_t result = 0;
+
+    ffStrbufAppendS(baseDir, "/am/APP-MANAGER");
+    if (ffPathExists(baseDir->chars, FF_PATHTYPE_FILE))
+    {
+        ++result; // `am` itself is counted as a package too
+        ffStrbufSubstrBefore(baseDir, optDirLength);
+        FF_AUTO_CLOSE_DIR DIR* dirp = opendir(baseDir->chars);
+        if(dirp)
+        {
+            struct dirent *entry;
+            while ((entry = readdir(dirp)) != NULL)
+            {
+                if (entry->d_name[0] == '.') continue;
+                if (entry->d_type == DT_DIR)
+                {
+                    ffStrbufAppendF(baseDir, "/%s/AM-updater", entry->d_name);
+                    if (ffPathExists(baseDir->chars, FF_PATHTYPE_FILE))
+                        ++result;
+                    ffStrbufSubstrBefore(baseDir, optDirLength);
+                }
+            }
+        }
+    }
+
+    ffStrbufSubstrBefore(baseDir, baseDirLength);
+    return result;
+}
+
 static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* 
packageCounts, FFPackagesOptions* options)
 {
     if (!(options->disabled & FF_PACKAGES_FLAG_APK_BIT)) packageCounts->apk += 
getNumStrings(baseDir, "/lib/apk/db/installed", "C:Q");
@@ -277,6 +314,7 @@
     }
     if (!(options->disabled & FF_PACKAGES_FLAG_PALUDIS_BIT)) 
packageCounts->paludis += countFilesRecursive(baseDir, 
"/var/db/paludis/repositories", "environment.bz2");
     if (!(options->disabled & FF_PACKAGES_FLAG_OPKG_BIT)) packageCounts->opkg 
+= getNumStrings(baseDir, "/usr/lib/opkg/status", "Package:"); // openwrt
+    if (!(options->disabled & FF_PACKAGES_FLAG_AM_BIT)) packageCounts->am = 
getAM(baseDir);
 }
 
 static void getPackageCountsRegular(FFstrbuf* baseDir, FFPackagesResult* 
packageCounts, FFPackagesOptions* options)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fastfetch-2.8.10/src/detection/terminalfont/terminalfont_linux.c 
new/fastfetch-2.9.0/src/detection/terminalfont/terminalfont_linux.c
--- old/fastfetch-2.8.10/src/detection/terminalfont/terminalfont_linux.c        
2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/terminalfont/terminalfont_linux.c 
2024-04-04 06:24:44.000000000 +0200
@@ -145,13 +145,7 @@
         });
     }
 
-    if (!configFound)
-    {
-        ffStrbufSetStatic(&terminalFont->error, "Couldn't find 
xfce4/xfconf/xfce-perchannel-xml/xfce4-terminal.xml or 
xfce4/terminal/terminalrc");
-        return;
-    }
-
-    if(useSysFont.length == 0 || ffStrbufIgnCaseCompS(&useSysFont, "false") == 
0)
+    if(configFound && (useSysFont.length == 0 || 
ffStrbufIgnCaseCompS(&useSysFont, "false") == 0))
     {
         if(fontName.length == 0)
             ffStrbufAppendF(&terminalFont->error, "Couldn't find FontName in 
%s", path);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fastfetch-2.8.10/src/detection/terminalshell/terminalshell.c 
new/fastfetch-2.9.0/src/detection/terminalshell/terminalshell.c
--- old/fastfetch-2.8.10/src/detection/terminalshell/terminalshell.c    
2024-03-25 07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/terminalshell/terminalshell.c     
2024-04-04 06:24:44.000000000 +0200
@@ -400,6 +400,29 @@
     return version->length > 0;
 }
 
+FF_MAYBE_UNUSED static bool getTerminalVersionLxterminal(FFstrbuf* exe, 
FFstrbuf* version)
+{
+    if(!getExeVersionRaw(exe, version)) return false;
+    // lxterminal 0.3.2
+    ffStrbufSubstrAfterFirstC(version, ' ');
+    return version->length > 0;
+}
+
+FF_MAYBE_UNUSED static bool getTerminalVersionWeston(FF_MAYBE_UNUSED FFstrbuf* 
exe, FFstrbuf* version)
+{
+    // weston-terminal doesn't report a version, use weston version instead
+    if(ffProcessAppendStdOut(version, (char* const[]){
+        "weston",
+        "--version",
+        NULL
+    })) return false;
+
+    //weston 8.0.0
+    ffStrbufSubstrAfterFirstC(version, ' ');
+
+    return version->length > 0;
+}
+
 static bool getTerminalVersionContour(FFstrbuf* exe, FFstrbuf* version)
 {
     const char* env = getenv("TERMINAL_VERSION_STRING");
@@ -410,7 +433,7 @@
     }
     if(!getExeVersionRaw(exe, version)) return false;
     // Contour Terminal Emulator 0.3.12.262
-    ffStrbufSubstrAfterFirstC(version, ' ');
+    ffStrbufSubstrAfterLastC(version, ' ');
     return version->length > 0;
 }
 
@@ -525,6 +548,12 @@
     if(ffStrbufIgnCaseEqualS(processName, "st"))
         return getTerminalVersionSt(exe, version);
 
+    if(ffStrbufIgnCaseEqualS(processName, "lxterminal"))
+        return getTerminalVersionLxterminal(exe, version);
+
+    if(ffStrbufIgnCaseEqualS(processName, "weston-terminal"))
+        return getTerminalVersionWeston(exe, version);
+
     if(ffStrbufIgnCaseEqualS(processName, "urxvt") ||
         ffStrbufIgnCaseEqualS(processName, "urxvtd") ||
         ffStrbufIgnCaseEqualS(processName, "rxvt") ||
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/detection/version/version.c 
new/fastfetch-2.9.0/src/detection/version/version.c
--- old/fastfetch-2.8.10/src/detection/version/version.c        2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/detection/version/version.c 2024-04-04 
06:24:44.000000000 +0200
@@ -32,7 +32,21 @@
     version->cmakeBuiltType = FASTFETCH_PROJECT_CMAKE_BUILD_TYPE;
     version->compileTime = __DATE__ ", " __TIME__;
     #ifdef __clang__
-        version->compiler = "clang " FF_STR(__clang_major__) "." 
FF_STR(__clang_minor__) "." FF_STR(__clang_patchlevel__);
+        version->compiler =
+            #ifdef _MSC_VER
+                "clang-cl " ;
+            #elif defined(__APPLE__) && defined(__apple_build_version__)
+                "Apple clang "
+            #else
+                "clang "
+            #endif
+
+            FF_STR(__clang_major__) "." FF_STR(__clang_minor__) "." 
FF_STR(__clang_patchlevel__)
+
+            #if defined(__APPLE__) && defined(__apple_build_version__)
+                " (" FF_STR(__apple_build_version__) ")"
+            #endif
+            ;
     #elif defined(__GNUC__)
         version->compiler = "gcc " FF_STR(__GNUC__) "." FF_STR(__GNUC_MINOR__) 
"." FF_STR(__GNUC_PATCHLEVEL__);
     #elif defined(_MSC_VER)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/fastfetch.c 
new/fastfetch-2.9.0/src/fastfetch.c
--- old/fastfetch-2.8.10/src/fastfetch.c        2024-03-25 07:22:43.000000000 
+0100
+++ new/fastfetch-2.9.0/src/fastfetch.c 2024-04-04 06:24:44.000000000 +0200
@@ -821,6 +821,7 @@
     if (instance.state.resultDoc)
     {
         yyjson_mut_write_fp(stdout, instance.state.resultDoc, 
YYJSON_WRITE_INF_AND_NAN_AS_NULL | YYJSON_WRITE_PRETTY_TWO_SPACES, NULL, NULL);
+        //TODO should use YYJSON_WRITE_NEWLINE_AT_END when it is available
         putchar('\n');
     }
     else
@@ -840,24 +841,23 @@
     ffOptionsGenerateLibraryJsonConfig(&instance.config.library, doc);
     ffMigrateCommandOptionToJsonc(data, doc);
 
-    if (ffStrbufEqualS(filename, "-"))
-        yyjson_mut_write_fp(stdout, doc, YYJSON_WRITE_INF_AND_NAN_AS_NULL | 
YYJSON_WRITE_PRETTY_TWO_SPACES, NULL, NULL);
-    else
+    FILE *fp = stdout;
+    bool writeToStdout = ffStrbufEqualS(filename, "-");
+    if (!writeToStdout)
+        fp = fopen(filename->chars, "w");
+
+    bool ok = yyjson_mut_write_fp(fp, doc, YYJSON_WRITE_INF_AND_NAN_AS_NULL | 
YYJSON_WRITE_PRETTY_TWO_SPACES, NULL, NULL);
+    //TODO should use YYJSON_WRITE_NEWLINE_AT_END when it is available
+    fputc('\n', fp);
+    if (!ok)
+    {
+        fprintf(stderr, "Error: failed to generate config in `%s`\n", 
writeToStdout ? "stdout" : filename->chars);
+        exit(1);
+    }
+    if (ok && !writeToStdout)
     {
-        size_t len;
-        FF_AUTO_FREE const char* str = yyjson_mut_write(doc, 
YYJSON_WRITE_INF_AND_NAN_AS_NULL | YYJSON_WRITE_PRETTY_TWO_SPACES, &len);
-        if (!str)
-        {
-            printf("Error: failed to generate config file\n");
-            exit(1);
-        }
-        if (ffWriteFileData(filename->chars, len, str))
-            printf("The generated config file has been written in `%s`\n", 
filename->chars);
-        else
-        {
-            printf("Error: failed to write file in `%s`\n", filename->chars);
-            exit(1);
-        }
+        fclose(fp);
+        printf("The generated config file has been written in `%s`\n", 
filename->chars);
     }
 
     yyjson_mut_doc_free(doc);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/flashfetch.c 
new/fastfetch-2.9.0/src/flashfetch.c
--- old/fastfetch-2.8.10/src/flashfetch.c       2024-03-25 07:22:43.000000000 
+0100
+++ new/fastfetch-2.9.0/src/flashfetch.c        2024-04-04 06:24:44.000000000 
+0200
@@ -21,6 +21,7 @@
         &options->title,
         &options->separator,
         &options->os,
+        &options->host,
         &options->kernel,
         &options->uptime,
         &options->packages,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/modules/localip/localip.c 
new/fastfetch-2.9.0/src/modules/localip/localip.c
--- old/fastfetch-2.8.10/src/modules/localip/localip.c  2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/modules/localip/localip.c   2024-04-04 
06:24:44.000000000 +0200
@@ -174,6 +174,15 @@
         return true;
     }
 
+    if (ffStrEqualsIgnCase(subKey, "show-prefix-len"))
+    {
+        if (ffOptionParseBoolean(value))
+            options->showType |= FF_LOCALIP_TYPE_PREFIX_LEN_BIT;
+        else
+            options->showType &= ~FF_LOCALIP_TYPE_PREFIX_LEN_BIT;
+        return true;
+    }
+
     if(ffStrEqualsIgnCase(subKey, "compact"))
     {
         if (ffOptionParseBoolean(value))
@@ -247,6 +256,15 @@
             continue;
         }
 
+        if (ffStrEqualsIgnCase(key, "showPrefixLen"))
+        {
+            if (yyjson_get_bool(val))
+                options->showType |= FF_LOCALIP_TYPE_PREFIX_LEN_BIT;
+            else
+                options->showType &= ~FF_LOCALIP_TYPE_PREFIX_LEN_BIT;
+            continue;
+        }
+
         if (ffStrEqualsIgnCase(key, "compact"))
         {
             if (yyjson_get_bool(val))
@@ -293,6 +311,9 @@
         if (options->showType & FF_LOCALIP_TYPE_LOOP_BIT)
             yyjson_mut_obj_add_bool(doc, module, "showLoop", true);
 
+        if (options->showType & FF_LOCALIP_TYPE_PREFIX_LEN_BIT)
+            yyjson_mut_obj_add_bool(doc, module, "showPrefixLen", true);
+
         if (options->showType & FF_LOCALIP_TYPE_COMPACT_BIT)
             yyjson_mut_obj_add_bool(doc, module, "compact", true);
     }
@@ -369,7 +390,7 @@
     );
     ffOptionInitModuleArg(&options->moduleArgs);
 
-    options->showType = FF_LOCALIP_TYPE_IPV4_BIT;
+    options->showType = FF_LOCALIP_TYPE_IPV4_BIT | 
FF_LOCALIP_TYPE_PREFIX_LEN_BIT;
     ffStrbufInit(&options->namePrefix);
     options->defaultRouteOnly =
         #ifdef __ANDROID__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/modules/localip/option.h 
new/fastfetch-2.9.0/src/modules/localip/option.h
--- old/fastfetch-2.8.10/src/modules/localip/option.h   2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/modules/localip/option.h    2024-04-04 
06:24:44.000000000 +0200
@@ -7,12 +7,13 @@
 typedef enum FFLocalIpType
 {
     FF_LOCALIP_TYPE_NONE,
-    FF_LOCALIP_TYPE_LOOP_BIT = 1 << 0,
-    FF_LOCALIP_TYPE_IPV4_BIT = 1 << 1,
-    FF_LOCALIP_TYPE_IPV6_BIT = 1 << 2,
-    FF_LOCALIP_TYPE_MAC_BIT  = 1 << 3,
+    FF_LOCALIP_TYPE_LOOP_BIT        = 1 << 0,
+    FF_LOCALIP_TYPE_IPV4_BIT        = 1 << 1,
+    FF_LOCALIP_TYPE_IPV6_BIT        = 1 << 2,
+    FF_LOCALIP_TYPE_MAC_BIT         = 1 << 3,
+    FF_LOCALIP_TYPE_PREFIX_LEN_BIT  = 1 << 4,
 
-    FF_LOCALIP_TYPE_COMPACT_BIT = 1 << 10,
+    FF_LOCALIP_TYPE_COMPACT_BIT     = 1 << 10,
 } FFLocalIpType;
 
 typedef struct FFLocalIpOptions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/modules/packages/option.h 
new/fastfetch-2.9.0/src/modules/packages/option.h
--- old/fastfetch-2.8.10/src/modules/packages/option.h  2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/modules/packages/option.h   2024-04-04 
06:24:44.000000000 +0200
@@ -26,6 +26,7 @@
     FF_PACKAGES_FLAG_SNAP_BIT = 1 << 16,
     FF_PACKAGES_FLAG_WINGET_BIT = 1 << 17,
     FF_PACKAGES_FLAG_XBPS_BIT = 1 << 18,
+    FF_PACKAGES_FLAG_AM_BIT = 1 << 19,
 } FFPackagesFlags;
 
 typedef struct FFPackagesOptions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fastfetch-2.8.10/src/modules/packages/packages.c 
new/fastfetch-2.9.0/src/modules/packages/packages.c
--- old/fastfetch-2.8.10/src/modules/packages/packages.c        2024-03-25 
07:22:43.000000000 +0100
+++ new/fastfetch-2.9.0/src/modules/packages/packages.c 2024-04-04 
06:24:44.000000000 +0200
@@ -4,7 +4,7 @@
 #include "modules/packages/packages.h"
 #include "util/stringUtils.h"
 
-#define FF_PACKAGES_NUM_FORMAT_ARGS 25
+#define FF_PACKAGES_NUM_FORMAT_ARGS 26
 
 void ffPrintPackages(FFPackagesOptions* options)
 {
@@ -64,6 +64,7 @@
         FF_PRINT_PACKAGE(paludis)
         FF_PRINT_PACKAGE(winget)
         FF_PRINT_PACKAGE(opkg)
+        FF_PRINT_PACKAGE(am)
 
         putchar('\n');
     }
@@ -95,6 +96,7 @@
             {FF_FORMAT_ARG_TYPE_UINT, &counts.paludis},
             {FF_FORMAT_ARG_TYPE_UINT, &counts.winget},
             {FF_FORMAT_ARG_TYPE_UINT, &counts.opkg},
+            {FF_FORMAT_ARG_TYPE_UINT, &counts.am},
         }));
     }
 
@@ -141,6 +143,7 @@
             FF_TEST_PACKAGE_NAME(SNAP)
             FF_TEST_PACKAGE_NAME(WINGET)
             FF_TEST_PACKAGE_NAME(XBPS)
+            FF_TEST_PACKAGE_NAME(AM)
             #undef FF_TEST_PACKAGE_NAME
 
             if (end)
@@ -210,6 +213,7 @@
                     FF_TEST_PACKAGE_NAME(SNAP)
                     FF_TEST_PACKAGE_NAME(WINGET)
                     FF_TEST_PACKAGE_NAME(XBPS)
+                    FF_TEST_PACKAGE_NAME(AM)
                     #undef FF_TEST_PACKAGE_NAME
                 }
             }
@@ -250,6 +254,7 @@
         FF_TEST_PACKAGE_NAME(SNAP)
         FF_TEST_PACKAGE_NAME(WINGET)
         FF_TEST_PACKAGE_NAME(XBPS)
+        FF_TEST_PACKAGE_NAME(AM)
         #undef FF_TEST_PACKAGE_NAME
     }
 }
@@ -295,6 +300,7 @@
     FF_APPEND_PACKAGE_COUNT(winget)
     FF_APPEND_PACKAGE_COUNT(xbps)
     FF_APPEND_PACKAGE_COUNT(opkg)
+    FF_APPEND_PACKAGE_COUNT(am)
     yyjson_mut_obj_add_strbuf(doc, obj, "pacmanBranch", &counts.pacmanBranch);
 }
 
@@ -325,7 +331,8 @@
         "Number of pkgtool packages",
         "Number of paludis packages",
         "Number of winget packages",
-        "Number of opkg packages"
+        "Number of opkg packages",
+        "Number of am packages",
     }));
 }
 

Reply via email to