Codebase list distro-info / bullseye-backports/main shell / ubuntu-distro-info.in
bullseye-backports/main

Tree @bullseye-backports/main (Download .tar.gz)

ubuntu-distro-info.in @bullseye-backports/mainraw · history · blame

#!/bin/sh
set -f

# Copyright (C) 2012 Canonical Ltd.
# Author: Scott Moser <smoser@ubuntu.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

DISTRO_INFO_NAME="Ubuntu"
DISTRO_INFO_ARGS="--all --devel --lts --stable --supported --supported-esm
                  --unsupported"
DISTRO_INFO_DATA="/usr/share/distro-info/ubuntu.csv"

. "${0%/*}/distro-info-util.sh"

Usage() {
	cat <<EOF
Usage: ubuntu-distro-info [options]

Options:
  -h  --help          show this help message and exit
      --date=DATE     date for calculating the version (default: today)
  -a  --all           list all known versions
  -d  --devel         latest development version
  -s  --stable        latest stable version
      --lts           latest long term support (LTS) version
      --supported     list of all supported versions (including development)
      --supported-esm list of all Ubuntu Advantage supported stable versions
      --unsupported   list of all unsupported stable versions
  -c  --codename      print the codename (default)
  -r  --release       print the release version
  -f  --fullname      print the full name

See ubuntu-distro-info(1) for more info.
EOF
}

cb_devel() {
	devel && store
	return 1
}
cb_supported() {
	date_ge "$eols" "$CMP_DATE" && created
}
cb_supported_esm() {
	date_ge "$eolesm" "$CMP_DATE" && created
}
cb_lts() {
	[ "${version#*LTS}" != "${version}" ] && released && store
	return 1;
}

main "$@"

# vi: ts=4 noexpandtab