Skip to content

Commit a25a4fc

Browse files
authored
Merge pull request #4 from Denton-L/fix-all-description
Reverse the order by which variables are populated
2 parents b4c391a + a86f885 commit a25a4fc

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

lsb_release/src/lsb_release

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
# - changed Debian specifics, codename anticipates release num
5252
#
5353
# Description:
54-
# Collect information from sourceable /etc/lsb-release file (present on
55-
# LSB-compliant systems) : LSB_VERSION, DISTRIB_ID, DISTRIB_RELEASE,
56-
# DISTRIB_CODENAME, DISTRIB_DESCRIPTION (all optional)
54+
# Find and parse the /etc/[distro]-release file
55+
# Collect information from sourceable /etc/lsb-release file for overriding
56+
# (present on LSB-compliant systems) : LSB_VERSION, DISTRIB_ID,
57+
# DISTRIB_RELEASE, DISTRIB_CODENAME, DISTRIB_DESCRIPTION (all optional)
5758
# Then (if needed) find and add names from /etc/lsb-release.d
58-
# Then (if needed) find and parse the /etc/[distro]-release file
5959

6060

6161
###############################################################################
@@ -274,13 +274,7 @@ EASE ($DISTRIB_CODENAME)"
274274

275275
# Check missing and requested infos, then find the file and get infos
276276
GetDistribInfo() {
277-
NO="" # /etc/lsb-release data are enough to reply what is requested?
278-
[ -n "$ARG_D" ] && [ -z "$DISTRIB_DESCRIPTION" ] && NO="y"
279-
[ -z "$NO" ] && [ -n "$ARG_I" ] && [ -z "$DISTRIB_ID" ] && NO="y"
280-
[ -z "$NO" ] && [ -n "$ARG_R" ] && [ -z "$DISTRIB_RELEASE" ] && NO="y"
281-
[ -z "$NO" ] && [ -n "$ARG_C" ] && [ -z "$DISTRIB_CODENAME" ] && NO="y"
282-
283-
if [ -n "$NO" ]
277+
if [ -n "$ARG_D" ] || [ -n "$ARG_I" ] || [ -n "$ARG_R" ] || [ -n "$ARG_C" ]
284278
then
285279
if [ ! -f "$CHECKFIRST" ]
286280
then
@@ -410,8 +404,8 @@ then
410404
fi
411405

412406
# Initialization
413-
GetLSBInfo
414407
GetDistribInfo
408+
GetLSBInfo
415409

416410
# Display requested infos (order as follow)
417411
[ -n "$ARG_V" ] && DisplayVersion

lsb_release/src/lsb_release.examples

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ Codename: TryIt
8989

9090
[REPORTING BUGS]
9191
Report bugs at http://bugs.linuxbase.org.
92-
Please include a complete, self contained example that will allow the
92+
Please include a complete, self-contained example that will allow the
9393
bug to be reproduced, and say which version of lsb_release you are using.

0 commit comments

Comments
 (0)