Browse Source

Rename tools directory to utils (#1348)

utils is more common for helper scripts then tools which is too close to modules.

This renames the directory and updates files where it is used or mentioned.
Renames TOOLSDIR to UTILSDIR in makefiles.

See also:
* https://trac.osgeo.org/grass/wiki/G8SourceLayout
* https://lists.osgeo.org/pipermail/grass-dev/2020-June/094448.html
Vaclav Petras 3 years ago
parent
commit
de0fbc0051

+ 1 - 1
Makefile

@@ -26,7 +26,7 @@ DATE := $(shell date '+%d_%m_%Y')
 
 DIRS = \
 	demolocation \
-	tools \
+	utils \
 	include \
 	lib \
 	db \

+ 2 - 2
Vagrantfile

@@ -104,11 +104,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
       scripts = [
       "clean.sh",
       ];
-      scripts.each { |script| host.vm.provision :shell, :privileged => false, :path => "tools/vagrant/" << script }
+      scripts.each { |script| host.vm.provision :shell, :privileged => false, :path => "utils/vagrant/" << script }
     end
     scripts = [
       "compile.sh",
     ];
-    scripts.each { |script| host.vm.provision :shell, :privileged => false, :path => "tools/vagrant/" << script }
+    scripts.each { |script| host.vm.provision :shell, :privileged => false, :path => "utils/vagrant/" << script }
   end
 end

+ 3 - 3
doc/howto_release.md

@@ -17,7 +17,7 @@ Check examples if still compiling
 ### Fix typos in source code with
 
 ```bash
-tools/fix_typos.sh
+utils/fix_typos.sh
 ```
 
 ### i18N: sync from Transifex
@@ -29,7 +29,7 @@ master .po files
 
 ```bash
 cd locale
-sh ~/software/grass-addons/tools/transifex_merge.sh
+sh ~/software/grass-addons/utils/transifex_merge.sh
 make
 make verify
 # ... then fix .po files as needed.
@@ -179,7 +179,7 @@ md5sum grass-${VERSION}.tar.gz > grass-${VERSION}.md5sum
 Create Changelog file on release branch:
 
 ```bash
-python tools/gitlog2changelog.py
+python utils/gitlog2changelog.py
 mv ChangeLog ChangeLog_$VERSION
 head ChangeLog_$VERSION
 gzip ChangeLog_$VERSION

+ 1 - 1
doc/html_documentation.txt

@@ -15,7 +15,7 @@ HOWTO document in this GRASS version?
    the module with the --html-description qualifier:
      g.module --html-description
 
-- see also this script:  tools/build_html_index.html
+- see also this script:  utils/build_html_index.html
 
 - The Programmers' manual can by created from the inline Doxygen comments with:
      make htmldocs (or)

+ 1 - 1
gui/images/symbols/README

@@ -10,7 +10,7 @@ run script in symbol group directory (e.g. ./lib/symbol/symbol/basic)
 within a GRASS session. ImageMagic should take care of compressing the
 image as much as possible.
 
-    tools/symbol_to_img.sh
+    utils/symbol_to_img.sh
 
 Image should have 30x30 px to be displayed correctly in GUI dialog. If the symbol
 has different width and height, you are supposed to correct it (for example

+ 2 - 2
include/Make/Docs.make

@@ -92,8 +92,8 @@ html2pdfdoccomplete:
 
 changelog:
 	@ echo "creating ChangeLog file (following 'master' only)..."
-	@ # tools/gitlog2changelog.py creates a GNU style ChangeLog file:
-	python tools/gitlog2changelog.py
+	@ # utils/gitlog2changelog.py creates a GNU style ChangeLog file:
+	python utils/gitlog2changelog.py
 
 .PHONY: htmldocs-single htmldocs packagehtmldocs pdfdocs cleandocs html2pdfdoc
 .PHONY: html2pdfdoccomplete changelog

+ 1 - 1
include/Make/Doxyfile_arch_html.in

@@ -708,7 +708,7 @@ EXCLUDE                = bin.@ARCH@ \
                          sites \
                          temporal \
                          testsuite \
-                         tools \
+                         utils \
                          vector \
                          visualization
 

+ 1 - 1
include/Make/Doxyfile_arch_latex.in

@@ -708,7 +708,7 @@ EXCLUDE                = bin.@ARCH@ \
                          sites \
                          temporal \
                          testsuite \
-                         tools \
+                         utils \
                          vector \
                          visualization
 

+ 2 - 2
include/Make/Grass.make

@@ -62,7 +62,7 @@ HTMLDIR         = $(ARCH_DISTDIR)/docs/html
 SCRIPTDIR       = $(ARCH_DISTDIR)/scripts
 MSG_DIR         = $(ARCH_DISTDIR)/etc/msgs
 MO_DIR          = $(ARCH_DISTDIR)/locale
-TOOLSDIR	= $(ARCH_DISTDIR)/tools
+UTILSDIR        = $(ARCH_DISTDIR)/utils
 
 FONTDIR         = $(ARCH_DISTDIR)/fonts
 
@@ -97,7 +97,7 @@ YFLAGS      = -d -v
 MANSECT = 1
 MANBASEDIR = $(ARCH_DISTDIR)/docs/man
 MANDIR = $(MANBASEDIR)/man$(MANSECT)
-HTML2MAN = VERSION_NUMBER=$(GRASS_VERSION_NUMBER) $(GISBASE)/tools/g.html2man.py
+HTML2MAN = VERSION_NUMBER=$(GRASS_VERSION_NUMBER) $(GISBASE)/utils/g.html2man.py
 
 GDAL_LINK = $(USE_GDAL)
 GDAL_DYNAMIC = 1

+ 2 - 2
include/Make/GuiScript.make

@@ -29,12 +29,12 @@ endif
 
 $(HTMLDIR)/g.gui.%.html: g.gui.%.html g.gui.%.tmp.html | $(HTMLDIR)
 	VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \
-        $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
+        $(PYTHON) $(GISBASE)/utils/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
 
 $(HTMLDIR)/wxGUI.%.html: g.gui.%.html | $(HTMLDIR)
 	-rm -f g.gui.$*.tmp.html
 	VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \
-        $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
+        $(PYTHON) $(GISBASE)/utils/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
 
 g.gui.%.tmp.html: $(SCRIPTDIR)/g.gui.%
 	$(call htmldesc,$<,$@)

+ 1 - 1
include/Make/Html.make

@@ -5,7 +5,7 @@ include $(MODULE_TOPDIR)/include/Make/HtmlRules.make
 
 $(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC) $(IMGDST) | $(HTMLDIR)
 	VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \
-        $(PYTHON) $(GISBASE)/tools/mkhtml.py $* > $@
+        $(PYTHON) $(GISBASE)/utils/mkhtml.py $* > $@
 
 $(MANDIR)/%.$(MANSECT): $(HTMLDIR)/%.html
 	$(HTML2MAN) "$<" "$@"

+ 2 - 2
include/Make/Install.make

@@ -14,7 +14,7 @@ BIN_DIST_FILES = $(FILES) \
 	lib \
 	locale \
 	scripts \
-	tools \
+	utils \
 	share
 
 # Shell commands
@@ -214,7 +214,7 @@ srclibsdist: distclean
 
 	@ # needed to store code in package with grass-version path:
 	-cp -L * ./grass-lib-$(GRASS_VERSION_NUMBER)
-	-cp -rL tools ./grass-lib-$(GRASS_VERSION_NUMBER)
+	-cp -rL utils ./grass-lib-$(GRASS_VERSION_NUMBER)
 	-cp -rL demolocation ./grass-lib-$(GRASS_VERSION_NUMBER)
 	-cp -rL include ./grass-lib-$(GRASS_VERSION_NUMBER)
 	-cp -rL --parents lib/external/shapelib ./grass-lib-$(GRASS_VERSION_NUMBER)

+ 3 - 3
include/Make/Rules.make

@@ -6,7 +6,7 @@ first: pre default
 ARCH_DIRS = $(ARCH_DISTDIR) $(ARCH_BINDIR) $(ARCH_INCDIR) $(ARCH_LIBDIR) \
 	$(BIN) $(ETC) \
 	$(DRIVERDIR) $(DBDRIVERDIR) $(FONTDIR) $(DOCSDIR) $(HTMLDIR) \
-	$(MANBASEDIR) $(MANDIR) $(TOOLSDIR)
+	$(MANBASEDIR) $(MANDIR) $(UTILSDIR)
 
 pre: | $(ARCH_DIRS)
 
@@ -26,11 +26,11 @@ ifdef CROSS_COMPILING
 # build system is not MS Windows when cross-compiling
 mkpath = $(1):$(2)
 else
-ifeq ($(wildcard $(TOOLSDIR)/g.echo$(EXE)),)
+ifeq ($(wildcard $(UTILSDIR)/g.echo$(EXE)),)
 # dummy path until g.echo.exe gets compiled and is needed
 mkpath = $(1);$(2)
 else
-mkpath = $(shell $(TOOLSDIR)/g.echo$(EXE) $(1));$(2)
+mkpath = $(shell $(UTILSDIR)/g.echo$(EXE) $(1));$(2)
 endif
 endif
 else

+ 1 - 1
raster/r.colors/Makefile

@@ -14,7 +14,7 @@ default: multi thumbnails
 
 thumbnails: $(BIN)/r.mapcalc$(EXE) $(BIN)/r.colors$(EXE) $(HTMLDIR)/colortables
 ifndef CROSS_COMPILING
-	-$(call run_grass, $(GRASS_HOME)/tools/thumbnails.py)
+	-$(call run_grass, $(GRASS_HOME)/utils/thumbnails.py)
 endif
 
 $(HTMLDIR)/colortables: $(HTMLDIR)

+ 3 - 3
tools/Makefile

@@ -5,10 +5,10 @@ SUBDIRS = timer g.html2man
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Compile.make
 
-default: parsubdirs $(TOOLSDIR)/mkhtml.py $(TOOLSDIR)/g.echo$(EXE)
+default: parsubdirs $(UTILSDIR)/mkhtml.py $(UTILSDIR)/g.echo$(EXE)
 
-$(TOOLSDIR)/mkhtml.py: mkhtml.py
+$(UTILSDIR)/mkhtml.py: mkhtml.py
 	$(INSTALL) $< $@
 
-$(TOOLSDIR)/g.echo$(EXE): $(OBJDIR)/g.echo.o
+$(UTILSDIR)/g.echo$(EXE): $(OBJDIR)/g.echo.o
 	$(call linker_base,$(LINK),$(LDFLAGS) $(EXTRA_LDFLAGS),$(MANIFEST_OBJ))

tools/copywrite.pl → utils/copywrite.pl


tools/create_python_init_file.py → utils/create_python_init_file.py


+ 1 - 1
tools/dep_tree2sql.sh

@@ -17,7 +17,7 @@
 # From: Glynn Clements <glynn at gclements.plus.com>
 # Date: Mon, 12 Jun 2006 13:00:25 +0100
 #
-# Usage: after having compiled GRASS, run "tools/dep_tree2sql.sh `pwd`" from the
+# Usage: after having compiled GRASS, run "utils/dep_tree2sql.sh `pwd`" from the
 # top of the GRASS source tree.
 #
 # Essentially, the script runs "nm" on every object file, library and

+ 1 - 1
tools/fix_typos.sh

@@ -5,7 +5,7 @@
 # https://trac.osgeo.org/gdal/browser/trunk/gdal/scripts/fix_typos.sh
 #
 # Run in main source code directory of GRASS GIS:
-# sh tools/fix_typos.sh
+# sh utils/fix_typos.sh
 #
 #
 ###############################################################################

tools/g.echo.c → utils/g.echo.c


+ 3 - 3
tools/g.html2man/Makefile

@@ -2,12 +2,12 @@ MODULE_TOPDIR = ../..
 
 include $(MODULE_TOPDIR)/include/Make/Other.make
 
-TARGETS := $(patsubst %.py,$(TOOLSDIR)/%.py,ghtml.py ggroff.py g.html2man.py)
+TARGETS := $(patsubst %.py,$(UTILSDIR)/%.py,ghtml.py ggroff.py g.html2man.py)
 
 default: $(TARGETS)
 
-$(TOOLSDIR)/g.html2man.py: g.html2man.py
+$(UTILSDIR)/g.html2man.py: g.html2man.py
 	$(INSTALL) $< $@
 
-$(TOOLSDIR)/%.py: %.py
+$(UTILSDIR)/%.py: %.py
 	$(INSTALL_DATA) $< $@

tools/g.html2man/README → utils/g.html2man/README


tools/g.html2man/g.html2man.py → utils/g.html2man/g.html2man.py


tools/g.html2man/ggroff.py → utils/g.html2man/ggroff.py


tools/g.html2man/ghtml.py → utils/g.html2man/ghtml.py


tools/g.html2man/htmltags.txt → utils/g.html2man/htmltags.txt


tools/g.html2man/rest.py → utils/g.html2man/rest.py


tools/gitlog2changelog.py → utils/gitlog2changelog.py


tools/grass_indent.sh → utils/grass_indent.sh


+ 3 - 3
tools/grass_indent_ALL.sh

@@ -3,11 +3,11 @@
 # HANDLE WITH CARE
 # loops over entire GRASS source code tree and indents source code according to SUBMITTING rules
 
-#are we in the tools/ dir? We should not.
-if [ ! -d tools ] ; then
+#are we in the utils/ dir? We should not.
+if [ ! -d utils ] ; then
  echo "ERROR: this script must be run from the main GRASS source code directory" >&2
  exit 1
 fi
 
 echo "Indenting *.c and *.h..." >&2
-find . -type f -name "*.[ch]" -print0 | xargs -0 ./tools/grass_indent.sh
+find . -type f -name "*.[ch]" -print0 | xargs -0 ./utils/grass_indent.sh

tools/mkhtml.py → utils/mkhtml.py


tools/mkrest.py → utils/mkrest.py


+ 2 - 2
tools/module_synopsis.sh

@@ -14,7 +14,7 @@
 #############################################################################
 #
 # PDF output requires the Palatino font.
-# Run this script from the tools/ directory in the souce code.
+# Run this script from the utils/ directory in the source code.
 #   (TeX needs to be able to find grasslogo_vector.pdf)
 #
 
@@ -190,7 +190,7 @@ sort "$TMP" > "$SYNOP"
 cp "$SYNOP" "${TMP}.txt"
 
 ####### create HTML source #######
-# poor cousin to full_index.html from tools/build_html_index.sh
+# poor cousin to full_index.html from build_html_index.sh
 # todo $MODULE.html links
 g.message "Generating HTML (writing to \$GISBASE/docs/html/) ..."
 

+ 1 - 1
tools/pep8config.txt

@@ -10,7 +10,7 @@
 # This configuration should work for all Python library, Python scripts and
 # wxPython GUI.
 # Example for gui/wxpython:
-#   pep8 --config=../../tools/pep8config.txt lmgr/
+#   pep8 --config=../../utils/pep8config.txt lmgr/
 
 # A lot of errors need to be ignored now to avoid a large number of messages.
 # Files need to be fixed one by one (without this configuration).

tools/ppmrotate.py → utils/ppmrotate.py


+ 1 - 1
tools/pylintrc.txt

@@ -10,7 +10,7 @@
 # This configuration should work for all Python library, Python scripts and
 # wxPython GUI.
 # Example for gui/wxpython:
-#   pylint --rcfile=../../tools/pylintrc.txt -f parseable -r n -i y lmgr/
+#   pylint --rcfile=../../utils/pylintrc.txt -f parseable -r n -i y lmgr/
 
 # A lot of errors need to be ignored now to avoid a large number of messages.
 # Files need to be fixed one by one (partially without this configuration).

tools/symbol_to_img.sh → utils/symbol_to_img.sh


tools/thumbnails.py → utils/thumbnails.py


tools/timer/Makefile → utils/timer/Makefile


tools/timer/README → utils/timer/README


tools/timer/main.c → utils/timer/main.c


tools/vagrant/clean.sh → utils/vagrant/clean.sh


tools/vagrant/compile.sh → utils/vagrant/compile.sh


+ 1 - 1
vector/v.colors/Makefile

@@ -12,7 +12,7 @@ include $(MODULE_TOPDIR)/include/Make/Module.make
 default: cmd
 
 thumbnails: $(BIN)/r.mapcalc$(EXE)
-	-$(call run_grass, $(GRASS_HOME)/tools/thumbnails.py)
+	-$(call run_grass, $(GRASS_HOME)/utils/thumbnails.py)
 
 .PHONY: thumbnails