Skip to content

Commit 609caad

Browse files
committed
Global: use FASTFETCH_TARGET_DIR_USR where applicable
1 parent a0c4720 commit 609caad

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/detection/de/de_linux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
static void getKDE(FFstrbuf* result, FFDEOptions* options)
1414
{
15-
ffParsePropFileValues("/usr/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) {
15+
ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) {
1616
{"X-KDE-PluginInfo-Version =", result}
1717
});
1818
if(result->length == 0)
@@ -21,7 +21,7 @@ static void getKDE(FFstrbuf* result, FFDEOptions* options)
2121
ffParsePropFileData("xsessions/plasma5.desktop", "X-KDE-PluginInfo-Version =", result);
2222
if(result->length == 0)
2323
{
24-
ffParsePropFileValues("/usr/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) {
24+
ffParsePropFileValues(FASTFETCH_TARGET_DIR_USR "/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) {
2525
{"X-KDE-PluginInfo-Version =", result}
2626
});
2727
}

src/detection/gpu/gpu_bsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static bool loadPciIds(FFstrbuf* pciids)
1717
ffReadFileBuffer(_PATH_LOCALBASE "/share/pciids/pci.ids", pciids);
1818
if (pciids->length > 0) return true;
1919

20-
ffReadFileBuffer("/usr/share/pciids/pci.ids", pciids);
20+
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/pciids/pci.ids", pciids);
2121
if (pciids->length > 0) return true;
2222

2323
return false;

src/detection/gpu/gpu_linux.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ static void pciDetectDriver(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer
5353

5454
static bool loadPciIds(FFstrbuf* pciids)
5555
{
56-
ffReadFileBuffer("/usr/share/hwdata/pci.ids", pciids);
56+
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/hwdata/pci.ids", pciids);
5757
if (pciids->length > 0) return true;
5858

59-
ffReadFileBuffer("/usr/share/misc/pci.ids", pciids); // debian?
59+
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/misc/pci.ids", pciids); // debian?
6060
if (pciids->length > 0) return true;
6161

62-
ffReadFileBuffer("/usr/local/share/hwdata/pci.ids", pciids);
62+
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/local/share/hwdata/pci.ids", pciids);
6363
if (pciids->length > 0) return true;
6464

6565
return false;

src/detection/lm/lm_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static const char* getSddmVersion(FFstrbuf* version)
6363
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(zlib, gzrewind)
6464
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(zlib, gzclose)
6565

66-
gzFile file = ffgzopen("/usr/share/man/man1/sddm.1.gz", "rb");
66+
gzFile file = ffgzopen(FASTFETCH_TARGET_DIR_USR "/share/man/man1/sddm.1.gz", "rb");
6767
if (file == Z_NULL)
6868
return "ffgzopen(\"/usr/share/man/man1/sddm.1.gz\", \"rb\") failed";
6969

src/detection/packages/packages_apple.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ static void getBrewPackages(FFPackagesResult* result)
4545
if(ffStrSet(prefix))
4646
return countBrewPackages(prefix, result);
4747

48-
countBrewPackages(FASTFETCH_TARGET_DIR_ROOT"/opt/homebrew", result);
49-
countBrewPackages(FASTFETCH_TARGET_DIR_ROOT"/usr/local", result);
48+
countBrewPackages(FASTFETCH_TARGET_DIR_ROOT "/opt/homebrew", result);
49+
countBrewPackages(FASTFETCH_TARGET_DIR_USR "/local", result);
5050
}
5151

5252
static uint32_t countMacPortsPackages(const char* dirname)
5353
{
5454
FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateS(dirname);
55-
ffStrbufAppendS(&baseDir, "/var/macports/software");
55+
ffStrbufAppendS(&baseDir, FASTFETCH_TARGET_DIR_ROOT "/var/macports/software");
5656

5757
return getNumElements(baseDir.chars, DT_DIR);
5858
}
@@ -63,7 +63,7 @@ static uint32_t getMacPortsPackages()
6363
if(ffStrSet(prefix))
6464
return countMacPortsPackages(prefix);
6565

66-
return countMacPortsPackages(FASTFETCH_TARGET_DIR_ROOT"/opt/local");
66+
return countMacPortsPackages(FASTFETCH_TARGET_DIR_ROOT "/opt/local");
6767
}
6868

6969
static uint32_t getNixPackagesImpl(char* path)
@@ -81,7 +81,7 @@ static uint32_t getNixPackagesImpl(char* path)
8181
ffStrbufAppendS(&command, "); do if [ -d $x ]; then echo $x ; fi ; done | cut -d- -f2- | egrep '([0-9]{1,}\\.)+[0-9]{1,}' | egrep -v '\\-doc$|\\-man$|\\-info$|\\-dev$|\\-bin$|^nixos-system-nixos-' | uniq | wc -l");
8282

8383
ffProcessAppendStdOut(&output, (char* const[]) {
84-
"/bin/sh",
84+
FASTFETCH_TARGET_DIR_ROOT "/bin/sh",
8585
"-c",
8686
command.chars,
8787
NULL

0 commit comments

Comments
 (0)