From fbb08c9db9fe613ca204b5d6b7a651bf505aca1c Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 8 Jun 2024 18:06:01 +0200 Subject: [PATCH] Clean up some obsolete tools and references to non-git vcs's --- .gitignore | 1 - gnucash/gnucash-core-app.cpp | 2 +- util/git-backport.sh | 30 ------- util/glade-fixup | 38 -------- util/gnc-vcs-info | 109 ++--------------------- util/src-count/count.dat | 33 ------- util/src-count/count.gplot | 26 ------ util/src-count/count.sh | 139 ------------------------------ util/svnlog2ul/getlastcommit.xslt | 25 ------ util/svnlog2ul/log2ul.xslt | 35 -------- util/svnlog2ul/svnlog2ul.sh | 42 --------- 11 files changed, 6 insertions(+), 474 deletions(-) delete mode 100755 util/git-backport.sh delete mode 100755 util/glade-fixup delete mode 100644 util/src-count/count.dat delete mode 100644 util/src-count/count.gplot delete mode 100644 util/src-count/count.sh delete mode 100644 util/svnlog2ul/getlastcommit.xslt delete mode 100644 util/svnlog2ul/log2ul.xslt delete mode 100755 util/svnlog2ul/svnlog2ul.sh diff --git a/.gitignore b/.gitignore index 8b6aa164f1..f2706c5eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -150,7 +150,6 @@ gnucash/gnome/gnucash gnucash/gnome/gnucash.desktop gnucash/gnome/gnucash.desktop.in gnucash/gnome-utils/gnucash -gnucash/gnome-utils/gnc-svninfo.h gnucash/gnome-utils/gnc-version.h gnucash/gnome-utils/gnucash gnucash/gnome-utils/test/test-gnc-dialog diff --git a/gnucash/gnucash-core-app.cpp b/gnucash/gnucash-core-app.cpp index e35055a274..c9a3715c7d 100644 --- a/gnucash/gnucash-core-app.cpp +++ b/gnucash/gnucash-core-app.cpp @@ -59,7 +59,7 @@ static QofLogModule log_module = GNC_MOD_GUI; #include #include -/* GNC_VCS is defined whenever we're building from an svn/svk/git/bzr tree */ +/* GNC_VCS is defined whenever we're building from a git work tree */ #ifdef GNC_VCS constexpr int is_development_version = TRUE; #else diff --git a/util/git-backport.sh b/util/git-backport.sh deleted file mode 100755 index 5c65ec9cbd..0000000000 --- a/util/git-backport.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -REV=$1 -: ${ORIGBRANCH=trunk} -: ${WHOAMI=`whoami`} - -TMPFILE=tmplog.tmp -#TMPFILE2=tmplog2.tmp - -# Cherry-pick the other commit -ORIGID=`git svn find-rev r${REV} ${ORIGBRANCH}` -if [ -z "${ORIGID}" ] ; then - echo "Revision ${REV} not found in branch ${ORIGBRANCH}" - exit 1 -fi -git cherry-pick ${ORIGID} - -# Create new log message by modifying the old one -git log --pretty=format:"[$REV] %s%n%n%b" HEAD^..HEAD \ - | grep -v '^BP$' | grep -v 'git-svn-id:' > ${TMPFILE} -OTHERAUTHOR=`git log --pretty=format:"%an" HEAD^..HEAD` -if [ "${WHOAMI}" != "${OTHERAUTHOR}" ]; then - echo -e "\nOriginal commit by ${OTHERAUTHOR}." >> ${TMPFILE} -fi - -# Commit new log message -git commit --amend -F ${TMPFILE} - -# Clean up temporary files -rm -f ${TMPFILE} diff --git a/util/glade-fixup b/util/glade-fixup deleted file mode 100755 index ffa1a05caa..0000000000 --- a/util/glade-fixup +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# Remove entries that are for post-gtk2.8 attributes. Glade on a -# gtk2.8 system will complain when unknown attributes are present on a -# widget. -# -# This script should be run from the top-level source directory before -# committing changed glade files. -# - -if test -d src ; then - SEARCHDIRS=src -else - SEARCHDIRS=. -fi - -find ${SEARCHDIRS} -name \*.glade | xargs \ - sed -i -e '/name="image_position"/d' \ - -e '/name="inner_border"/d' - -# GTK 2.6 (now allowed) -# add_tearoffs -# angle -# ellipsize -# focus_on_map -# hover_expand -# hover_selection -# single_line_mode -# width_chars -# -# GTK 2.8 (now allowed) -# child_pack_direction -# pack_direction -# urgency_hint -# -# GTK 2.10 -# image_position -# inner_border diff --git a/util/gnc-vcs-info b/util/gnc-vcs-info index a24b4be051..0e38e784a3 100755 --- a/util/gnc-vcs-info +++ b/util/gnc-vcs-info @@ -10,7 +10,7 @@ # With -t prints the vcs type that was detected to stdout and exits 0 # on success. # -# Exits with errorcode 1 if we're not in an bzr, svn, svk or git checkout +# Exits with errorcode 1 if we're not in a git work tree # # Written By: Derek Atkins # Updated By: Geert Janssens @@ -33,9 +33,9 @@ if [ "$BUILDING_FROM_VCS" = "0" -o \ "$BUILDING_FROM_VCS" = "no" -o \ "$BUILDING_FROM_VCS" = "false" ]; then # Something outside of the Gnucash build system knows that we - # are NOT building from svn, svk or git checkout. + # are NOT building from a git work tree. # We should believe it (needed by packagers that maintain the - # packaging code in svn, svk or git too) + # packaging code in git too) echo "Environment variable BUILDING_FROM_VCS=$BUILDING_FROM_VCS" >&2 exit 1 fi @@ -72,39 +72,7 @@ else real_srcdir="$srcdir" fi -# Test if this code is an SVN Checkout -# If this is an svn checkout we assume you have svnversion! -if test -d "${real_srcdir}"/.svn -then - # If we're only interested in the vcs type, then we're done here - if [ "$request" = "type" ] - then - echo "svn" - exit 0 - fi - - if [ "$request" = "date" ] - then - echo $(svn info "$real_srcdir}" | awk '/Last Changed Date/ { print $4 }') - exit 0 - fi - - # svnversion without options returns the most recent revision in the repo - # at the time of the last svn update/checkout even if that revision - # didn't hold any changes in the current path. Not very useful as a - # reference. Better is to ask for the last changed revision with -c. - # BUT: -c option for some reason always considers svn working copy - # as having mixed sources. We're only interested in the last part so - # we strip the beginning revision if it's there. - # As a result if your WC really has mixed sources, that will not be - # visible in the version number... - svn_mixed_version=$(svnversion -c "$real_srcdir") - echo ${svn_mixed_version#*:} - exit $? -fi - -# If we get here then this is NOT an svn checkout. -# Maybe it's git? +# Test if this code is in a git worktree real_gitdir="${real_srcdir}"/.git if test -d "${real_gitdir}" || test -e "${real_gitdir}" then @@ -145,73 +113,6 @@ then else exit 1 fi -fi - -if test -d "${real_srcdir}"/.bzr ; -then - # If we're only interested in the vcs type, then we're done here - if [ "$request" = "type" ] - then - echo "bzr" - exit 0 - fi - - if [ "$request" = "date" ] - then - # FIXME Don't know how to extract the commit's date from a bzr commit... - echo $(date +%Y-%m-%d) - exit 0 - fi - - bzrhead=`(cd "${real_srcdir}"; bzr version-info --custom --template='{revno}\n')` - if test $? = 0 ; then - echo "$bzrhead"; - exit 0 - else - exit 1 - fi -fi - -if test $OSTYPE -a $OSTYPE = "msys"; -then - svk_name="svk.bat" - svk_cmd="cmd \/c svk" else - svk_name="svk" - svk_cmd="svk" -fi - -# Maybe it's SVK? First, check if we've got 'svk' in the path. If not, -# then exit with an error code of 1.. -which $svk_name >/dev/null 2>&1 -if test $? != 0 ; then exit 1 ; fi - -# Okay, we have 'svk'. Now see if $real_srcdir is an svk checkout -# Note that the 'echo n' is to protect against having svk installed -# without having configured the depotmap. -svkinfo=`echo n | $svk_cmd info "$real_srcdir" 2>&1` -if test $? != 0 ; then exit 1 ; fi - -# If we got here, then $real_srcdir is an svk checkout. -# If we're only interested in the vcs type, then we're done here -if [ "$request" = "type" ] -then - echo "svk" - exit 0 -fi - -if [ "$request" = "date" ] -then - # FIXME Don't know how to extract the commit's date from an svk commit... - echo $(date +%Y-%m-%d) - exit 0 + exit 1 fi - - -# Parse out the revision info, print it out, and then output 0. Just combine -# all the revision numbers into a single string by combining them -# with periods. -svkinfo=`$svk_cmd info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'` -echo $svkinfo | sed -e 's/ /./g' - -exit 0 diff --git a/util/src-count/count.dat b/util/src-count/count.dat deleted file mode 100644 index 05f24c0ec2..0000000000 --- a/util/src-count/count.dat +++ /dev/null @@ -1,33 +0,0 @@ -# -# file: count.dat -# -# Raw data for the number of KLOC of code in gnucash, -# as a function of date. Taken from the web page -# https://www.gnucash.org/en/sizing.phtml -# format: day/month/year KLOC -# plot this by saying "gnuplot count.gplot" at the command line -# -# xacc-0.9 Sept 97 -1/9/1997 8.8 -# xacc-0.9w Dec 97 -1/12/1997 16.2 -# xacc-1.0.17 Feb 98 -1/2/1998 18.3 -# gnucash-1.1.15 Aug 98 -1/8/1998 34.7 -# gnucash-1.2.2 Aug 99 -1/8/1999 39.0 -# gnucash-1.3.6 April 2000 -1/4/2000 95.1 -# gnucash-1.4.6 Sept 2000 -# 1/9/2000 101.9 -# gnucash-1.4.12 April 2001 -# 1/4/2001 108.2 -# gnucash-1.5.2 Sept 2000 -1/9/2000 114.2 -# gnucash-1.6.0 June 2001 -1/6/2001 193.9 -# gnucash-1.7.2 November 2002 -1/11/2002 297.1 -# gnucash-1.8.4 June 2003 -1/6/2003 385.5 diff --git a/util/src-count/count.gplot b/util/src-count/count.gplot deleted file mode 100644 index 7c8816d335..0000000000 --- a/util/src-count/count.gplot +++ /dev/null @@ -1,26 +0,0 @@ -# -# file: count.gplot -# function: plot the number of lines of code in gnucash as function of date -# To generate the graph, say "gnuplot count.gplot" at the command line -# -# history: created by Linas Vepstas July 2004 -# -# set term x11 -# set term pbm -# set term gif size 400,300 -set term pbm medium color -set out 'count.png' -set data style linespoints -set xdata time -set timefmt "%d/%m/%Y" -# set format x "%m/%y" -set format x "%Y" -set xrange ["01/09/1997":"01/12/2003"] -set title "Number of Lines of code in GnuCash" -set key right -set xlabel "Year" -set logscale y -set ylabel "KLOC\nLogarithmic Scale" -plot "count.dat" using 1:2 title "kloc" - -# pause 1000 diff --git a/util/src-count/count.sh b/util/src-count/count.sh deleted file mode 100644 index a6a18922c4..0000000000 --- a/util/src-count/count.sh +++ /dev/null @@ -1,139 +0,0 @@ -#! /bin/sh -# -# Simple stupid utility to count lines of code -# The output may deceive you, remember to subtract 1 from file count - -# -# FIXME This script is very out of date. It doesn't count a number -# of source directories (such as gnome, ledger, engine,...) -# - -SRC_DIR=$(dirname $0)/../../src - -cd $SRC_DIR - -echo -echo -echo "app utils:" -wc $(find app-utils core-utils calculation gnc-module tax \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find app-utils core-utils calculation gnc-module tax \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) | wc - -echo -echo -echo "import export:" -wc $(find import-export \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find import-export \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) | wc - -echo -echo -echo "reports:" -wc $(find report \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find report \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) | wc - -echo -echo -echo "scheme misc:" -wc $(find scm \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find scm \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) |wc - -echo -echo -echo "Business:" -wc $(find business \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find business \ - \( -regex '.*test[^/]*' -prune \) -o \ - \( -path '*.svn' -prune \) -o \ - \( \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) | wc - -echo -echo -echo "test:" -wc $(find . \( -path '*.svn' -prune \) -o \ - \( -regex '.*/test.*/.*' -a \ - \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) -wc $(find . \( -path '*.svn' -prune \) -o \ - \( -regex '.*/test.*/.*' -a \ - \( -name '*.c' -o \ - -name '*.h' -o \ - -name '*.scm' \) -a \ - -print \) | sort ) | wc - -echo -echo -echo "internal docs" -wc $(find .. \( -path '*.svn' -prune \) -o \ - \( -name 'README*' -o \ - -name '*.txt' -o \ - -name '*.html' -o \ - -name '*.texinfo' -o \ - -name '*.dtd' \) -a \ - -print | sort ) -wc $(find .. \( -path '*.svn' -prune \) -o \ - \( -name 'README*' -o \ - -name '*.txt' -o \ - -name '*.html' -o \ - -name '*.texinfo' -o \ - -name '*.dtd' \) -a \ - -print | sort ) | wc - -cd - diff --git a/util/svnlog2ul/getlastcommit.xslt b/util/svnlog2ul/getlastcommit.xslt deleted file mode 100644 index ec37f19e10..0000000000 --- a/util/svnlog2ul/getlastcommit.xslt +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -]> - - - - - - - - - \ No newline at end of file diff --git a/util/svnlog2ul/log2ul.xslt b/util/svnlog2ul/log2ul.xslt deleted file mode 100644 index 3e35f3ffbc..0000000000 --- a/util/svnlog2ul/log2ul.xslt +++ /dev/null @@ -1,35 +0,0 @@ - - - - - -]> - - - - - - - - - -
    - -
