lsb_relase

This commit is contained in:
milisbir 2018-08-20 16:36:01 +03:00
parent 777368019b
commit dda979c46a
2 changed files with 139 additions and 4 deletions

135
bin/lsb_release Executable file
View File

@ -0,0 +1,135 @@
#!/bin/sh
#
# This is a simple alternative to /usr/bin/lsb_release which
# doesn't require python.
#
# If /etc/lsb-release exists then we use that to output data
# in a compatible format to the original lsb_release utility.
#
# I consider this script trivial enough to be in the public-domain,
# but any patches or suggestsions will be welcome.
#
# Steve
# --
#
show_help() {
cat << EOF
Usage: lsb_release [options]
Options:
-h, --help show this help message and exit
-i, --id show distributor ID
-d, --description show description of this distribution
-r, --release show release number of this distribution
-c, --codename show code name of this distribution
-a, --all show all of the above information
-s, --short show requested information in short format
EOF
exit 0
}
#
# Potential command-line options.
#
all=0
codename=0
description=0
id=0
release=0
short=0
version=0
#
# Process each argument, and set the appropriate flag
# if we recognize it.
#
while :; do
case $1 in
-a|--all)
all=1
;;
-c|--codename)
codename=1
;;
-d|--description)
description=1
;;
-h|--help)
show_help
break
;;
-i|--id)
id=1
;;
-r|--release)
release=1
;;
-s|--short)
short=1
;;
-v|--version)
version=1
;;
*)
break
esac
shift
done
#
# Read our variables.
#
if [ -e /etc/lsb-release ]; then
. /etc/lsb-release
else
echo "/etc/lsb-release is not present. Aborting" >&2
exit 1
fi
#
# Now output the data - The order of these was chosen to match
# what the original lsb_release used, and while I suspect it doesn't
# matter I kept it the same.
#
if [ "$all" = "1" ] || [ "$id" = "1" ]; then
if [ "$short" = "0" ]; then
printf "Distributor ID:\t"
fi
echo $DISTRIB_ID
fi
if [ "$all" = "1" ] || [ "$description" = "1" ]; then
if [ "$short" = "0" ]; then
printf "Description:\t"
fi
echo $DISTRIB_DESCRIPTION
fi
if [ "$all" = "1" ] || [ "$release" = "1" ]; then
if [ "$short" = "0" ]; then
printf "Release:\t"
fi
echo $DISTRIB_RELEASE
fi
if [ "$all" = "1" ] || [ "$codename" = "1" ]; then
if [ "$short" = "0" ]; then
printf "Codename:\t"
fi
#
# Codename comes from: VERSION="7 (wheezy)"
#
ver=$(echo $VERSION | awk '{print $2}' | tr -d \(\))
echo "$DISTRIB_CODENAME"
fi
exit 0

View File

@ -1,14 +1,14 @@
# Tanım: Foomatic-db-engine tarafından PPD dosyaları oluşturmak için kullanılır.
# URL: http://www.linuxprinting.org/foomatic.html
# Paketçi: alihan-ozturk28
# Paketçi: milisarge
# Gerekler: libxml2
# Grup: ofis
isim=foomatic-db
surum=4.0.20161112
surum=4.0.20180820
devir=1
_surum=4.0-20161112
kaynak=(http://www.openprinting.org/download/foomatic/foomatic-db-${_version}.tar.gz)
_surum=4.0-20180820
kaynak=(http://www.openprinting.org/download/foomatic/foomatic-db-${_surum}.tar.gz)
derle() {
cd $isim-*