Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package smc-tools for openSUSE:Factory checked in at 2022-10-06 07:41:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/smc-tools (Old) and /work/SRC/openSUSE:Factory/.smc-tools.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "smc-tools" Thu Oct 6 07:41:33 2022 rev:14 rq:1007986 version:1.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/smc-tools/smc-tools.changes 2021-11-05 22:58:29.620277056 +0100 +++ /work/SRC/openSUSE:Factory/.smc-tools.new.2275/smc-tools.changes 2022-10-06 07:41:42.724621583 +0200 @@ -1,0 +2,24 @@ +Tue Oct 4 19:03:55 UTC 2022 - Mark Post <mp...@suse.com> + +- Upgraded to version 1.8.2 (jsc#PED-577) + * v1.8.2 (2022-09-26) + Bug fixes: + - `smc_run`: Fix for single quotes in parameters + - `Makefile`: Fix target `check` + - `smcss`/`smc_pnet`: Fix option `--version` + - `smcr`/`smc_dbg`: Fix for showing the correct hardware capabailities + * v1.8.1 (2022-04-14) + Changes: + - `smc_rncs`: Recognize RoCE Express3 cards + * v1.8.0 (2022-04-11) + Changes: + - `smc_dbg`: Add stats and `smc info` output + - `smc_rnics`: + - List unknown devices with option `-a` + - Include software-set PNET IDs + - `smc_chk`: Indicate PNET IDs set by `smc_pnet`. + Bug fixes: + - `smc_rnics`: Display correct PNET ID for unknown Mellanox cards + - `smc_run`: Fix output of version info + +------------------------------------------------------------------- Old: ---- smc-tools-1.7.0.tar.gz New: ---- smc-tools-1.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ smc-tools.spec ++++++ --- /var/tmp/diff_new_pack.pYBpuQ/_old 2022-10-06 07:41:43.124622473 +0200 +++ /var/tmp/diff_new_pack.pYBpuQ/_new 2022-10-06 07:41:43.140622509 +0200 @@ -1,7 +1,7 @@ # # spec file for package smc-tools # -# Copyright (c) 2018-2021 SUSE LLC +# Copyright (c) 2018-2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: smc-tools -Version: 1.7.0 +Version: 1.8.2 Release: 0 Summary: Shared Memory Communication via RDMA License: EPL-1.0 ++++++ smc-tools-1.7.0.tar.gz -> smc-tools-1.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/Makefile new/smc-tools-1.8.2/Makefile --- old/smc-tools-1.7.0/Makefile 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/Makefile 2022-09-29 15:25:06.000000000 +0200 @@ -9,7 +9,7 @@ # http://www.eclipse.org/legal/epl-v10.html # -SMC_TOOLS_RELEASE = 1.7.0 +SMC_TOOLS_RELEASE = 1.8.2 VER_MAJOR = $(shell echo $(SMC_TOOLS_RELEASE) | cut -d '.' -f 1) ARCHTYPE = $(shell uname -m) @@ -189,18 +189,20 @@ endif check: - if which cppcheck >/dev/null; then \ + if ( command -v cppcheck >/dev/null ); then \ echo "Running cppcheck"; \ cppcheck . 2>&1; \ else \ echo "cppcheck not available"; \ fi @echo; - if which valgrind >/dev/null; then \ + #if type -p valgrind >/dev/null; then \ + if ( command -v valgrind >/dev/null ); then \ echo "Running valgrind"; \ valgrind --leak-check=full --show-leak-kinds=all ./smcss 2>&1; \ valgrind --leak-check=full --show-leak-kinds=all ./smc_pnet 2>&1; \ - valgrind --leak-check=full --show-leak-kinds=all ./smc 2>&1; \ + valgrind --leak-check=full --show-leak-kinds=all ./smcd info 2>&1; \ + valgrind --leak-check=full --show-leak-kinds=all ./smcd stats 2>&1; \ else \ echo "valgrind not available"; \ fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/README.md new/smc-tools-1.8.2/README.md --- old/smc-tools-1.7.0/README.md 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/README.md 2022-09-29 15:25:06.000000000 +0200 @@ -39,6 +39,33 @@ Release History: ================ +* __v1.8.2 (2022-09-26)__ + + Bug fixes: + - `smc_run`: Fix for single quotes in parameters + - `Makefile`: Fix target `check` + - `smcss`/`smc_pnet`: Fix option `--version` + - `smcr`/`smc_dbg`: Fix for showing the correct hardware capabailities + for RoCE Express3 cards + +* __v1.8.1 (2022-04-14)__ + + Changes: + - `smc_rncs`: Recognize RoCE Express3 cards + +* __v1.8.0 (2022-04-11)__ + + Changes: + - `smc_dbg`: Add stats and `smc info` output + - `smc_rnics`: + - List unknown devices with option `-a` + - Include software-set PNET IDs + - `smc_chk`: Indicate PNET IDs set by `smc_pnet`. + + Bug fixes: + - `smc_rnics`: Display correct PNET ID for unknown Mellanox cards + - `smc_run`: Fix output of version info + * __v1.7.0 (2021-10-29)__ Changes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/dev.c new/smc-tools-1.8.2/dev.c --- old/smc-tools-1.7.0/dev.c 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/dev.c 2022-09-29 15:25:06.000000000 +0200 @@ -24,6 +24,12 @@ #include "libnetlink.h" #include "dev.h" +#define MASK_ROCE_V1_HEX 0x1004 +#define MASK_ROCE_V2_HEX 0x1016 +#define MASK_ROCE_V3_HEX 0x101e + +#define MASK_ISM_V1_HEX 0x04ed + static int netdev_entered = 0; static int ibdev_entered = 0; static int type_entered = 0; @@ -100,9 +106,10 @@ static char buf[16]; switch (x) { - case 0x1004: return "RoCE_Express"; - case 0x1016: return "RoCE_Express2"; - case 0x04ed: return "ISM"; + case MASK_ROCE_V1_HEX: return "RoCE_Express"; + case MASK_ROCE_V2_HEX: return "RoCE_Express2"; + case MASK_ROCE_V3_HEX: return "RoCE_Express3"; + case MASK_ISM_V1_HEX: return "ISM"; default: sprintf(buf, "%#x", x); return buf; } } @@ -479,6 +486,7 @@ struct count_roce_args { int *rocev1_count; int *rocev2_count; + int *rocev3_count; }; /* arg is an (struct count_roce_args *) */ @@ -511,23 +519,27 @@ } if (dev_attrs[SMC_NLA_DEV_PCI_DEVICE]) i = nla_get_u16(dev_attrs[SMC_NLA_DEV_PCI_DEVICE]); - if (i == 0x1004) + if (i == MASK_ROCE_V1_HEX) (*args->rocev1_count)++; - if (i == 0x1016) + if (i == MASK_ROCE_V2_HEX) (*args->rocev2_count)++; + if (i == MASK_ROCE_V3_HEX) + (*args->rocev3_count)++; } return NL_OK; } -int dev_count_roce_devices(int *rocev1_count, int *rocev2_count) +int dev_count_roce_devices(int *rocev1_count, int *rocev2_count, int *rocev3_count) { struct count_roce_args args = { .rocev1_count = rocev1_count, - .rocev2_count = rocev2_count + .rocev2_count = rocev2_count, + .rocev3_count = rocev3_count, }; *rocev1_count = 0; *rocev2_count = 0; + *rocev3_count = 0; return gen_nl_handle_dump(SMC_NETLINK_GET_DEV_SMCR, count_roce_devices_reply, &args); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/dev.h new/smc-tools-1.8.2/dev.h --- old/smc-tools-1.7.0/dev.h 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/dev.h 2022-09-29 15:25:06.000000000 +0200 @@ -20,6 +20,6 @@ int invoke_devs(int argc, char **argv, int detail_level); int dev_count_ism_devices(int *ism_count); -int dev_count_roce_devices(int *rocev1_count, int *rocev2_count); +int dev_count_roce_devices(int *rocev1_count, int *rocev2_count, int *rocev3_count); #endif /* DEV_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/info.c new/smc-tools-1.8.2/info.c --- old/smc-tools-1.7.0/info.c 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/info.c 2022-09-29 15:25:06.000000000 +0200 @@ -24,7 +24,7 @@ #include "dev.h" static int show_cmd = 0; -static int ism_count, rocev1_count, rocev2_count; +static int ism_count, rocev1_count, rocev2_count, rocev3_count; static struct nla_policy smc_gen_info_policy[SMC_NLA_SYS_MAX + 1] = { @@ -135,12 +135,12 @@ /* RoCE hardware */ tmp[0] = '\0'; - if (rocev1_count || rocev2_count) { + if (rocev1_count || rocev2_count || rocev3_count) { /* Kernel found any RoCE device */ strcpy(tmp, ""); - if (rocev1_count || rocev2_count) + if (rocev1_count || rocev2_count || rocev3_count) strcat(tmp, "v1 "); - if (rocev2_count) + if (rocev2_count || rocev3_count) strcat(tmp, "v2"); } printf("RoCE: %s\n", (tmp[0] != '\0' ? tmp : "n/a")); @@ -184,7 +184,7 @@ fprintf(stderr, "Error: Failed to retrieve ISM device count\n"); return EXIT_FAILURE; } - if (dev_count_roce_devices(&rocev1_count, &rocev2_count)) { + if (dev_count_roce_devices(&rocev1_count, &rocev2_count, &rocev3_count)) { fprintf(stderr, "Error: Failed to retrieve RoCE device count\n"); return EXIT_FAILURE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc-device.8 new/smc-tools-1.8.2/smc-device.8 --- old/smc-tools-1.7.0/smc-device.8 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc-device.8 2022-09-29 15:25:06.000000000 +0200 @@ -95,6 +95,10 @@ Underlying used device is RoCE Express 2. .TP .I +RoCE_Express3 +Underlying used device is RoCE Express 3. +.TP +.I ISM Underlying used device is ISM. .SS "Crit" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_chk new/smc-tools-1.8.2/smc_chk --- old/smc-tools-1.7.0/smc_chk 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_chk 2022-09-29 15:25:06.000000000 +0200 @@ -2,7 +2,7 @@ # Copyright IBM Corp. 2021 -VERSION="1.7.0"; +VERSION="1.8.2"; function usage() { @@ -273,6 +273,9 @@ # Check for a software-defined PNET ID debug "No luck so far - try the SW PNET table"; pnetid="`smc_pnet | awk -v id="$1" '$2 == id {print($1)}'`"; + if [ "$pnetid" != "" ]; then + pnetid="$pnetid*"; + fi debug "PNET ID is '$pnetid'"; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_chk.8 new/smc-tools-1.8.2/smc_chk.8 --- old/smc-tools-1.7.0/smc_chk.8 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_chk.8 2022-09-29 15:25:06.000000000 +0200 @@ -61,7 +61,8 @@ .BI "\-i, \-\-pnetid " INTERFACE Print the PNET ID of interface .I INTERFACE -and exit. +and exit. An appended asterisk * indicates that the PNET ID was defined via +.BR smc_pnet . .TP .BI "\-p, \-\-port " PORT Use port diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_dbg new/smc-tools-1.8.2/smc_dbg --- old/smc-tools-1.7.0/smc_dbg 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_dbg 2022-09-29 15:25:06.000000000 +0200 @@ -2,7 +2,7 @@ # Copyright IBM Corp. 2019 -VERSION="1.7.0"; +VERSION="1.8.2"; function usage() { @@ -93,6 +93,16 @@ redirect smcd_lgs.txt; smcd -d linkgroup show; +redirect smcd_info.txt; +smcd info; + +redirect smcd_stats.txt; +smcd -d stats; + +redirect smcr_stats.txt; +smcr -d stats; + + if [ "$tgz" == "on" ]; then exec >&3 2>&4 cd /tmp; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_pnet.c new/smc-tools-1.8.2/smc_pnet.c --- old/smc-tools-1.7.0/smc_pnet.c 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_pnet.c 2022-09-29 15:25:06.000000000 +0200 @@ -97,7 +97,7 @@ { "add", 0, 0, 'a'}, { "show", 0, 0, 's'}, { "delete", 0, 0, 'd'}, - { "version", 0, 0, 'V' }, + { "version", 0, 0, 'v' }, { "help", 0, 0, 'h' }, { NULL, 0, NULL, 0} }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_rnics new/smc-tools-1.8.2/smc_rnics --- old/smc-tools-1.7.0/smc_rnics 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_rnics 2022-09-29 15:25:06.000000000 +0200 @@ -1,8 +1,8 @@ #!/bin/bash -# Copyright IBM Corp. 2018, 2020 +# Copyright IBM Corp. 2018, 2022 -VERSION="1.7.0"; +VERSION="1.8.2"; function usage() { @@ -23,42 +23,62 @@ function print_header() { if [ $IBdev -eq 0 ]; then - printf " FID Power PCI_ID PCHID Type PPrt PNET_ID Net-Dev\n"; + printf " FID Power PCI_ID PCHID Type PPrt PNET_ID Net-Dev\n"; else - printf " FID Power PCI_ID PCHID Type IPrt PNET_ID IB-Dev\n"; + printf " FID Power PCI_ID PCHID Type IPrt PNET_ID IB-Dev\n"; fi - echo '-----------------------------------------------------------------------------------------'; + echo '------------------------------------------------------------------------------------------'; +} + +function get_softset_pnet_id() { + local res="n/a"; + local line; + local id; + local iface; + local dev; + local prt; + + while read -r line; do + read id iface dev prt <<< $line; + if [[ ("$iface" != "n/a" && "$iface" == "$int") || ("$dev" != "n/a" && "$dev" == "$addr") ]]; then + if [ "$prt" != "255" ] && [ "$prt" != "$iport" ]; then + continue; + fi + res="$id*"; + fi + done <<< "$(smc_pnet)" + + echo "$res"; } function get_pnet_from_port() { local idx; local end; local lport=$port; + local iport; local res; if [ "$lport" == "" ]; then echo ""; return; fi - if [ "$lport" == "n/a" ] || [ "$dev_type" == "RoCE_Express2" ]; then - if [ $IBdev -eq 0 ]; then - lport=0; - else - lport=1; - fi + if [ "$lport" == "n/a" ] || [ "$dev_type" != "RoCE_Express" ]; then + lport=0; + else + [ $IBdev -ne 0 ] && let lport=$lport-1; fi - [ $IBdev -ne 0 ] && let lport=$lport-1; + (( iport=$lport+1 )) (( idx=16*$lport+1 )) (( end=$idx+15 )) res="`echo "$pnetids" | cut -c $idx-$end | sed 's/ //g'`"; if [ "$res" == "" ]; then - res="n/a"; + res="`get_softset_pnet_id`"; fi echo $res; } function print_rnic() { - printf "%8x %-5s %-12s %-4s %-14s %-4s %-16s %s\n" "$((16#$fid))" "$power" "$addr" "$pchid" "$dev_type" "$port" "`get_pnet_from_port`" "$int"; + printf "%8x %-5s %-12s %-4s %-14s %-4s %-17s %s\n" "$((16#$fid))" "$power" "$addr" "$pchid" "$dev_type" "$port" "`get_pnet_from_port`" "$int"; (( printed++ )); } @@ -74,6 +94,23 @@ fi; } +function set_by_firmware_lvl() { + local iface; + local name; + local lvl; + + name="Mlx_$id"; + which ethtool >/dev/null 2>&1; + if [ $? -eq 0 ] && [ "$int" != "n/a" ] && [ -d "net" ]; then + iface="`ls -1 net | head -1`"; + lvl="`ethtool -i $iface | grep -e "^firmware-version:" | awk '{print($2)}'`"; + if [ "${lvl%%.*}" == "22" ]; then + name="RoCE_Express3"; + fi + fi + set_RoCE_dev_and_port $name; +} + function print_rnics() { # iterate over slots, as powered-off devices won't show elsewhere for fid in `ls -1 /sys/bus/pci/slots`; do @@ -115,7 +152,6 @@ vend=`cat vendor`; dev_type="${vend#0x}:${id#0x}"; if [ $rawIDs -eq 0 ]; then - # suppress all output except the devices we know case "$vend" in "0x1014" ) # IBM case "$id" in @@ -129,10 +165,10 @@ "0x1003" | \ "0x1004") dev_type="RoCE_Express";; "0x1016") set_RoCE_dev_and_port "RoCE_Express2";; + "0x101e") set_by_firmware_lvl;; *) set_RoCE_dev_and_port "Mlx_$id";; esac;; - *) - continue; + *) [ $all -eq 0 ] && continue esac fi pchid="`cat pchid | sed 's/^0x//'`"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_rnics.8 new/smc-tools-1.8.2/smc_rnics.8 --- old/smc-tools-1.7.0/smc_rnics.8 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_rnics.8 2022-09-29 15:25:06.000000000 +0200 @@ -34,7 +34,7 @@ .RI ( FID ). .TP .BR "\-a, \-\-all" -Include disabled devices in output +Include disabled and unknown devices in output .TP .BR "\-d, \-\-disable " \fIFID Set (R)NIC @@ -44,7 +44,12 @@ .BR "\-e, \-\-enable " \fIFID Set (R)NIC .I FID -online. +online. Note that devices other than (R)NICs are not displayed by default and +therefore, once enabled, will not appear in further output unless option +.BR -a +or +.BR -r +is specified. .TP .BR "\-h, \-\-help" Display a brief @@ -56,7 +61,7 @@ .TP .BR "\-r, \-\-rawids" Display raw PCI vendor and device codes in column. Note that this will -also toggle display of non-networking related devices. +also include unknown devices. .TP .BR "\-v, \-\-version" Display version information. @@ -89,7 +94,10 @@ Corresponding Infiniband port of an RNIC, if applicable. Starts counting at 1. .SS "PNET_ID" -Physical network ID, if defined in IOCDS. +Physical network ID. Has an asterisk +.B * +appended if defined via +.BR smc_pnet . .SS "Net-Dev" Network interface in Linux, if applicable. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smc_run new/smc-tools-1.8.2/smc_run --- old/smc-tools-1.7.0/smc_run 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smc_run 2022-09-29 15:25:06.000000000 +0200 @@ -10,6 +10,7 @@ # http://www.eclipse.org/legal/epl-v10.html # LIB_NAME="libsmc-preload.so" +VERSION="1.8.2"; function usage() { @@ -49,7 +50,7 @@ # if necessary. # SMC_DEBUG=0; -while getopts "dhr:t:" opt; do +while getopts "dhr:t:v" opt; do case $opt in d) SMC_DEBUG=1;; @@ -69,8 +70,7 @@ done shift $(expr $OPTIND - 1); -command_line=$@ -if [ "$command_line" == "" ]; then +if [ $# -eq 0 ]; then echo "`basename "$0"`: Error: Missing command parameter"; exit 1; fi @@ -81,5 +81,5 @@ # export LD_PRELOAD=$LD_PRELOAD:$LIB_NAME; -exec $command_line +exec "$@" exit $?; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smcss.c new/smc-tools-1.8.2/smcss.c --- old/smc-tools-1.7.0/smcss.c 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smcss.c 2022-09-29 15:25:06.000000000 +0200 @@ -325,7 +325,7 @@ { "listening", 0, 0, 'l' }, { "smcd", 0, 0, 'D' }, { "smcr", 0, 0, 'R' }, - { "version", 0, 0, 'V' }, + { "version", 0, 0, 'v' }, { "wide", 0, 0, 'W' }, { "help", 0, 0, 'h' }, { NULL, 0, NULL, 0} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/smctools_common.h new/smc-tools-1.8.2/smctools_common.h --- old/smc-tools-1.7.0/smctools_common.h 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/smctools_common.h 2022-09-29 15:25:06.000000000 +0200 @@ -19,7 +19,7 @@ #define STRINGIFY_1(x) #x #define STRINGIFY(x) STRINGIFY_1(x) -#define RELEASE_STRING "1.7.0" +#define RELEASE_STRING "1.8.2" #define PF_SMC 43 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/smc-tools-1.7.0/verify_release.sh new/smc-tools-1.8.2/verify_release.sh --- old/smc-tools-1.7.0/verify_release.sh 2021-10-29 19:20:48.000000000 +0200 +++ new/smc-tools-1.8.2/verify_release.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,74 +0,0 @@ -#!/bin/bash - -# Consistency check: git branch -sref=`git symbolic-ref HEAD 2>/dev/null`; -if [ "${sref}" != "refs/heads/master" ]; then - echo; - echo " WARNING: Verifying release on non-master branch."; - echo; -fi - -# We assume that at least the Makefile carries the correct version info -VERSION=`grep -w SMC_TOOLS_RELEASE Makefile | head -1 | awk '{print($3)}'`; -echo "Detected version: v$VERSION"; - - -rc=0 -# Build to make sure the final files are up to date -make >/dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Error: Build failed"; - exit 7; -fi - -echo "Checking sources..." -# Consistency check: Do we have an entry in the README's "History" section...? -if [ `grep -A 100 "Release History:" README.md | grep "$VERSION" | wc -l` -ne 1 ]; then - echo " Error: 'README.md' is missing an entry for version '$VERSION' in 'Release History'"; - let rc=rc+1; -fi - -# Check .spec file -if [ -e smc-tools.spec ]; then - vspec="`grep -e "^Version: " smc-tools.spec | awk '{print($2)}'`"; - if [ "$vspec" != "$VERSION" ]; then - echo " Error: .spec file has version $vspec instead of $VERSION"; - let rc=rc+1; - fi -fi - -# Check shell scripts -for i in smc_rnics smc_dbg; do - if [ `grep "VERSION=" $i | grep "$VERSION" | wc -l` -ne 1 ]; then - echo " Error: $i has wrong version info"; - let rc=rc+1; - fi -done - -# Check C files -if [ `grep "RELEASE_STRING" smctools_common.h | grep "$VERSION" | wc -l` -ne 1 ]; then - echo " Error: smctools_common.h has wrong version in RELEASE_STRING"; - let rc=rc+1; -fi - - -# Run programs to verify actual output -echo "Checking output..."; -for i in smc_dbg smc_pnet smc_rnics smcd smcr smcss smc_chk; do - if [ `./$i -v 2>&1 | grep "$VERSION" | wc -l` -ne 1 ]; then - echo " Error: './$i -v' has wrong version info: `./$i -v`"; - let rc=rc+1; - fi -done - - -# Final verdict -echo; -if [ $rc -ne 0 ]; then - echo "Verification failed, $rc errors detected"; -else - echo "Verification successful"; -fi -echo; - -exit $rc;