mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
scripts/get-os.sh: Remove
Remove the now obsolete get-os.sh from jw-pkg. Use "jw-pkg.py distro info" to get the information it used to provide. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c241634cf1
commit
0cf4b29cfb
2 changed files with 2 additions and 175 deletions
|
|
@ -67,7 +67,8 @@ JW_PKG_PY = python3 $(JWB_SCRIPT_DIR)/jw-pkg.py --prefix $(sh
|
||||||
SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh
|
SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh
|
||||||
|
|
||||||
EXCLUDES_FILE ?= exclude.txt
|
EXCLUDES_FILE ?= exclude.txt
|
||||||
EXCLUDES_FILES = $(wildcard $(patsubst %,exclude-%.txt,$(shell $(JW_PKG_PY) distro info --format '%{cascade}')) $(EXCLUDES_FILE))
|
EXCLUDES_FILES := $(wildcard $(patsubst %,exclude-%.txt,$(shell $(JW_PKG_PY) distro info --format '%{cascade}')) $(EXCLUDES_FILE))
|
||||||
|
|
||||||
ifneq ($(EXCLUDES_FILES),)
|
ifneq ($(EXCLUDES_FILES),)
|
||||||
EXCLUDE_FROM_BUILD += $(shell sed 's/\#.*//g' $(EXCLUDES_FILES))
|
EXCLUDE_FROM_BUILD += $(shell sed 's/\#.*//g' $(EXCLUDES_FILES))
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1,174 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# generic utiltiy modules #
|
|
||||||
# (c) 2001 jannet it services #
|
|
||||||
# contact@jannet.de #
|
|
||||||
# #
|
|
||||||
# $Id$
|
|
||||||
# #
|
|
||||||
# This program is free software; permission to use, copy, modify, #
|
|
||||||
# distribute, and sell this software and its documentation under the #
|
|
||||||
# terms of the GNU Public license as published by the Free Software #
|
|
||||||
# Foundation, either version 2 or any later version of the license, is #
|
|
||||||
# hereby granted without fee, provided that (i) the above copyright #
|
|
||||||
# notices and this permission notice appear in all copies of the #
|
|
||||||
# software and related documentation, and (ii) the name of JanNet may #
|
|
||||||
# not be used in any advertising or publicity relating to the software #
|
|
||||||
# without the specific, prior written permission of JanNet. #
|
|
||||||
# #
|
|
||||||
# This program is distributed in the hope that it will be useful, but #
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- #
|
|
||||||
# TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General #
|
|
||||||
# Public License for more details. #
|
|
||||||
# #
|
|
||||||
# You should have received a copy of the GNU General Public License #
|
|
||||||
# along with this program; if not, write to the Free Software Founda- #
|
|
||||||
# tion, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
echo "
|
|
||||||
usage: $myname [-h]
|
|
||||||
$myname [-v]
|
|
||||||
$myname [-V]
|
|
||||||
"
|
|
||||||
[ "$1" ] && exit $1
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_name_version()
|
|
||||||
{
|
|
||||||
if [ -r /etc/os-release ]; then
|
|
||||||
. /etc/os-release
|
|
||||||
if [ "$opt_verbose" ]; then
|
|
||||||
echo $NAME $VERSION
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if grep -qi tumbleweed /etc/os-release; then
|
|
||||||
echo suse-tumbleweed
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$ID" in
|
|
||||||
ubuntu|centos)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
[ "$ID_LIKE" ] && ID=$ID_LIKE
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$ID" in
|
|
||||||
debian)
|
|
||||||
VERSION_NAME=`echo $PRETTY_NAME | awk 'NF>1{print $NF}' | sed 's%/.*%%' | tr '[A-Z]' '[a-z]'`
|
|
||||||
case $VERSION_NAME in
|
|
||||||
buster) VERSION_ID=10;;
|
|
||||||
stretch) VERSION_ID=9;;
|
|
||||||
jessie) VERSION_ID=8;;
|
|
||||||
wheezy) VERSION_ID=7;;
|
|
||||||
squeeze) VERSION_ID=6.0;;
|
|
||||||
lenny) VERSION_ID=5.0;;
|
|
||||||
etch) VERSION_ID=4.0;;
|
|
||||||
sarge) VERSION_ID=3.1;;
|
|
||||||
woody) VERSION_ID=3.0;;
|
|
||||||
potato) VERSION_ID=2.2;;
|
|
||||||
slink) VERSION_ID=2.1;;
|
|
||||||
hamm) VERSION_ID=2.0;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
centos)
|
|
||||||
;;
|
|
||||||
ubuntu)
|
|
||||||
;;
|
|
||||||
suse|opensuse)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
VERSION_ID=42
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo $ID-$VERSION_ID | sed 's/opensuse/suse/g'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e /etc/SuSE-release ]; then
|
|
||||||
if [ "$opt_verbose" ]; then
|
|
||||||
head -1 /etc/SuSE-release
|
|
||||||
else
|
|
||||||
VERSION="`grep VERSION /etc/SuSE-release | sed -e 's/.*=//; s/ //g'`"
|
|
||||||
echo suse-$VERSION
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$opt_verbose" ]; then
|
|
||||||
uname -a
|
|
||||||
else
|
|
||||||
uname -r
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_version()
|
|
||||||
{
|
|
||||||
local nv=`cmd_name_version`
|
|
||||||
echo ${nv#*-}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_name()
|
|
||||||
{
|
|
||||||
local nv=`cmd_name_version`
|
|
||||||
echo ${nv%%-*}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_type()
|
|
||||||
{
|
|
||||||
echo linux
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_tuple()
|
|
||||||
{
|
|
||||||
local nv=`cmd_name_version`
|
|
||||||
local dm=`gcc -dumpmachine`
|
|
||||||
local arch=${dm%%-*}
|
|
||||||
local vendor=${nv%%-*}
|
|
||||||
local os=linux
|
|
||||||
local lib=gnu
|
|
||||||
echo "$arch-$vendor-$os-$lib"
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_triplet()
|
|
||||||
{
|
|
||||||
cmd_tuple | sed 's/\([^-]\+\)-\([^-]\+\)-\([^-]\+\)-\([^-]\+\)/\1-\3-\4/'
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- here we go
|
|
||||||
|
|
||||||
myname=`basename $0`
|
|
||||||
release_file=/etc/os-release
|
|
||||||
cmd=name_version
|
|
||||||
|
|
||||||
eval set -- `getopt -- hvV "$@"`
|
|
||||||
while [ "$1" != -- ] ; do
|
|
||||||
case "$1" in
|
|
||||||
-h)
|
|
||||||
usage 0
|
|
||||||
;;
|
|
||||||
-v)
|
|
||||||
opt_verbose=1;
|
|
||||||
;;
|
|
||||||
-V)
|
|
||||||
cmd=version
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
usage 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
shift
|
|
||||||
|
|
||||||
[ "$1" ] && cmd="${1/-/_}"
|
|
||||||
|
|
||||||
eval cmd_$cmd
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue