https://github.com/hpcsi/losf
Tip revision: 275b2f2dd62c65259c983f606413b7b9c19234fc authored by Karl W. Schulz on 07 March 2019, 17:10:48 UTC
prep changelog for next release
prep changelog for next release
Tip revision: 275b2f2
update
# -*-sh-*-
#!/bin/bash
#-----------------------------------------------------------------------bl-
#--------------------------------------------------------------------------
#
# LosF - a Linux operating system Framework for HPC clusters
#
# Copyright (C) 2007-2019 Karl W. Schulz <losf@koomie.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Version 2 GNU General
# Public License as published by the Free Software Foundation.
#
# These programs are distributed in the hope that they will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY 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 library; if not, write to the Free Software
# Foundation, Inc. 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
#-----------------------------------------------------------------------el-
# Utility to update individual cluster node types to latest production
# revision (or verify that a node is already in sync).
#-------------------------------------------------------------------------
# Command-line Inputs
# Inputs -------------------
export VERBOSE=0
export UPDATE_RPMS=1
# End Inputs -------------------
# determine path to binary
[[ -L $0 ]] && binary=`readlink -f $0` || binary=$0
# disable colors for non-interactive shell
[[ ! -t 1 ]] && export ANSI_COLORS_DISABLED=1
export TOP_DIR=`echo $( (cd -P $(dirname $binary) && pwd) )`
if [ -z $PERL5LIB ];then
export PERL5LIB=$TOP_DIR/utils
else
export PERL5LIB=$TOP_DIR/utils:$PERL5LIB
fi
usage()
{
cat <<EOF
LosF update utility: used to bring local node to latest
configuration status (via the installation/removal of desired
packages and synchronization of configuration files and services).
usage: update [OPTIONS]
OPTIONS:
-h Show help message.
-q Quiet logging mode; shows detected system changes only.
-p [path] Override configured RPM source directory to prefer provided path instead.
-v Print version number and exit.
EOF
}
RPM_OVERRIDE=
while getopts "hqfvp:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
p)
RPM_OVERRIDE=$OPTARG
;;
q)
export LOSF_LOG_MODE=ERROR
;;
f)
export LOSF_UPDATE_FORCE=1
;;
v)
if [ ! -s $TOP_DIR/VERSION ];then
echo " "
echo "[ERROR]: Unable to obtain version...please verify local LosF install"
echo " "
exit 1
else
version=`cat $TOP_DIR/VERSION`
echo " "
echo "-----------------------"
echo "LosF: Version $version"
echo "-----------------------"
echo " "
fi
exit 0
;;
?)
usage
exit
;;
esac
done
#----------------------------------------------------------------
# Perform LosF updates
#----------------------------------------------------------------
$TOP_DIR/utils/update.pl $RPM_OVERRIDE
#perl -d:NYTProf $TOP_DIR/utils/update.pl $RPM_OVERRIDE