-
-
Notifications
You must be signed in to change notification settings - Fork 576
Fix lliurex detection #1882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lliurex detection #1882
Changes from 2 commits
a897407
5c02a26
83b69a4
5aa55e6
fa58816
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,21 @@ FF_MAYBE_UNUSED static void getUbuntuFlavour(FFOSResult* result) | |
ffStrbufSetStatic(&result->idLike, "ubuntu"); | ||
} | ||
|
||
if (ffPathExists("/etc/lliurex-cdd-version", FF_PATHTYPE_FILE)) | ||
{ | ||
ffStrbufSetStatic(&result->name, "LliureX"); | ||
ffStrbufSetStatic(&result->id, "lliurex"); | ||
ffStrbufClear(&result->version); | ||
if (ffProcessAppendStdOut(&result->version, (char* const[]) { | ||
"/usr/bin/lliurex-version", | ||
NULL, | ||
}) == NULL) // 8.2.2 | ||
ffStrbufTrimRightSpace(&result->versionID); | ||
ffStrbufSetF(&result->prettyName, "LliureX %s", result->version.chars); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if ffProcessAppendStdOut failed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lliurex-version is a basic system command in lliurex, if it fails then something is really wrong, it wold be as if command lsb_release fails. If you want I can add any behaviour on fail but the tests I did seemed to be ok without any issue at all. Cheers |
||
ffStrbufSetStatic(&result->idLike, "ubuntu"); | ||
return; | ||
} | ||
|
||
if(ffStrContains(xdgConfigDirs, "kde") || ffStrContains(xdgConfigDirs, "plasma") || ffStrContains(xdgConfigDirs, "kubuntu")) | ||
{ | ||
ffStrbufSetStatic(&result->name, "Kubuntu"); | ||
|
@@ -169,15 +184,6 @@ FF_MAYBE_UNUSED static void getUbuntuFlavour(FFOSResult* result) | |
ffStrbufSetStatic(&result->idLike, "ubuntu"); | ||
return; | ||
} | ||
|
||
if(ffStrContains(xdgConfigDirs, "lliurex")) | ||
{ | ||
ffStrbufSetStatic(&result->name, "LliureX"); | ||
ffStrbufSetF(&result->prettyName, "LliureX %s", result->version.chars); | ||
ffStrbufSetStatic(&result->id, "lliurex"); | ||
ffStrbufSetStatic(&result->idLike, "ubuntu"); | ||
return; | ||
} | ||
} | ||
|
||
FF_MAYBE_UNUSED static void getDebianVersion(FFOSResult* result) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You appended the version string to
&result->version
, but triming&result->versionID
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you put executable binaries to
/etc/
? Shouldn't it be a regular text file?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, the trim was left by mistake.
For the another question there's no binary at /etc. The check for /etc/lliurex-cdd-version is for a regular txt file, the binary to get the lliurex version is at /usr/bin/lliurex-version. First checks for the file, then (if file exists) gets the version through a binary. I could check the binary itself directly but it will fail if the aforementioned file didn't exist so I believe is better to check for the file.
p.s. I've made another commit fixing the trim