From 8d45d4f95855e3196606d4d1f7e5bee2f06ea54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Fri, 16 Oct 2015 14:20:34 +0200 Subject: [PATCH] base-files: implement lsb_release options Some packages rely on FSG compliant output of lsb_release. Implement according to http://man.cx/lsb_release for v1.4 --- srcpkgs/base-files/files/lsb_release | 81 ++++++++++++++++++++++++++-- srcpkgs/base-files/template | 2 +- 2 files changed, 79 insertions(+), 4 deletions(-) diff --git a/srcpkgs/base-files/files/lsb_release b/srcpkgs/base-files/files/lsb_release index 85db0855f1b..d52d5755ae2 100644 --- a/srcpkgs/base-files/files/lsb_release +++ b/srcpkgs/base-files/files/lsb_release @@ -1,6 +1,81 @@ #!/bin/sh +# +# Compatibility script for FSG lsb_release v1.4 or newer +# +version="1.0" +distributor_id="VoidLinux" +description="Void Linux" +release="rolling" +codename="void" +options="" +short=0 + +while [ $# -gt 0 ]; do + case "$1" in + -v|--version) options="${options} version" ;; + -i|--id) options="${options} distributor_id" ;; + -d|--description) options="${options} description" ;; + -r|--release) options="${options} release" ;; + -c|--codename) options="${options} codename" ;; + -a|--all) options="version distributor_id description release codename" ;; + -s|--short) short=1 ;; + -h|--help) cat << _EOF +SYNOPSIS + lsb_release [OPTION]... +OPTIONS + −v, −−version + Display the version of the LSB specification against which the distribution is compliant. + + −i, −−id + Display the string id of the distributor. + + −d, −−description + Display the single line text description of the distribution. + + −r, −−release + Display the release number of the distribution. + + −c, −−codename + Display the codename according to the distribution release. + + −a, −−all + Display all of the above information. + + −s, −−short + Display all of the above information in short output format. + + −h, −−help + Display this message. +_EOF + esac + shift +done + +[ -z "$options" ] && options="version" + +if [ "$short" -eq 1 ]; then + space="" + for opt in $options; do + case "$opt" in + version) printf "${space}${version}" ;; + distributor_id) printf "${space}${distributor_id}" ;; + description) printf "${space}\"${description}\"" ;; + release) printf "${space}${release}" ;; + codename) printf "${space}${codename}" ;; + esac + space=" " + done + printf "\n" +else + for opt in $options; do + case "$opt" in + version) printf "LSB Version:\t${version}\n" ;; + distributor_id) printf "Distributor ID:\t${distributor_id}\n" ;; + description) printf "Description:\t${description}\n" ;; + release) printf "Release:\t${release}\n" ;; + codename) printf "Codename:\t${codename}\n" ;; + esac + done +fi -printf "Distributor ID:\tVoid\n" -printf "Description:\tVoid Linux\n" -printf "Release:\trolling\n" exit 0 diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template index 1623f237791..d9992bcb3b7 100644 --- a/srcpkgs/base-files/template +++ b/srcpkgs/base-files/template @@ -1,6 +1,6 @@ # Template file for 'base-files' pkgname=base-files -version=0.133 +version=0.134 revision=1 bootstrap=yes depends="xbps-triggers"