- - -
- - -
  • - -
  • -
    -
    diff --git a/util/svnlog2ul/svnlog2ul.sh b/util/svnlog2ul/svnlog2ul.sh deleted file mode 100755 index 6b4418c9f5..0000000000 --- a/util/svnlog2ul/svnlog2ul.sh +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/bash -# -# svnlog2ul.sh -# -# This script will extract all the svn commit messages from the -# repository between two releases or from a previous release and the -# current checkout's HEAD. -# The result will be printed on standard out as a -# html unordered list ("bulleted list"). -# -# Parameters: -# -# : the svn tag for the release to start -# the commit message search -# : the svn tag for the release to end -# the commit message search -# -# The search will return all commit messages between -# and -# -# Examples: -# This will compile the changes between two tagged releases: -# svnlog2ul.sh 2.3.7 2.3.8 -# This will compile the changes between the tagged release and the -# current HEAD in checked out working copy: -# svnlog2ul.sh 2.4.7 - -oldrelease=$1 -newrelease=$2 - -dir=`dirname "$0"` - -oldrev=$(svn info --xml http://svn.gnucash.org/repo/gnucash/tags/$oldrelease | xsltproc "$dir/getlastcommit.xslt" -) -if [ "x$2" == "x" ] -then - newrev=$(svn info -r HEAD --xml | xsltproc "$dir/getlastcommit.xslt" -) - svn log -r$newrev:$oldrev --xml | xsltproc "$dir/log2ul.xslt" - -else - newrev=$(svn info --xml http://svn.gnucash.org/repo/gnucash/tags/$newrelease | xsltproc "$dir/getlastcommit.xslt" -) - svn log -r$newrev:$oldrev --xml http://svn.gnucash.org/repo/gnucash/tags/$newrelease | xsltproc "$dir/log2ul.xslt" - -fi -