diff --git a/SOURCES/cscope-cscope-indexer-help.patch b/SOURCES/cscope-cscope-indexer-help.patch new file mode 100644 index 0000000..08efb2a --- /dev/null +++ b/SOURCES/cscope-cscope-indexer-help.patch @@ -0,0 +1,52 @@ +diff -up ./contrib/xcscope/cscope-indexer.help ./contrib/xcscope/cscope-indexer +--- ./contrib/xcscope/cscope-indexer.help 2017-12-07 10:45:07.000000000 -0500 ++++ ./contrib/xcscope/cscope-indexer 2019-06-24 15:46:31.484852474 -0400 +@@ -80,6 +80,37 @@ RECURSE= + VERBOSE= + export DIR RECURSE # Need to pass these to subprocesses + ++show_usage() { ++ ++cat << EOF ++ ++ cscope-indexer [ -v ] [-f database_file ] [-i list_file ] [ -l ] [ -r ] ++ ++ where: ++ ++ -f database_file ++ Specifies the cscope database file (default: cscope.out). ++ ++ -i list_file ++ Specifies the name of the file into which the list of files ++ to index is placed (default: cscope.files). ++ ++ -l ++ Suppress the generation/updating of the cscope database ++ file. Only a list of files is generated. ++ ++ -r ++ Recurse into subdirectories to locate files to index. ++ Without this option, only the current directory is ++ searched. ++ ++ -v ++ Be verbose. Output simple progress messages. ++ ++EOF ++ ++} ++ + while [ -n "$1" ] + do + case "$1" in +@@ -110,6 +141,10 @@ do + -v) + VERBOSE=1 + ;; ++ -h|--help) ++ show_usage ++ exit 0 ++ ;; + *) + DIR="$1" + ;; diff --git a/SOURCES/cscope-selftest-repoint.patch b/SOURCES/cscope-selftest-repoint.patch new file mode 100644 index 0000000..43f76f8 --- /dev/null +++ b/SOURCES/cscope-selftest-repoint.patch @@ -0,0 +1,216 @@ +diff -up ./tests/check0.sh.repoint ./tests/check0.sh +--- ./tests/check0.sh.repoint 2019-03-12 13:15:47.331320989 -0400 ++++ ./tests/check0.sh 2019-03-12 13:20:52.238304290 -0400 +@@ -5,6 +5,11 @@ SINDEX=0 + STERM=main + STYPE="find C symbol" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check1.sh.repoint ./tests/check1.sh +--- ./tests/check1.sh.repoint 2019-03-12 13:15:47.333320983 -0400 ++++ ./tests/check1.sh 2019-03-12 13:20:52.241304280 -0400 +@@ -5,6 +5,11 @@ SINDEX=1 + STERM=main + STYPE="symbol definition" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check2.sh.repoint ./tests/check2.sh +--- ./tests/check2.sh.repoint 2019-03-12 13:15:47.334320979 -0400 ++++ ./tests/check2.sh 2019-03-12 13:20:52.245304266 -0400 +@@ -5,6 +5,11 @@ SINDEX=2 + STERM=build + STYPE="functions called by" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -13,7 +18,7 @@ cd .. + #Remove any previous databases from testing + rm -f cscope.out + +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check3.sh.repoint ./tests/check3.sh +--- ./tests/check3.sh.repoint 2019-03-12 13:15:47.335320976 -0400 ++++ ./tests/check3.sh 2019-03-12 13:20:52.248304256 -0400 +@@ -5,6 +5,11 @@ SINDEX=3 + STERM=printf + STYPE="functions calling" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -14,7 +19,7 @@ cd .. + rm -f cscope.out + + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check4.sh.repoint ./tests/check4.sh +--- ./tests/check4.sh.repoint 2019-03-12 13:15:47.336320973 -0400 ++++ ./tests/check4.sh 2019-03-12 13:20:52.252304243 -0400 +@@ -4,6 +4,11 @@ SINDEX=4 + STERM=oldsigquit + STYPE="regular text string" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -12,7 +17,7 @@ cd .. + #Remove any previous databases from testing + rm -f cscope.out + +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check6.sh.repoint ./tests/check6.sh +--- ./tests/check6.sh.repoint 2019-03-12 13:15:47.338320966 -0400 ++++ ./tests/check6.sh 2019-03-12 13:20:52.259304220 -0400 +@@ -5,6 +5,11 @@ SINDEX=6 + STERM=msg.*what + STYPE="egrep string" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check7.sh.repoint ./tests/check7.sh +--- ./tests/check7.sh.repoint 2019-03-12 13:15:47.339320963 -0400 ++++ ./tests/check7.sh 2019-03-12 13:20:52.263304206 -0400 +@@ -5,6 +5,11 @@ SINDEX=7 + STERM=main.c + STYPE="file named" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check8.sh.repoint ./tests/check8.sh +--- ./tests/check8.sh.repoint 2019-03-12 13:15:47.340320959 -0400 ++++ ./tests/check8.sh 2019-03-12 13:20:52.267304193 -0400 +@@ -5,6 +5,11 @@ SINDEX=8 + STERM=unistd.h + STYPE="files including this file" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then +diff -up ./tests/check9.sh.repoint ./tests/check9.sh +--- ./tests/check9.sh.repoint 2019-03-12 13:15:47.341320956 -0400 ++++ ./tests/check9.sh 2019-03-12 13:20:52.270304183 -0400 +@@ -5,6 +5,11 @@ SINDEX=9 + STERM=reftime + STYPE="assignments to symbol" + ++if [ -z "$CSCOPE_BINARY" ] ++then ++ CSCOPE_BINARY=./src/cscope ++fi ++ + echo "Searching item $SINDEX, '$STYPE'" + + #Get to the top level directory +@@ -15,7 +20,7 @@ rm -f cscope.out + + #Count the number of instances of the string 'Copyright' + #We expect 178 currently +-COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++COUNT=$($CSCOPE_BINARY -R -L -$SINDEX$STERM | wc -l) + + if [ $COUNT -ne $EXPECT ] + then diff --git a/SOURCES/cscope-selftest.patch b/SOURCES/cscope-selftest.patch new file mode 100644 index 0000000..78075eb --- /dev/null +++ b/SOURCES/cscope-selftest.patch @@ -0,0 +1,350 @@ +commit efc92106173b5130e32587f6c788f19f2477051d +Author: Neil Horman +Date: Fri Jul 27 15:52:49 2018 -0400 + + Add make check test harness + + Start adding tests to self test cscope in travis ci + + Signed-off-by: Neil Horman + +diff --git a/Makefile.am b/Makefile.am +index ae0fc53..d79d44e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = doc src contrib ++SUBDIRS = doc src contrib tests + + EXTRA_DIST = INSTALL.gnu packages + +diff --git a/bootstrap.sh b/bootstrap.sh +new file mode 100755 +index 0000000..6a363ed +--- /dev/null ++++ b/bootstrap.sh +@@ -0,0 +1,7 @@ ++#!/bin/sh ++ ++aclocal ++autoheader ++autoconf ++automake --add-missing ++ +diff --git a/configure.in b/configure.in +index c51887d..e0a8b1f 100644 +--- a/configure.in ++++ b/configure.in +@@ -425,5 +425,5 @@ case "$host_os" in + ;; + esac + +-AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile contrib/Makefile]) ++AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile contrib/Makefile tests/Makefile]) + AC_OUTPUT +diff --git a/tests/Makefile.am b/tests/Makefile.am +new file mode 100644 +index 0000000..2278a71 +--- /dev/null ++++ b/tests/Makefile.am +@@ -0,0 +1,7 @@ ++check_SCRIPTS = check0.sh check1.sh check2.sh \ ++ check3.sh check4.sh check6.sh \ ++ check7.sh check8.sh check9.sh ++ ++TESTS = check0.sh check1.sh check2.sh \ ++ check3.sh check4.sh check6.sh \ ++ check7.sh check8.sh check9.sh +diff --git a/tests/check0.sh b/tests/check0.sh +new file mode 100755 +index 0000000..2487107 +--- /dev/null ++++ b/tests/check0.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=4 ++SINDEX=0 ++STERM=main ++STYPE="find C symbol" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check1.sh b/tests/check1.sh +new file mode 100755 +index 0000000..a80997b +--- /dev/null ++++ b/tests/check1.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=3 ++SINDEX=1 ++STERM=main ++STYPE="symbol definition" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check2.sh b/tests/check2.sh +new file mode 100755 +index 0000000..efbf2e5 +--- /dev/null ++++ b/tests/check2.sh +@@ -0,0 +1,25 @@ ++#!/bin/sh ++ ++EXPECT=96 ++SINDEX=2 ++STERM=build ++STYPE="functions called by" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check3.sh b/tests/check3.sh +new file mode 100755 +index 0000000..5ec8fc0 +--- /dev/null ++++ b/tests/check3.sh +@@ -0,0 +1,26 @@ ++#!/bin/sh ++ ++EXPECT=44 ++SINDEX=3 ++STERM=printf ++STYPE="functions calling" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check4.sh b/tests/check4.sh +new file mode 100755 +index 0000000..5a58d59 +--- /dev/null ++++ b/tests/check4.sh +@@ -0,0 +1,24 @@ ++#!/bin/sh ++EXPECT=3 ++SINDEX=4 ++STERM=oldsigquit ++STYPE="regular text string" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check6.sh b/tests/check6.sh +new file mode 100755 +index 0000000..b13b33e +--- /dev/null ++++ b/tests/check6.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=1 ++SINDEX=6 ++STERM=msg.*what ++STYPE="egrep string" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check7.sh b/tests/check7.sh +new file mode 100755 +index 0000000..3dc0706 +--- /dev/null ++++ b/tests/check7.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=1 ++SINDEX=7 ++STERM=main.c ++STYPE="file named" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check8.sh b/tests/check8.sh +new file mode 100755 +index 0000000..7bede78 +--- /dev/null ++++ b/tests/check8.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=9 ++SINDEX=8 ++STERM=unistd.h ++STYPE="files including this file" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ +diff --git a/tests/check9.sh b/tests/check9.sh +new file mode 100755 +index 0000000..87f59f3 +--- /dev/null ++++ b/tests/check9.sh +@@ -0,0 +1,27 @@ ++#!/bin/sh ++ ++EXPECT=2 ++SINDEX=9 ++STERM=reftime ++STYPE="assignments to symbol" ++ ++echo "Searching item $SINDEX, '$STYPE'" ++ ++#Get to the top level directory ++cd .. ++ ++#Remove any previous databases from testing ++rm -f cscope.out ++ ++#Count the number of instances of the string 'Copyright' ++#We expect 178 currently ++COUNT=$(./src/cscope -R -L -$SINDEX$STERM | wc -l) ++ ++if [ $COUNT -ne $EXPECT ] ++then ++ echo "Expected $EXPECT instances of $STYPE $STERM but found $COUNT" ++ exit 1 ++fi ++ ++exit 0 ++ diff --git a/SOURCES/cscope-version.patch b/SOURCES/cscope-version.patch new file mode 100644 index 0000000..51c95f5 --- /dev/null +++ b/SOURCES/cscope-version.patch @@ -0,0 +1,12 @@ +diff -up ./configure.in.version ./configure.in +diff -up ./src/version.h.version ./src/version.h +--- ./src/version.h.version 2019-06-03 10:06:42.185021824 -0400 ++++ ./src/version.h 2019-06-03 10:06:51.500994292 -0400 +@@ -40,6 +40,6 @@ + #define CSCOPE_VERSION_H + + #define FILEVERSION 15 /* Initial Open Source and Linux Port */ +-#define FIXVERSION ".8b" /* feature and bug fix version */ ++#define FIXVERSION ".9" /* feature and bug fix version */ + + #endif /* CSCOPE_VERSION_H */ diff --git a/SPECS/cscope.spec b/SPECS/cscope.spec index 9a80e99..2b8ecbd 100644 --- a/SPECS/cscope.spec +++ b/SPECS/cscope.spec @@ -1,12 +1,12 @@ Summary: C source code tree search and browse tool Name: cscope Version: 15.9 -Release: 2%{?dist} +Release: 6%{?dist} Source0: https://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz URL: http://cscope.sourceforge.net License: BSD and GPLv2+ Group: Development/Tools -BuildRequires: pkgconfig ncurses-devel flex bison m4 +BuildRequires: pkgconf-pkg-config ncurses-devel flex bison m4 BuildRequires: autoconf automake Requires: emacs-filesystem %if !0%{?rhel} @@ -14,6 +14,10 @@ Requires: xemacs-filesystem %endif Patch0: cscope-coverity-fixes.patch +Patch1: cscope-selftest.patch +Patch2: cscope-selftest-repoint.patch +Patch3: cscope-version.patch +Patch4: cscope-cscope-indexer-help.patch %define cscope_share_path %{_datadir}/cscope %define xemacs_lisp_path %{_datadir}/xemacs/site-packages/lisp @@ -31,11 +35,14 @@ matches for use in file editing. %prep %autosetup -p1 -autoreconf - %build +aclocal +autoheader +autoconf +automake --add-missing %configure make +make check %install rm -rf $RPM_BUILD_ROOT %{name}-%{version}.files @@ -89,6 +96,18 @@ rm -f %{emacs_lisp_path}/xcscope.el rm -f %{vim_plugin_path}/cctree.vim %changelog +* Tue Jun 25 2019 Neil Horman - 15.9-6 +- Fix covscan warning (bz 1722404) + +* Mon Jun 24 2019 Neil Horman - 15.9-5 +- update help for cscope-indexer (bz 1722404) + +* Mon Jun 03 2019 Neil Horman - 15.9-4 +- Fix cscope version (bz 1685920) + +* Thu Feb 28 2019 Neil Horman - 15.9-3 +- Add CI test harness (bz 1682353) + * Fri Oct 12 2018 Neil Horman - 15.9-2 - Fix up some coverity scan issues (bz 1602468)