Package: adabrowse Severity: serious Tags: patch Justification: Fails to build from source with current GNAT
Hello. The adabrowse Debian package must be rebuilt with gnat-6 and asis-2015. The attached patches fix this, and various cosmetic issues. Also, some existing bugs may probably be closed as obsolete.
>From 2a389cbb44e58e573b06f84f0a601cc64ce69718 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Thu, 2 Jun 2016 23:58:43 +0200 Subject: [PATCH 01/20] Replace HTTP with HTTPS in VCS-* fields. --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 3530be7..a3c958a 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> Build-Depends: debhelper (>= 9), gnat, gnat-4.9, libasis2014-dev, quilt Standards-Version: 3.9.6 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ -Vcs-Browser: http://git.codelabs.ch/?p=debian/adabrowse.git -Vcs-Git: http://git.codelabs.ch/git/debian/adabrowse.git +Vcs-Browser: https://git.codelabs.ch/?p=debian/adabrowse.git +Vcs-Git: https://git.codelabs.ch/git/debian/adabrowse.git Package: adabrowse Architecture: any -- 2.8.1
>From 05aa8bc36930cc62c8d56fef46c2a3ffeda66c1c Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:05:09 +0200 Subject: [PATCH 02/20] Switch to dpkg-source 3.0 (quilt) format. --- debian/README.source | 8 -------- debian/control | 2 +- debian/rules | 2 -- debian/source/format | 1 + 4 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 debian/README.source create mode 100644 debian/source/format diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index e35950e..0000000 --- a/debian/README.source +++ /dev/null @@ -1,8 +0,0 @@ -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. Please see: - -/usr/share/doc/quilt/README.source - -for more information on how to apply the patches, modify patches, or -remove a patch. diff --git a/debian/control b/debian/control index a3c958a..3870b64 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: adabrowse Section: devel Priority: optional Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> -Build-Depends: debhelper (>= 9), gnat, gnat-4.9, libasis2014-dev, quilt +Build-Depends: debhelper (>= 9), gnat, gnat-4.9, libasis2014-dev Standards-Version: 3.9.6 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ Vcs-Browser: https://git.codelabs.ch/?p=debian/adabrowse.git diff --git a/debian/rules b/debian/rules index b8a3398..7530d52 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,5 @@ #!/usr/bin/make -f -include /usr/share/quilt/quilt.make - DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- 2.8.1
>From adb94b6202fd4d44ea83fcf2b4422e91ec5ea3f5 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:06:11 +0200 Subject: [PATCH 03/20] Refreshed patches without timestamps noise. --- debian/patches/01-gnatmake.patch | 14 ++++++-------- debian/patches/02-use-gnatgcc.patch | 7 +++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/debian/patches/01-gnatmake.patch b/debian/patches/01-gnatmake.patch index ef86c26..522ca2f 100644 --- a/debian/patches/01-gnatmake.patch +++ b/debian/patches/01-gnatmake.patch @@ -1,10 +1,9 @@ Author: Ludovic Brenta <lbre...@debian.org> Description: Make sure never to call the "gnat" command, just "gnatmake" or "gnatgcc". -diff -Naurp adabrowse.orig/ad-driver.adb adabrowse/ad-driver.adb ---- adabrowse.orig/ad-driver.adb 2009-02-24 21:17:01.000000000 +0100 -+++ adabrowse/ad-driver.adb 2009-02-24 21:17:46.000000000 +0100 -@@ -660,7 +660,7 @@ package body AD.Driver is +--- a/ad-driver.adb ++++ b/ad-driver.adb +@@ -660,7 +660,7 @@ -- it needs (configuration pragmas, naming schemes, etc.) -- Note: we also pass on -X options! AD.Compiler.Set_Compile_Command @@ -13,10 +12,9 @@ diff -Naurp adabrowse.orig/ad-driver.adb adabrowse/ad-driver.adb AD.Projects.Get_Project_File_Name & ASU.To_String (Pass_On_Options)); end if; -diff -Naurp adabrowse.orig/ad-projects.ads adabrowse/ad-projects.ads ---- adabrowse.orig/ad-projects.ads 2009-02-24 21:17:01.000000000 +0100 -+++ adabrowse/ad-projects.ads 2009-02-24 21:17:46.000000000 +0100 -@@ -75,9 +75,10 @@ package AD.Projects is +--- a/ad-projects.ads ++++ b/ad-projects.ads +@@ -75,9 +75,10 @@ -- specified and no "-f" option is given, AdaBrowse will process all specs -- from the source files of the root project. -- diff --git a/debian/patches/02-use-gnatgcc.patch b/debian/patches/02-use-gnatgcc.patch index 2b7216e..047dcb6 100644 --- a/debian/patches/02-use-gnatgcc.patch +++ b/debian/patches/02-use-gnatgcc.patch @@ -1,10 +1,9 @@ Author: Adrian-Ken Rueegsegger <k...@codelabs.ch> Description: Use "gnatgcc" instead of just "gcc". -diff -Naurp adabrowse.orig/ad-setup.ads adabrowse/ad-setup.ads ---- adabrowse.orig/ad-setup.ads 2009-02-24 21:17:01.000000000 +0100 -+++ adabrowse/ad-setup.ads 2009-02-24 21:19:04.000000000 +0100 -@@ -11,6 +11,6 @@ package AD.Setup is +--- a/ad-setup.ads ++++ b/ad-setup.ads +@@ -11,6 +11,6 @@ private GNAT_Name : constant String := -- 2.8.1
>From 2dc26836ccc2ffe38e27a484b12072639ea6b6d3 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:09:04 +0200 Subject: [PATCH 04/20] Require dpkg-dev providing buildflags.mk. --- debian/control | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 3870b64..8636d0d 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,9 @@ Source: adabrowse Section: devel Priority: optional Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> -Build-Depends: debhelper (>= 9), gnat, gnat-4.9, libasis2014-dev +Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1), +# dpkg-dev 1.16.1 provides /usr/share/dpkg/default.mk + gnat, gnat-4.9, libasis2014-dev Standards-Version: 3.9.6 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ Vcs-Browser: https://git.codelabs.ch/?p=debian/adabrowse.git -- 2.8.1
>From 7bb547e46ed6236a3406b6800c5659489932ea21 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:13:15 +0200 Subject: [PATCH 05/20] Add CPPFLAGS to CFLAGS when compiling C sources. Replace handcrafted build flags with /usr/share/ada/debian_packaging.mk: - Compile C sources with gcc instead of gnatgcc. - Handle DEB_BUILD_OPTIONS=parallel=N. - Avoid lintian warning about setting an explicit library runpath. - Make exact command lines available for automatic log checkers. - Tell gnatmake to echo commands to stdout instead of stderr, avoiding buildds thinking it is inactive and killing it. --- debian/rules | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/debian/rules b/debian/rules index 7530d52..7e3e584 100755 --- a/debian/rules +++ b/debian/rules @@ -2,12 +2,7 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk - -ADAFLAGS := $(filter-out -Wformat -Werror=format-security, $(CFLAGS)) -export ADAFLAGS - -CPUS := $(shell getconf _NPROCESSORS_ONLN) -CC := gcc +include /usr/share/ada/debian_packaging*.mk %: dh ${@} @@ -18,8 +13,8 @@ override_dh_auto_clean: override_dh_auto_build: mkdir -p obj - $(CC) -c util-nl.c -o obj/util-nl.o $(CFLAGS) - gnatmake -j$(CPUS) -Pdebian/misc/adabrowse.gpr + $(CC) -c util-nl.c -o obj/util-nl.o $(CFLAGS) $(CPPFLAGS) + gnatmake $(BUILDER_OPTIONS) -Pdebian/misc/adabrowse.gpr override_dh_auto_test: override_dh_auto_install: -- 2.8.1
>From f81cdbbbdb85e3032f4f18ca43f491e6888c1e0a Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:31:20 +0200 Subject: [PATCH 06/20] Declare all phony targets for efficiency. Remove call to dh_clean (done by dh even if dh_auto_clean is overriden). Only mkdir or CC when necessary. Warn for unexpected targets instead of running dh. --- debian/rules | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/debian/rules b/debian/rules index 7e3e584..020cca6 100755 --- a/debian/rules +++ b/debian/rules @@ -4,20 +4,25 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/ada/debian_packaging*.mk -%: - dh ${@} +POLICY_TARGETS := binary binary-arch binary-indep build build-arch \ + build-indep clean +.PHONY: $(POLICY_TARGETS) +$(POLICY_TARGETS): + dh $@ + +# Prevent debhelper executing any upstream Makefile target. +.PHONY: $(addprefix override_dh_auto_, configure build test install clean) override_dh_auto_clean: rm -rf obj adabrowse sdefault.adb ad-projects-impl_yes-get_parent.adb - dh_clean -override_dh_auto_build: - mkdir -p obj - $(CC) -c util-nl.c -o obj/util-nl.o $(CFLAGS) $(CPPFLAGS) +override_dh_auto_build: obj/util-nl.o gnatmake $(BUILDER_OPTIONS) -Pdebian/misc/adabrowse.gpr +obj/util-nl.o: util-nl.c | obj + $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) +obj: + mkdir $@ -override_dh_auto_test: -override_dh_auto_install: - +.PHONY: override_dh_compress override_dh_compress: dh_compress -X.ads -X.adb -- 2.8.1
>From a7a28a51d05fee741191488e7cf039cf2b5cd72a Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:35:04 +0200 Subject: [PATCH 07/20] Enable all hardening flags. --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 020cca6..7ed5fee 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,6 @@ #!/usr/bin/make -f +DEB_BUILD_MAINT_OPTIONS := hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/ada/debian_packaging*.mk -- 2.8.1
>From 9f3c2afcdad1905116556dd902e74c0fbcdd226a Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:36:45 +0200 Subject: [PATCH 08/20] Standards-Version: 3.9.8 (no changes). --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 8636d0d..198955b 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1), # dpkg-dev 1.16.1 provides /usr/share/dpkg/default.mk gnat, gnat-4.9, libasis2014-dev -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ Vcs-Browser: https://git.codelabs.ch/?p=debian/adabrowse.git Vcs-Git: https://git.codelabs.ch/git/debian/adabrowse.git -- 2.8.1
>From fb0a195e9d4d9cf5ce0d4986ac3ef15cab365388 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:39:26 +0200 Subject: [PATCH 09/20] Build with gnat-6 and libasis2015-dev. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 198955b..38e43b7 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1), # dpkg-dev 1.16.1 provides /usr/share/dpkg/default.mk - gnat, gnat-4.9, libasis2014-dev + gnat, gnat-6, libasis2015-dev Standards-Version: 3.9.8 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ Vcs-Browser: https://git.codelabs.ch/?p=debian/adabrowse.git -- 2.8.1
>From 0c4c1d1fa76982c37f4e361ee3711b4b5f9b8390 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:47:55 +0200 Subject: [PATCH 10/20] Escape dashes in manpage. --- debian/manpages/adabrowse.1 | 193 ++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 96 deletions(-) diff --git a/debian/manpages/adabrowse.1 b/debian/manpages/adabrowse.1 index 22f4ff6..d27ee15 100644 --- a/debian/manpages/adabrowse.1 +++ b/debian/manpages/adabrowse.1 @@ -1,16 +1,16 @@ .TH ADABROWSE 1 "14 FEB 2004" "GNU Ada Tools" "AdaBrowse User Manual" .SH NAME -adabrowse \- Generate fully cross-referenced HTML rendering of Ada 95 +adabrowse \- Generate fully cross\-referenced HTML rendering of Ada 95 specs .SH SYNOPSIS -\fBadabrowse\fR [options] -f \fIfile\fR +\fBadabrowse\fR [options] \-f \fIfile\fR .SH DESCRIPTION -\fBadabrowse\fR produces a fully cross-referenced HTML rendering of +\fBadabrowse\fR produces a fully cross\-referenced HTML rendering of Ada 95 specs (no bodies) similar to what javadoc does for Java -sources. \fBadabrowse\fR is a command-line utility; it has no +sources. \fBadabrowse\fR is a command\-line utility; it has no graphical user interface. -\fBadabrowse\fR is highly configurable through command-line options, +\fBadabrowse\fR is highly configurable through command\-line options, style sheets, and configuration files. \fBadabrowse\fR completely takes apart the source code and produces a @@ -32,8 +32,9 @@ All variables .IP \(em 4 A type index containing all types and their primitive operations (the latter only for (tagged) record types, private types, and types -derived from those). The primitive operations list is fully cross- -referenced and ordered by newly defined, overridden, and inherited +derived from those). The primitive operations list is fully +cross\-referenced +and ordered by newly defined, overridden, and inherited operations. .IP \(em 4 Any other items @@ -43,8 +44,8 @@ Any other items There are two ways to use \fBadabrowse\fR: .IP 1. 4 -Call \fBadabrowse\fR for your spec: \fBadabrowse -f\fR \fIfile\fR (and -any other options as needed, in particular \fB-I\fR if the file is not +Call \fBadabrowse\fR for your spec: \fBadabrowse \-f\fR \fIfile\fR (and +any other options as needed, in particular \fB\-I\fR if the file is not in the current directory or depends on other units whose sources are not in the current directory!) If no tree file for the given unit exists, \fBadabrowse\fR will try to generate one. @@ -53,11 +54,11 @@ or .IP 1. 4 Generate the tree files for the specs you want to process by calling -\fBgnatgcc -c -gnatc -gnatt\fR \fIfile\fR (with the appropriate -\fB-I\fR options, if needed.) +\fBgnatgcc \-c \-gnatc \-gnatt\fR \fIfile\fR (with the appropriate +\fB\-I\fR options, if needed.) .IP 2. 4 -Call \fBadabrowse\fR for these specs: \fBadabrowse -f\fR \fIfile\fR -(and any other options, as needed [look in particular at \fB-T\fR!]). +Call \fBadabrowse\fR for these specs: \fBadabrowse \-f\fR \fIfile\fR +(and any other options, as needed [look in particular at \fB\-T\fR!]). .PP \fBadabrowse\fR generates HTML files by default in the current directory. @@ -66,118 +67,118 @@ directory. from specs or bodies: since the tree file of a body always also contains the information on the spec, it can work with either. .SH OPTIONS -.IP \fB-h\fR,\ \fB-?\fR,\ \fB-help\fR,\ \fB--help\fR +.IP \fB\-h\fR,\ \fB\-?\fR,\ \fB\-help\fR,\ \fB\-\-help\fR Writes a comprehensive help text. -.IP \fB-a\fR,\ \fB-all\fR,\ \fB--all\fR -Generate HTML not only for the unit given in the -f option, but also +.IP \fB\-a\fR,\ \fB\-all\fR,\ \fB\-\-all\fR +Generate HTML not only for the unit given in the \-f option, but also for all application units on which it depends semantically (transitive closure of "with"es and parent units). .IP Note that this option processes only the application units in the -transitive closure even if the "-g" option is also given; it does not +transitive closure even if the "\-g" option is also given; it does not process any "with"ed standard library unit. This also means that if -the unit given is a standard library unit, the "-all" option has no +the unit given is a standard library unit, the "\-all" option has no effect. This behavior is intentional: you'll normally generate HTML for the standard library once by processing all standard library units -explicitly, and you don't want to re-generate HTML for these units +explicitly, and you don't want to re\-generate HTML for these units each time one of your application unit "with"es a standard library unit. -.IP \fB-c\fR\ \fIfile\fR -Defines a configuration file for the HTML generator. Multiple \fB-c\fR +.IP \fB\-c\fR\ \fIfile\fR +Defines a configuration file for the HTML generator. Multiple \fB\-c\fR options may be given; the files are processed in the given order and may overwrite earlier config settings. -.IP \fB-f\fR\ \fIfile\fR +.IP \fB\-f\fR\ \fIfile\fR Gives the filename (*.ads) of the spec to process. This filename may -contain a path! See below for more comments. Only one \fB-f\fR option +contain a path! See below for more comments. Only one \fB\-f\fR option may be given. -.IP \fB-g\fR -If set, \fBadabrowse\fR also generates cross-references to items from -library units in the standard and run-time packages, except for items +.IP \fB\-g\fR +If set, \fBadabrowse\fR also generates cross\-references to items from +library units in the standard and run\-time packages, except for items from the implict package "Standard". Note: This can also be set by a configuration file key "Refs_To_Standard". The latter definition wins. -.IP \fB-G\fR\ \fIoutput_formats...\fR +.IP \fB\-G\fR\ \fIoutput_formats...\fR Specify the output formats \fBadabrowse\fR shall generate. The -\fB-G\fR option must be followed by one or more output format names, +\fB\-G\fR option must be followed by one or more output format names, given as separate arguments. Recognized output format names are \fBhtml\fR and \fBxml\fR (case insensitive). -.IP \fB-i\fR\ [\fIfile\fR] +.IP \fB\-i\fR\ [\fIfile\fR] If set, \fBadabrowse\fR will generate a package index if it runs in -"file input mode" (see below) or the \fB-all\fR option is set and the +"file input mode" (see below) or the \fB\-all\fR option is set and the output does not go to stdout. If a filename is given, the index is written to that file (or to -stdout, if the filename is "-"). +stdout, if the filename is "\-"). -.IP \fB-is\ [\fIfile\fR] -Same as -i, but generates an index using indentation for child units. +.IP \fB\-is\ [\fIfile\fR] +Same as \-i, but generates an index using indentation for child units. -.IP \fB-l\fR -Make \fBadabrowse\fR generate cross-references in HTML output using +.IP \fB\-l\fR +Make \fBadabrowse\fR generate cross\-references in HTML output using only the line number. This is what earlier versions of \fBadabrowse\fR -(up to and including V2.13) always did. As of V3.0, cross-references +(up to and including V2.13) always did. As of V3.0, cross\-references are constructed taking into account both line and column number of an item. You should use this option only if you have HTML documentation generated by earlier \fBadabrowse\fR versions and somehow cannot -re-generate that documentation. However, the recommended usage is +re\-generate that documentation. However, the recommended usage is never to use this option and to regenerate possibly already existing HTML documentation. -Note that HTML generated with \fB-l\fR is not compatible with HTML -generated without \fB-l\fR! Also, HTML generated by \fBadabrowse\fR +Note that HTML generated with \fB\-l\fR is not compatible with HTML +generated without \fB\-l\fR! Also, HTML generated by \fBadabrowse\fR 3.0 and beyond is compatible with HTML generated by \fBadabrowse\fR -2.13 and earlier only if the \fB-l\fR option is given. +2.13 and earlier only if the \fB\-l\fR option is given. Usage of this option generates a warning message on stderr. -.IP \fB-o\fR\ [\fIfile\fR] +.IP \fB\-o\fR\ [\fIfile\fR] Define the output file name. If not set, the output goes to a file with the name of the input and suffix \fB.html\fR. If \fIfile\fR specifies a directory (i.e., ends in a "\\" on Windows or a "/" on Unix), all generated HTML files will be put into that directory. If -the filename is "-", output is written to stdout. Only one \fB-o\fR +the filename is "\-", output is written to stdout. Only one \fB\-o\fR option may be given. -A dash as the filename ("-") is allowed only if there is exactly one +A dash as the filename ("\-") is allowed only if there is exactly one output format specified. If there are multiple output formats specified (e.g. both XML and HTML), output is not allowed to go to stdout. -.IP \fB-p\fR\ [\fIfile\fR] -As \fB-i\fR, but generates a subprogram index over all units +.IP \fB\-p\fR\ [\fIfile\fR] +As \fB\-i\fR, but generates a subprogram index over all units processed. -.IP \fB-private\fR,\ \fB--private\fR +.IP \fB\-private\fR,\ \fB\-\-private\fR If given, \fBadabrowse\fR will also process the private parts of packages and task or protected declarations. (By default, it doesn't do so but replaces the private parts by a comment saying "Implementation defined".) -.IP \fB-q\fR +.IP \fB\-q\fR Quiet mode: do not issue warning or info messages. Synonym to -\fB-w0\fR. +\fB\-w0\fR. -.IP \fB-s\fR\ \fIURL\fR +.IP \fB\-s\fR\ \fIURL\fR Defines the URL to the style sheet the generated HTML file shall use. This URL should be relative to the final place where you will put -the HTML files! Note that a \fB-s\fR option can be overwritten by a -later \fB-c\fR option, if the configuration file defines the key +the HTML files! Note that a \fB\-s\fR option can be overwritten by a +later \fB\-c\fR option, if the configuration file defines the key "Style_Sheet". -.IP \fB-t\fR\ [\fIfile\fR] -As \fB-i\fR, but generates a global type index over all units +.IP \fB\-t\fR\ [\fIfile\fR] +As \fB\-i\fR, but generates a global type index over all units processed. -.IP \fB-version\fR,\ \fB--version\fR +.IP \fB\-version\fR,\ \fB\-\-version\fR Print version information of \fBadabrowse\fR to stderr. -.IP \fB-w\fR\fIi\fR +.IP \fB\-w\fR\fIi\fR Sets the warning level of \fBadabrowse\fR. \fIi\fR may be one of the following: .PD 0 @@ -191,53 +192,53 @@ print all messages. .RE .PD -.IP \fB-x\fR +.IP \fB\-x\fR If set, \fBadabrowse\fR never overwrites existing HTML files. (May be -useful in conjunction with the \fB-a\fR option.) +useful in conjunction with the \fB\-a\fR option.) -.IP \fB-X\fB\ \fIname\fR\fB=\fR\fIvalue\fR +.IP \fB\-X\fB\ \fIname\fR\fB=\fR\fIvalue\fR Define an environment variable \fIname\fR with value \fIvalue\fR. The value supersedes any possibly already existing definition of \fIname\fR in the system's environment for this call to \fBadabrowse\fR. The new definition affects any configuration file processed subsequently and also the project file (if any). The \fIname\fR must not contain white space; if \fIvalue\fR contains white -space, quote the whole definition as in -X"user=John Doe". There may -or may not be white space between the \fB-X\fR and the variable +space, quote the whole definition as in \-X"user=John Doe". There may +or may not be white space between the \fB\-X\fR and the variable definition. -.IP \fB-I\fR\ \fIdirectory\fR +.IP \fB\-I\fR\ \fIdirectory\fR Define source paths for ASIS. Same semantics as for GNAT. Multiple -\fB-I\fR options may be given. +\fB\-I\fR options may be given. -.IP \fB-T\fR\ \fIdirectory\fR +.IP \fB\-T\fR\ \fIdirectory\fR Define pathes for ASIS to search for tree files (*.adt). Multiple -\fB-T\fR options may be given. +\fB\-T\fR options may be given. -Note that if you give a filename to the \fB-i\fR option that starts +Note that if you give a filename to the \fB\-i\fR option that starts with the letter "s", you must have a white space between the option -and the filename, otherwise it will be recognized as a \fB-is\fR -option. Also, if the filename starts with "-", there mustn't be any +and the filename, otherwise it will be recognized as a \fB\-is\fR +option. Also, if the filename starts with "\-", there mustn't be any whitespace between the option and the filename, for if there is, \fBadabrowse\fR will assume the filename to be the next option and -handle it as such (options all start with "-"), and not as a filename. +handle it as such (options all start with "\-"), and not as a filename. -The same caveat also applies to the \fB-p\fR option, if you want the +The same caveat also applies to the \fB\-p\fR option, if you want the subprogram index to go to a file named "rivate": there must be a blank, otherwise, the whole thing will be recognized as the -\fB-private\fR option. (Admittedly this is a rather pathological case, +\fB\-private\fR option. (Admittedly this is a rather pathological case, but it's mentioned here for completeness.) -.SH "THE -f OPTION" -The \fB-f\fR option has three different formats: +.SH "THE \-f OPTION" +The \fB\-f\fR option has three different formats: .IP 1. 4 -If the filename is "-" or "@-", \fBadabrowse\fR reads the unit specs +If the filename is "\-" or "@\-", \fBadabrowse\fR reads the unit specs of the units to process from stdin, one unit per line, until EOF is encountered. Empty lines are skipped. (If you try this interactively, you'll have to signal EOF yourself. Otherwise, this may be useful if the input comes from a pipe, like in -"ls -1 *.ads | adabrowse -f- ...") +"ls \-1 *.ads | adabrowse \-f\- ...") .IP 2. 4 If the filename starts with "@", \fBadabrowse\fR doesn't consider it a @@ -258,7 +259,7 @@ line continuations also are not allowed. In all three cases, a unit spec is a filename that may contain a path; a possible suffix is ignored. Note that a unit spec is a file name; in -other words, you give \fBtest-gen\fR, or \fBtest-gen.ads\fR, and not +other words, you give \fBtest\-gen\fR, or \fBtest\-gen.ads\fR, and not \fBTest.Gen\fR. The reason is simply that for most shell scripting languages, it is easier to work with filenames than to massage them into unit names (e.g. by replacing dashes by dots). Also, if you have @@ -266,19 +267,19 @@ krunched file names, there is no simple connection between the file name and the unit name. If a unit spec contains a path, the HTML file for that unit is placed -into that directory unless overridden by a \fB-o\fR option. Note that +into that directory unless overridden by a \fB\-o\fR option. Note that if the unit spec contains a path, you'll most probably also have to -set a \fB-T\fR or \fB-I\fR option, unless you do happen to have the +set a \fB\-T\fR or \fB\-I\fR option, unless you do happen to have the ASIS information available directly (i.e., a tree file for the unit in the current directory; but that's not exactly typical). -In file input mode, the \fB-o\fR option (if given at all) may either -be "-" (in which case all output goes to stdout) or specify a +In file input mode, the \fB\-o\fR option (if given at all) may either +be "\-" (in which case all output goes to stdout) or specify a directory, but must not specify a file. -\fBadabrowse\fR assumes a GNAT-like naming scheme for source and HTML +\fBadabrowse\fR assumes a GNAT\-like naming scheme for source and HTML files. It also assumes that there is one library unit per file. As of -V1.4, \fBadabrowse\fR can handle krunched file names in the \fB-f\fR +V1.4, \fBadabrowse\fR can handle krunched file names in the \fB\-f\fR option, provided it can find a source file, and it has the extension \fB.ads\fR. If so, \fBadabrowse\fR opens and parses the source file to extract the unit name, instead of deriving it directly from the file @@ -291,22 +292,22 @@ Generated HTML files always have the suffix ".html" (not ".htm"). .SH "INDEX GENERATION" Index generation is active when \fBadabrowse\fR is told to process several units, and the output does not go to stdout (when the -\fB-o-\fR option has been given). +\fB\-o\-\fR option has been given). There are several options controlling index generation: .PD 0 16 -.IP \fB-i\fR\ or\ \fB-is\fR 16 +.IP \fB\-i\fR\ or\ \fB\-is\fR 16 Switches on generation of a unit index. -.IP \fB-p\fR 16 +.IP \fB\-p\fR 16 Switches on generation of a subprogram index. -.IP \fB-t\fR 16 +.IP \fB\-t\fR 16 Switches on generation of a type index. .PD .PP All these options take an optional filename as a parameter. If a filename follows, the index will be written to that file (or to -stdout, if the filename happens to be "-"). If no filename is given, +stdout, if the filename happens to be "\-"). If no filename is given, some default name is chosen. All these options are actually maintained only for backwards @@ -319,26 +320,26 @@ not to break existing scripts using command line options of earlier cases: .PD 0 .IP \(bu 4 -In file input mode (\fB-f @\fR\fIfile_name\fR or \fB-f-\fR). +In file input mode (\fB\-f @\fR\fIfile_name\fR or \fB\-f\-\fR). .IP \(bu 4 -When using a project file (\fB-P\fR \fIproject_file_name\fR). +When using a project file (\fB\-P\fR \fIproject_file_name\fR). .IP \(bu 4 -When the \fB-all\fR option is given. +When the \fB\-all\fR option is given. .PD .PP If no filename is given, or it doesn't contain a path, it depends upon the setting of other options where the index will be placed: .PD 0 .IP \(bu 4 -In file input mode, if a \fB-o\fR option is given, it must specify a +In file input mode, if a \fB\-o\fR option is given, it must specify a directory. All HTML files, including the index, will be put into that directory. .IP \(bu 4 -If no \fB-o\fR option is given, but the first unit spec contains a +If no \fB\-o\fR option is given, but the first unit spec contains a path, the index is put into the directory designated by that path. .IP \(bu 4 -If not in file input mode, but the -all option has been given, the -\fB-o\fR option may specify a file name. The index is put into the +If not in file input mode, but the \-all option has been given, the +\fB\-o\fR option may specify a file name. The index is put into the directory designated by the path part of that file name (the current directory, if the filename doesn't contain a path). .IP \(bu 4 @@ -353,7 +354,7 @@ into that file in the given directory. If the filename contains only a path, \fBadabrowse\fR will use that path and create an index named "index.html" in the designated directory. -If a \fB-x\fR option is given (inhibiting overwriting of existing HTML +If a \fB\-x\fR option is given (inhibiting overwriting of existing HTML files) and a file exists already in the place where \fBadabrowse\fR wants to put the index, no index will be generated and \fBadabrowse\fR will issue a warning. It'll also warn if it cannot generate an index @@ -367,12 +368,12 @@ The full user's guide in /usr/share/doc/adabrowse. .SH BUGS The Debian package of \fBadabrowse\fR does not have the Project -Manager feature; the command-line option \fB-P\fR \fIproject_file\fR +Manager feature; the command\-line option \fB\-P\fR \fIproject_file\fR is therefore disabled. .SH AUTHOR \fBadabrowse\fR and the accompanying documentation was written by Thomas Wolf <tw...@acm.org>. -Ludovic Brenta <ludo...@ludovic-brenta.org> merely turned part of the +Ludovic Brenta <ludovic@ludovic\-brenta.org> merely turned part of the user's guide into this manual page for the Debian project. -- 2.8.1
>From 3d9391d040c8d23ef3b35623bce5121d86ab8a8b Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:49:23 +0200 Subject: [PATCH 11/20] Fix typo in manpage. --- debian/manpages/adabrowse.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/manpages/adabrowse.1 b/debian/manpages/adabrowse.1 index d27ee15..fdb0703 100644 --- a/debian/manpages/adabrowse.1 +++ b/debian/manpages/adabrowse.1 @@ -212,7 +212,7 @@ Define source paths for ASIS. Same semantics as for GNAT. Multiple \fB\-I\fR options may be given. .IP \fB\-T\fR\ \fIdirectory\fR -Define pathes for ASIS to search for tree files (*.adt). Multiple +Define paths for ASIS to search for tree files (*.adt). Multiple \fB\-T\fR options may be given. Note that if you give a filename to the \fB\-i\fR option that starts -- 2.8.1
>From 6f7d3cc68602541c0db62a43a6233a5199b01419 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 00:55:50 +0200 Subject: [PATCH 12/20] Register user's guide in doc-base. --- debian/adabrowse.doc-base.adabrowse-user-guide | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 debian/adabrowse.doc-base.adabrowse-user-guide diff --git a/debian/adabrowse.doc-base.adabrowse-user-guide b/debian/adabrowse.doc-base.adabrowse-user-guide new file mode 100644 index 0000000..96ae7a4 --- /dev/null +++ b/debian/adabrowse.doc-base.adabrowse-user-guide @@ -0,0 +1,13 @@ +Document: adabrowse-user-guide +Title: AdaBrowse User's Guide +Author: Thomas Wolf +Abstract: + AdaBrowse is a HTML generator for Ada 95: it automatically generates HTML + documentation from Ada 95 library unit specs, similar to what javadoc + does for Java, except that AdaBrowse is much more versatile and powerful. + It can even generate XML output in addition to HTML documentation. +Section: Programming/Ada + +Format: HTML +Index: /usr/share/doc/adabrowse/adabrowse_ug.html +Files: /usr/share/doc/adabrowse/adabrowse_ug.html -- 2.8.1
>From 1a8ecbff2749b30a8ea6acfaae4e06c32a58a941 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 01:00:07 +0200 Subject: [PATCH 13/20] Patch fixing broken link to GPL-2 in documentation. --- debian/patches/fix-link-to-gpl.diff | 14 ++++++++++++++ debian/patches/series | 1 + 2 files changed, 15 insertions(+) create mode 100644 debian/patches/fix-link-to-gpl.diff diff --git a/debian/patches/fix-link-to-gpl.diff b/debian/patches/fix-link-to-gpl.diff new file mode 100644 index 0000000..362536f --- /dev/null +++ b/debian/patches/fix-link-to-gpl.diff @@ -0,0 +1,14 @@ +Description: fix broken link to GPL-2. +Author: Nicolas Boulenguez <nico...@debian.org> + +--- a/doc/adabrowse_ug.html ++++ b/doc/adabrowse_ug.html +@@ -3668,7 +3668,7 @@ + warranty</EM>; without even the implied warranty of <EM>merchantability</EM> or <EM>fitness + for a particular purpose</EM>. See the GNU General Public License for more + details. You should have received a copy of the GNU General Public License +-with this distribution; see file <A HREF="GPL.txt">GPL.txt</A>. If not, write to the ++with this distribution; see file <A HREF="file:///usr/share/common-licenses/GPL-2">GPL-2</A>. If not, write to the + <CODE>Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA</CODE> + or try the URL <A HREF="http://www.gnu.org/licenses/gpl.html" TARGET="blank">http://www.gnu.org/licenses/gpl.html</A>. + </P> diff --git a/debian/patches/series b/debian/patches/series index 48a49ee..a1bde99 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 01-gnatmake.patch 02-use-gnatgcc.patch +fix-link-to-gpl.diff -- 2.8.1
>From c4cd1d3c5153ff791302b933f4ce5a51cb680ace Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 01:06:25 +0200 Subject: [PATCH 14/20] Install short changelog referencing versions.html. --- debian/adabrowse.docs | 1 + debian/misc/changelog | 1 + 2 files changed, 2 insertions(+) create mode 100644 debian/misc/changelog diff --git a/debian/adabrowse.docs b/debian/adabrowse.docs index 491a961..1a6ff2f 100644 --- a/debian/adabrowse.docs +++ b/debian/adabrowse.docs @@ -1,2 +1,3 @@ doc/*.css doc/*.html +debian/misc/changelog diff --git a/debian/misc/changelog b/debian/misc/changelog new file mode 100644 index 0000000..62b56e2 --- /dev/null +++ b/debian/misc/changelog @@ -0,0 +1 @@ +See versions.html. -- 2.8.1
>From 6f9c334d15c70a9f31a8c03b75777c9fee70860c Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 01:12:07 +0200 Subject: [PATCH 15/20] Typo pathes -> paths. --- debian/patches/series | 1 + debian/patches/typo-pathes.diff | 223 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 debian/patches/typo-pathes.diff diff --git a/debian/patches/series b/debian/patches/series index a1bde99..b112742 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 01-gnatmake.patch 02-use-gnatgcc.patch fix-link-to-gpl.diff +typo-pathes.diff diff --git a/debian/patches/typo-pathes.diff b/debian/patches/typo-pathes.diff new file mode 100644 index 0000000..3b97b43 --- /dev/null +++ b/debian/patches/typo-pathes.diff @@ -0,0 +1,223 @@ +Description: fix typo pathes->paths. +Author: Nicolas Boulenguez <nico...@debian.org> + +--- a/Makefile ++++ b/Makefile +@@ -20,7 +20,7 @@ + # directory in the PATH. + #------------------------------------------------------------------------------ + +-# It is assumed that the pathes to your ASIS installation are in your ++# It is assumed that the paths to your ASIS installation are in your + # ADA_INCLUDE_PATH and ADA_OBJECTS_PATH! + + # This makefile has become pretty complicated, mainly because of things +@@ -169,7 +169,7 @@ + + ifdef ADABROWSE_GNATSRC + +-# Set the pathes so that we can compile files from the GNAT source ++# Set the paths so that we can compile files from the GNAT source + # distribution without problems. If we don't do that, we will not be + # able to link, because the GNAT compiler sources also contain + # the library sources. We must therefore make sure that the installed +--- a/ad-exclusions.adb ++++ b/ad-exclusions.adb +@@ -24,7 +24,7 @@ + -- + -- <DL><DT><STRONG> + -- Purpose:</STRONG><DD> +--- Handling of "pathes": prefix URLs defined for cross-references.</DL> ++-- Handling of "paths": prefix URLs defined for cross-references.</DL> + -- + -- <!-- + -- Revision History +--- a/ad-exclusions.ads ++++ b/ad-exclusions.ads +@@ -24,7 +24,7 @@ + -- + -- <DL><DT><STRONG> + -- Purpose:</STRONG><DD> +--- Handling of "pathes": prefix URLs defined for cross-references.</DL> ++-- Handling of "paths": prefix URLs defined for cross-references.</DL> + -- + -- <!-- + -- Revision History +--- a/ad-file_ops.ads ++++ b/ad-file_ops.ads +@@ -68,7 +68,7 @@ + Options : in Ada.Strings.Unbounded.Unbounded_String) + return String; + -- Returns the full name of the file specified by @Name@. @Options@ should +- -- be a string of "-I" options giving pathes on which to look. Returns an ++ -- be a string of "-I" options giving paths on which to look. Returns an + -- empty string if the source cannot be found. + + procedure Create_Unique_File +--- a/ad-html-pathes.adb ++++ b/ad-html-pathes.adb +@@ -24,7 +24,7 @@ + -- + -- <DL><DT><STRONG> + -- Purpose:</STRONG><DD> +--- Handling of "pathes": prefix URLs defined for cross-references.</DL> ++-- Handling of "paths": prefix URLs defined for cross-references.</DL> + -- + -- <!-- + -- Revision History +@@ -49,7 +49,7 @@ + + -- We do longest-prefix matches in 'Get_Path' below. Probably the most + -- efficient data structure for this would be a trie, but since I assume +- -- that there won't be too many different pathes with keys that them- ++ -- that there won't be too many different paths with keys that them- + -- selves are prefixes of one another, this would be overkill. + + type Path; +--- a/ad-html-pathes.ads ++++ b/ad-html-pathes.ads +@@ -24,7 +24,7 @@ + -- + -- <DL><DT><STRONG> + -- Purpose:</STRONG><DD> +--- Handling of "pathes": prefix URLs defined for cross-references.</DL> ++-- Handling of "paths": prefix URLs defined for cross-references.</DL> + -- + -- <!-- + -- Revision History +--- a/ad-messages.adb ++++ b/ad-messages.adb +@@ -233,10 +233,10 @@ + " HTML Files. (May be useful in conjunction with the -a" + & LF & + " option.)" & LF & +- " -I directory Define source pathes. Same semantics as" ++ " -I directory Define source paths. Same semantics as" + & LF & + " for GNAT." & LF & +- " -T directory Define pathes for ASIS to search for tree" ++ " -T directory Define paths for ASIS to search for tree" + & LF & + " files (*.adt). Multiple -T options may be given." + & LF & LF & +--- a/ad-projects-impl_yes.adb ++++ b/ad-projects-impl_yes.adb +@@ -93,7 +93,7 @@ + package body AD.Projects.Impl_Yes is + + -- Using the project manager is a bit tricky. First, we do have a dummy +- -- sdefault file, specifying dummy (null) default search pathes (we don't ++ -- sdefault file, specifying dummy (null) default search paths (we don't + -- need them). + -- + -- Second, the GNAT 3.16a source distribution contains an osint.adb +@@ -588,7 +588,7 @@ + exception + when others => + -- Didn't work, so I guess we may presume the two +- -- pathes really refer to different directories: ++ -- paths really refer to different directories: + begin + Open (File, In_File, ASU.To_String (File_Name)); + Delete (File); +--- a/ad-projects.ads ++++ b/ad-projects.ads +@@ -44,7 +44,7 @@ + procedure Handle_Project_File + (Name : in String); + -- Reads, parses, and processes a GNAT project file, then extracts the +- -- object pathes ("-T") that will later be passed on to ASIS. ++ -- object paths ("-T") that will later be passed on to ASIS. + -- + -- "-T" options given on the command line to AdaBrowse <EM>always</EM + -- take precedence over the ones obtained from a project file. +@@ -54,11 +54,11 @@ + -- which may be either a single string or a string list, it uses that + -- variables value, interpretes the string(s) as the file names of + -- AdaBrowse configuration files and processes each of them in the order +- -- given. (If the file names contain pathes, these are, as usual, inter- ++ -- given. (If the file names contain paths, these are, as usual, inter- + -- preted relative to the directory where the configuration file resides.) + -- + -- (Note: inside configuration files, path names are relative to the +- -- current directory, i.e. the one adabrowse was started in. To use pathes ++ -- current directory, i.e. the one adabrowse was started in. To use paths + -- relative to the configuration file location use the special environment + -- variable $@.) + -- +--- a/doc/adabrowse_ug.html ++++ b/doc/adabrowse_ug.html +@@ -401,11 +401,11 @@ + not be white space between the "<CODE>-X</CODE> and the variable definition.<BR><BR> + + <DT><CODE>-I directory</CODE> +- <DD>Optional: Define source pathes for ASIS. Same semantics as ++ <DD>Optional: Define source paths for ASIS. Same semantics as + for GNAT. Multiple <CODE>-I</CODE> options may be given.<BR><BR> + + <DT><CODE>-T directory</CODE> +- <DD>Optional: Define pathes for ASIS to search for tree files ++ <DD>Optional: Define paths for ASIS to search for tree files + (*.adt). Multiple <CODE>-T</CODE> options may be given. + </DL> + <P> +@@ -1588,7 +1588,7 @@ + </PRE></TD></TR></TABLE> + + If AdaBrowse wants to generate a cross-reference to a unit <CODE>CORE.OS</CODE> now, +- it'll check the list of pathes given and in this case, it'll generate ++ it'll check the list of paths given and in this case, it'll generate + the cross-reference to "<CODE>../../core/doc/ref_manual/core-os.html</CODE>". Note + that the first path also matches, but "<CODE>Core</CODE>" is a longer match than + "<CODE>Cor</CODE>". However, for a cross-reference to <CODE>COROLD.EXTERNAL</CODE>, the first path +@@ -3494,7 +3494,7 @@ + <BR><BR> + + <LI>AdaBrowse uses <CODE>GNAT.Os_Lib</CODE> in a few places. +- You'll need to replace that as appropriate in files <CODE>util-pathes.adb</CODE> ++ You'll need to replace that as appropriate in files <CODE>util-paths.adb</CODE> + and in <CODE>ad-file_ops.ad[bs]</CODE>. + <BR><BR> + +--- a/util-files.ads ++++ b/util-files.ads +@@ -84,7 +84,7 @@ + Buffer : in Buffer_Size := Default_Buffer_Size); + -- Safe file copy operation, it is abort deferred, but not task-safe. + -- +- -- Both @From@ and @To@ may contain pathes; if @From@ specifies a ++ -- Both @From@ and @To@ may contain paths; if @From@ specifies a + -- non-existing file, or @To@ contains the specification of a non-existing + -- directory, the exception @Ada:IO_Exceptions.Name_Error@ will be raised. + -- If @From@ specifies a directory, an unspecified exception may be raised, +--- a/util-pathes.adb ++++ b/util-pathes.adb +@@ -30,7 +30,7 @@ + -- Operations for manipulating file names. The package is intended for + -- use on Windows or Unix systems. Upon elaboration, it tries to figure + -- out the host operating system by examining the @PATH@ environment +--- variable: if that contains Windows-looking pathes (i.e., a '\' is found ++-- variable: if that contains Windows-looking paths (i.e., a '\' is found + -- before a any '/'), it assumes it's being used on Windows. If, on the + -- other hand, it finds a '/' first, it assumes Unix. If it finds neither, + -- it uses @GNAT.Os_Lib.Directory_Separator@ as its directory separator. +@@ -364,7 +364,7 @@ + return P (P'First .. I - 1) & + Up (P (I .. P'Last), Separator); + else +- -- Only a node name: cannot get the parent, for relative pathes ++ -- Only a node name: cannot get the parent, for relative paths + -- are not allowed. + raise Path_Error; + end if; +--- a/util-pathes.ads ++++ b/util-pathes.ads +@@ -30,7 +30,7 @@ + -- Operations for manipulating file names. The package is intended for + -- use on Windows or Unix systems. Upon elaboration, it tries to figure + -- out the host operating system by examining the @PATH@ environment +--- variable: if that contains Windows-looking pathes (i.e., a '\' is found ++-- variable: if that contains Windows-looking paths (i.e., a '\' is found + -- before a any '/'), it assumes it's being used on Windows. If, on the + -- other hand, it finds a '/' first, it assumes Unix. If it finds neither, + -- it uses @GNAT.Os_Lib.Directory_Separator@ as its directory separator. -- 2.8.1
>From 280424e15141f3b4b4bd9b15b66d03b3edbf569e Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 02:08:41 +0200 Subject: [PATCH 16/20] Let clean restore original source tree, allowing two builds in a row. --- debian/misc/adabrowse.gpr | 2 ++ debian/rules | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/misc/adabrowse.gpr b/debian/misc/adabrowse.gpr index fdebbfe..05e2999 100644 --- a/debian/misc/adabrowse.gpr +++ b/debian/misc/adabrowse.gpr @@ -16,6 +16,8 @@ project Adabrowse is -- The source dirs include the debian subdirectory, where I've -- preconfigured AdaBrowse. for Source_Dirs use ("../..", "../"); + for Excluded_Source_Files use ("sdefault.adb", + "ad-projects-impl_yes-get_parent.adb"); for Object_Dir use "../../obj"; for Exec_Dir use "../.."; for Main use ("adabrowse"); diff --git a/debian/rules b/debian/rules index 7ed5fee..7282971 100755 --- a/debian/rules +++ b/debian/rules @@ -15,7 +15,8 @@ $(POLICY_TARGETS): .PHONY: $(addprefix override_dh_auto_, configure build test install clean) override_dh_auto_clean: - rm -rf obj adabrowse sdefault.adb ad-projects-impl_yes-get_parent.adb + rm -fr obj + rm adabrowse override_dh_auto_build: obj/util-nl.o gnatmake $(BUILDER_OPTIONS) -Pdebian/misc/adabrowse.gpr -- 2.8.1
>From 7281c10180d67547128589d7b65360e674cb500f Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 02:34:28 +0200 Subject: [PATCH 17/20] Fix many warnings, and use return blocks in util-text.adb. The return block avoids a temporary copy of a controlled object during every string affectation and should enhance the efficiency. --- debian/patches/fix-warnings.diff | 426 ++++++++++++++++++++++++++++++++++ debian/patches/series | 2 + debian/patches/use-return-blocks.diff | 347 +++++++++++++++++++++++++++ 3 files changed, 775 insertions(+) create mode 100644 debian/patches/fix-warnings.diff create mode 100644 debian/patches/use-return-blocks.diff diff --git a/debian/patches/fix-warnings.diff b/debian/patches/fix-warnings.diff new file mode 100644 index 0000000..9f075c9 --- /dev/null +++ b/debian/patches/fix-warnings.diff @@ -0,0 +1,426 @@ +Description: fix many GNAT warnings. +Author: Nicolas Boulenguez <nico...@debian.org> + +--- a/ad-crossrefs.adb ++++ b/ad-crossrefs.adb +@@ -47,9 +47,7 @@ + + with Ada.Characters.Handling; + with Ada.Exceptions; +-with Ada.Strings.Wide_Unbounded; + +-with Asis; + with Asis.Clauses; + with Asis.Compilation_Units; + with Asis.Declarations; +@@ -62,7 +60,6 @@ + + with Asis2.Declarations; + with Asis2.Naming; +-with Asis2.Spans; + with Asis2.Text; + with Asis2.Units; + +--- a/ad-descriptions.adb ++++ b/ad-descriptions.adb +@@ -56,9 +56,6 @@ + with Asis; + with Asis.Declarations; + with Asis.Elements; +-with Asis.Text; +- +-with Asis2.Spans; + + with Util.Strings; + +@@ -743,4 +740,3 @@ + end if; + end loop; + end AD.Descriptions; +- +--- a/ad-driver.adb ++++ b/ad-driver.adb +@@ -696,7 +696,6 @@ + procedure Report + (Debug_Only : Boolean := False) + is +- use type AD.Messages.Verbosity; + begin + if not Debug_Only or else + AD.Messages.Get_Mode = AD.Messages.Including_Debug +@@ -1142,8 +1141,6 @@ + AD.Printers.Free (The_Printer); + + declare +- use type Ada.Text_IO.File_Access; +- + procedure Free is + new Ada.Unchecked_Deallocation + (Ada.Text_IO.File_Type, File_Ptr); +--- a/ad-exclusions.adb ++++ b/ad-exclusions.adb +@@ -75,7 +75,7 @@ + use type ASU.Unbounded_String; + + P, Q : Exclusion_Ptr; +- K : ASU.Unbounded_String := ASU.To_Unbounded_String (Key); ++ K : constant ASU.Unbounded_String := ASU.To_Unbounded_String (Key); + begin + P := Anchor; + while P /= null loop +--- a/ad-expressions.adb ++++ b/ad-expressions.adb +@@ -266,8 +266,7 @@ + elsif Text (Curr) = '@' then + Curr := Curr + 1; + return Op_Prefix; +- elsif Curr < Text'Last and then +- Text (Curr .. Curr + 1) = "/=" then ++ elsif Curr < Text'Last and then Text (Curr .. Curr + 1) = "/=" then + Curr := Curr + 2; + return Op_Neq; + else +@@ -656,7 +655,7 @@ + (Name : in String; + Expr : in Exp'Class) + is +- E : Expression := ++ E : constant Expression := + (Ada.Finalization.Controlled with Ptr => new Exp'Class'(Expr)); + begin + Hashing.Insert (Predef, Name, E); +--- a/ad-filters.adb ++++ b/ad-filters.adb +@@ -64,7 +64,6 @@ + with Ada.Exceptions; + with Ada.Streams.Stream_IO; + with Ada.Text_IO; +-with Ada.Unchecked_Deallocation; + + with AD.File_Ops; + with AD.HTML; +@@ -2497,5 +2496,3 @@ + end Transform; + + end AD.Filters; +- +- +--- a/ad-format.adb ++++ b/ad-format.adb +@@ -45,7 +45,6 @@ + with Ada.Characters.Handling; + with Ada.Unchecked_Deallocation; + +-with AD.Filters; + -- with AD.Messages; + + with Util.Strings; +--- a/ad-html-pathes.adb ++++ b/ad-html-pathes.adb +@@ -73,7 +73,7 @@ + use type ASU.Unbounded_String; + + P, Q : Path_Ptr; +- K : ASU.Unbounded_String := ++ K : constant ASU.Unbounded_String := + ASU.To_Unbounded_String (To_Lower (Key)); + begin + P := Anchor; +--- a/ad-html.adb ++++ b/ad-html.adb +@@ -60,7 +60,6 @@ + with Ada.Strings.Fixed; + with Ada.Strings.Maps; + with Ada.Strings.Unbounded; +-with Ada.Text_IO; + + with AD.Config; + with AD.Version; +@@ -583,5 +582,3 @@ + Ending (After) := + ASU.To_Unbounded_String ("</FONT></TD></TR></TABLE>"); + end AD.HTML; +- +- +--- a/ad-indices.adb ++++ b/ad-indices.adb +@@ -41,13 +41,9 @@ + pragma License (GPL); + + with Ada.Characters.Handling; +-with Ada.Finalization; +-with Ada.Strings.Maps; +-with Ada.Strings.Unbounded; + with Ada.Strings.Wide_Unbounded; + with Ada.Unchecked_Deallocation; + +-with Asis; + with Asis.Declarations; + with Asis.Elements; + +@@ -55,13 +51,10 @@ + with Asis2.Naming; + with Asis2.Spans; + +-with AD.Crossrefs; + with AD.Exclusions; +-with AD.Expressions; + with AD.Messages; + with AD.Options; + with AD.Predicates; +-with AD.Printers; + with AD.Text_Utilities; + + with GAL.ADT.Hash_Tables; +--- a/ad-item_lists.adb ++++ b/ad-item_lists.adb +@@ -59,20 +59,16 @@ + + with Ada.Unchecked_Deallocation; + +-with Asis; + with Asis.Clauses; + with Asis.Elements; + with Asis.Exceptions; + with Asis.Expressions; +-with Asis.Text; + + with Asis2.Container_Elements; + with Asis2.Declarations; + with Asis2.Naming; +-with Asis2.Spans; + with Asis2.Text; + +-with AD.Descriptions; + with AD.Options; + with AD.Queries; + +@@ -689,4 +685,3 @@ + end Collect_Subordinates; + + end AD.Item_Lists; +- +--- a/ad-parameters.adb ++++ b/ad-parameters.adb +@@ -45,7 +45,6 @@ + with Ada.Strings.Fixed; + with Ada.Strings.Maps; + with Ada.Strings.Unbounded; +-with Ada.Text_IO; + + with AD.Known_Units; + with AD.Text_Utilities; +--- a/ad-printers-html.adb ++++ b/ad-printers-html.adb +@@ -47,8 +47,6 @@ + with Ada.Strings.Wide_Unbounded; + with Ada.Unchecked_Deallocation; + +-with Asis.Text; +- + with Asis2.Spans; + + with AD.Format; +--- a/ad-printers.adb ++++ b/ad-printers.adb +@@ -38,11 +38,9 @@ + pragma License (GPL); + + with Ada.Exceptions; +-with Ada.Text_IO; + + with Asis.Declarations; + with Asis.Elements; +-with Asis.Text; + + with AD.File_Ops; + with AD.Messages; +--- a/ad-queries.adb ++++ b/ad-queries.adb +@@ -72,7 +72,6 @@ + + with Ada.Unchecked_Deallocation; + +-with Asis; + with Asis.Compilation_Units.Relations; + with Asis.Definitions; + with Asis.Declarations; +--- a/ad-scanner.adb ++++ b/ad-scanner.adb +@@ -233,11 +233,9 @@ + Control : in out Traverse_Control; + State : in out Scan_State) + is ++ pragma Unreferenced (Control); + -- Write anything of that element that hasn't been written yet. + begin +- if Control = Terminate_Immediately then null; end if; +- -- The above if serves only to silence GNAT -gnatwa. 'Control' can never +- -- be Terminate_Immediately here! + Write (Element, State); + if not Is_Equal (State.Traverse_Top, Element) then + Terminate_Line (State); +@@ -525,7 +523,7 @@ + -- Why did I ever have the funny idea that somebody might want + -- a pragma index? + declare +- XRef : AD.Crossrefs.Cross_Reference := ++ XRef : constant AD.Crossrefs.Cross_Reference := + AD.Crossrefs.Crossref_Special (Element, State.Unit); + begin + AD.Indices.Add (Element, XRef, Is_Private); +@@ -536,7 +534,7 @@ + An_Enumeration_Representation_Clause | + A_Record_Representation_Clause => + declare +- XRef : AD.Crossrefs.Cross_Reference := ++ XRef : constant AD.Crossrefs.Cross_Reference := + AD.Crossrefs.Crossref_Special (Element, State.Unit); + begin + AD.Indices.Add (Element, XRef, Is_Private); +@@ -851,7 +849,7 @@ + Current : in Natural; + State : in out Scan_State) + is +- Original : Scan_State := State; ++ Original : constant Scan_State := State; + begin + AD.Printers.Open_Item + (State.The_Printer, +@@ -938,7 +936,7 @@ + return B; + end Unwind_Renames; + +- Original : Scan_State := State; ++ Original : constant Scan_State := State; + + begin + AD.Printers.Open_Section (State.The_Printer, Exception_Section); +@@ -1165,7 +1163,7 @@ + + begin -- Write_Type + declare +- XRef : AD.Crossrefs.Cross_Reference := ++ XRef : constant AD.Crossrefs.Cross_Reference := + AD.Crossrefs.Crossref_Name + (Get_Name (Decl), State.Unit, State.Reporter'Access); + begin +@@ -1600,8 +1598,6 @@ + Old_Indent : constant Character_Position := State.Indent; + Kind : constant AD.Printers.Item_Kind := + AD.Printers.Get_Item_Kind (Items (Current).Element); +- use type AD.Printers.Item_Kind; +- + begin + if Kind not in AD.Printers.Declaration_Item_Kind then + AD.Printers.Open_Item +--- a/ad-user_tags.adb ++++ b/ad-user_tags.adb +@@ -49,7 +49,6 @@ + with GAL.Support.Hashing; + with GAL.ADT.Hash_Tables; + +-with Util.Environment; + with Util.Strings; + + pragma Elaborate_All (GAL.ADT.Hash_Tables); +--- a/ad-writers.adb ++++ b/ad-writers.adb +@@ -49,16 +49,11 @@ + with Ada.Characters.Handling; + with Ada.Strings.Wide_Unbounded; + +-with Asis; + with Asis.Elements; + with Asis.Exceptions; +-with Asis.Text; +- +-with Asis2.Spans; + + with AD.Crossrefs; + with AD.Messages.Inline; +-with AD.Printers; + with AD.Text_Utilities; + + with Util.Strings; +@@ -246,7 +241,7 @@ + Reporter : aliased AD.Messages.Inline.Error_Reporter := + (AD.Messages.Error_Reporter with The_Printer => State.The_Printer); + Span : constant Asis.Text.Span := Get_Span (Name); +- XRef : AD.Crossrefs.Cross_Reference := ++ XRef : constant AD.Crossrefs.Cross_Reference := + AD.Crossrefs.Crossref_Exp (Name, State.Unit, Reporter'Access); + begin + Write_Before (Span, State); +--- a/asis2-naming.adb ++++ b/asis2-naming.adb +@@ -285,7 +285,6 @@ + D := Asis2.Declarations.Enclosing_Declaration (D); + end case; + end loop; +- return ""; + end Parent; + + begin -- Container_Name; +--- a/asis2-spans.adb ++++ b/asis2-spans.adb +@@ -57,7 +57,6 @@ + with Asis.Compilation_Units; + with Asis.Elements; + with Asis.Exceptions; +-with Asis.Text; + + with Asis2.Text; + +--- a/gal-adt-hash_tables.adb ++++ b/gal-adt-hash_tables.adb +@@ -53,7 +53,6 @@ + pragma License (Modified_GPL); + + with Ada.Unchecked_Deallocation; +-with GAL.Support.Hashing; + + -- generic + -- type Key_Type (<>) is private; +@@ -1139,10 +1138,3 @@ + end Read; + + end GAL.ADT.Hash_Tables; +- +- +- +- +- +- +- +--- a/util-files-text_io.adb ++++ b/util-files-text_io.adb +@@ -44,8 +44,6 @@ + + pragma License (Modified_GPL); + +-with Util.Strings; +- + package body Util.Files.Text_IO is + + ---------------------------------------------------------------------------- +--- a/util-text.adb ++++ b/util-text.adb +@@ -569,7 +569,7 @@ + return 0; + end if; + declare +- Temporary : Unbounded_String := ++ Temporary : constant Unbounded_String := + (Ada.Finalization.Controlled with + Data => new String (Source.Data'Range)); + begin +@@ -597,7 +597,7 @@ + raise Constraint_Error; + end if; + declare +- Temporary : Unbounded_String := ++ Temporary : constant Unbounded_String := + (Ada.Finalization.Controlled with + Data => new String (Source.Data'Range)); + begin diff --git a/debian/patches/series b/debian/patches/series index b112742..982e2a8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,5 @@ 02-use-gnatgcc.patch fix-link-to-gpl.diff typo-pathes.diff +fix-warnings.diff +use-return-blocks.diff diff --git a/debian/patches/use-return-blocks.diff b/debian/patches/use-return-blocks.diff new file mode 100644 index 0000000..d03207f --- /dev/null +++ b/debian/patches/use-return-blocks.diff @@ -0,0 +1,347 @@ +Description: use return blocks for local unbounded strings. + The return block avoids a temporary copy of a controlled object + during every string affectation and should enhance the efficiency. +Author: Nicolas Boulenguez <nico...@debian.org> + +--- a/util-text.adb ++++ b/util-text.adb +@@ -232,13 +232,15 @@ + (Left, Right : Unbounded_String) + return Unbounded_String + is +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Left.Data'Last + Right.Data'Last)); + begin +- Result.Data (1 .. Left.Data'Last) := Left.Data.all; +- Result.Data (Left.Data'Last + 1 .. Result.Data'Last) := Right.Data.all; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Left.Data'Last + Right.Data'Last)) ++ do ++ Result.Data (1 .. Left.Data'Last) := Left.Data.all; ++ Result.Data (Left.Data'Last + 1 .. Result.Data'Last) := ++ Right.Data.all; ++ end return; + end "&"; + + function "&" +@@ -247,13 +249,14 @@ + return Unbounded_String + is + Length : constant Natural := Right'Length; +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Left.Data'Last + Length)); + begin +- Result.Data (1 .. Left.Data'Last) := Left.Data.all; +- Result.Data (Left.Data'Last + 1 .. Result.Data'Last) := Right; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Left.Data'Last + Length)) ++ do ++ Result.Data (1 .. Left.Data'Last) := Left.Data.all; ++ Result.Data (Left.Data'Last + 1 .. Result.Data'Last) := Right; ++ end return; + end "&"; + + function "&" +@@ -262,13 +265,14 @@ + return Unbounded_String + is + Length : constant Natural := Left'Length; +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Length + Right.Data'Last)); + begin +- Result.Data (1 .. Length) := Left; +- Result.Data (Length + 1 .. Result.Data'Last) := Right.Data.all; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Length + Right.Data'Last)) ++ do ++ Result.Data (1 .. Length) := Left; ++ Result.Data (Length + 1 .. Result.Data'Last) := Right.Data.all; ++ end return; + end "&"; + + function "&" +@@ -276,13 +280,14 @@ + Right : in Character) + return Unbounded_String + is +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Left.Data'Last + 1)); + begin +- Result.Data (1 .. Left.Data'Last) := Left.Data.all; +- Result.Data (Left.Data'Last + 1) := Right; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Left.Data'Last + 1)) ++ do ++ Result.Data (1 .. Left.Data'Last) := Left.Data.all; ++ Result.Data (Left.Data'Last + 1) := Right; ++ end return; + end "&"; + + function "&" +@@ -290,13 +295,14 @@ + Right : in Unbounded_String) + return Unbounded_String + is +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Right.Data'Last + 1)); + begin +- Result.Data (1) := Left; +- Result.Data (2 .. Result.Data'Last) := Right.Data.all; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Right.Data'Last + 1)) ++ do ++ Result.Data (1) := Left; ++ Result.Data (2 .. Result.Data'Last) := Right.Data.all; ++ end return; + end "&"; + + function "=" +@@ -434,13 +440,14 @@ + Right : in Character) + return Unbounded_String + is +- New_String : Unbounded_String := +- (Ada.Finalization.Controlled with Data => new String (1 .. Left)); + begin +- for I in New_String.Data'Range loop +- New_String.Data (I) := Right; +- end loop; +- return New_String; ++ return New_String : constant Unbounded_String := ++ (Ada.Finalization.Controlled with Data => new String (1 .. Left)) ++ do ++ for I in New_String.Data'Range loop ++ New_String.Data (I) := Right; ++ end loop; ++ end return; + end "*"; + + function "*" +@@ -454,14 +461,16 @@ + end if; + declare + Length : constant Natural := Right'Last - Right'First + 1; +- New_String : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Left * Length)); + begin +- for I in 1 .. Left loop +- New_String.Data (I * Length - Length + 1 .. I * Length) := Right; +- end loop; +- return New_String; ++ return New_String : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Left * Length)) ++ do ++ for I in 1 .. Left loop ++ New_String.Data (I * Length - Length + 1 .. I * Length) := ++ Right; ++ end loop; ++ end return; + end; + end "*"; + +@@ -654,17 +663,15 @@ + begin + Slice_Check (From, Through, Source.Data'Last); + if From > Through then return Source; end if; +- declare +- New_String : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. +- Source.Data'Last - (Through - From + 1))); +- begin ++ return New_String : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. ++ Source.Data'Last - (Through - From + 1))) ++ do + New_String.Data (1 .. From - 1) := Source.Data (1 .. From - 1); + New_String.Data (From .. New_String.Data'Last) := + Source.Data (Through + 1 .. Source.Data'Last); +- return New_String; +- end; ++ end return; + end Delete; + + -- Standard +@@ -969,17 +976,15 @@ + if Count <= Source.Data'Last then + return Slice (Source, 1, Count); + else +- declare +- New_String : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Count)); +- begin ++ return New_String : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Count)) ++ do + New_String.Data (1 .. Source.Data'Last) := Source.Data.all; + for I in Source.Data'Last + 1 .. New_String.Data'Last loop + New_String.Data (I) := Pad; + end loop; +- return New_String; +- end; ++ end return; + end if; + end Head; + +@@ -1524,17 +1529,18 @@ + if Position > Source.Data'Last + 1 then raise Index_Error; end if; + declare + Length : constant Natural := New_Item'Length; +- New_String : Unbounded_String := ++ begin ++ return New_String : constant Unbounded_String := + (Ada.Finalization.Controlled with + Data => new String (1 .. Integer'Max (Source.Data'Last, +- Position - 1 + Length))); +- begin +- New_String.Data (1 .. Position - 1) := +- Source.Data (1 .. Position - 1); +- New_String.Data (Position .. Position + Length - 1) := New_Item; +- New_String.Data (Position + Length .. New_String.Data'Last) := +- Source.Data (Position + Length .. Source.Data'Last); +- return New_String; ++ Position - 1 + Length))) ++ do ++ New_String.Data (1 .. Position - 1) := ++ Source.Data (1 .. Position - 1); ++ New_String.Data (Position .. Position + Length - 1) := New_Item; ++ New_String.Data (Position + Length .. New_String.Data'Last) := ++ Source.Data (Position + Length .. Source.Data'Last); ++ end return; + end; + end Overwrite; + +@@ -1844,18 +1850,16 @@ + if Count <= Source.Data'Last then + return Slice (Source, Source.Data'Last - Count + 1, Source.Data'Last); + else +- declare +- New_String : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Count)); +- begin ++ return New_String : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Count)) ++ do + New_String.Data (New_String.Data'Last - Source.Data'Last + 1 .. +- New_String.Data'Last) := Source.Data.all; ++ New_String.Data'Last) := Source.Data.all; + for I in 1 .. New_String.Data'Last - Source.Data'Last loop + New_String.Data (I) := Pad; + end loop; +- return New_String; +- end; ++ end return; + end if; + end Tail; + +@@ -1946,14 +1950,15 @@ + Mapping : in Ada.Strings.Maps.Character_Mapping) + return Unbounded_String + is +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (Source.Data'Range)); + begin +- for I in Result.Data'Range loop +- Result.Data (I) := ASM.Value (Mapping, Source.Data (I)); +- end loop; +- return Result; ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (Source.Data'Range)) ++ do ++ for I in Result.Data'Range loop ++ Result.Data (I) := ASM.Value (Mapping, Source.Data (I)); ++ end loop; ++ end return; + end Translate; + + -- Standard +@@ -1976,16 +1981,14 @@ + begin + Slice_Check (From, Through, Source.Data'Last); + if From > Through then return Null_Unbounded_String; end if; +- declare +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Through - From + 1)); +- begin ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Through - From + 1)) ++ do + for I in Result.Data'Range loop + Result.Data (I) := ASM.Value (Mapping, Source.Data (From + I)); + end loop; +- return Result; +- end; ++ end return; + end Translate; + + -- Slice +@@ -2009,16 +2012,14 @@ + use type ASM.Character_Mapping_Function; + begin + if Mapping = null then raise Constraint_Error; end if; +- declare +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (Source.Data'Range)); +- begin ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (Source.Data'Range)) ++ do + for I in Result.Data'Range loop + Result.Data (I) := Mapping (Source.Data (I)); + end loop; +- return Result; +- end; ++ end return; + end Translate; + + -- Standard +@@ -2046,16 +2047,14 @@ + elsif Mapping = null then + raise Constraint_Error; + end if; +- declare +- Result : Unbounded_String := +- (Ada.Finalization.Controlled with +- Data => new String (1 .. Through - From + 1)); +- begin ++ return Result : constant Unbounded_String := ++ (Ada.Finalization.Controlled with ++ Data => new String (1 .. Through - From + 1)) ++ do + for I in Result.Data'Range loop + Result.Data (I) := Mapping (Source.Data (From + I)); + end loop; +- return Result; +- end; ++ end return; + end Translate; + + -- Slice -- 2.8.1
>From 9c3e9ed4122fd4b72b1d9fc0e3b8b4ebf3472789 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 02:45:49 +0200 Subject: [PATCH 18/20] Switch from gnatmake to gprbuild, as gnatmake will drop project support. --- debian/control | 5 +++++ debian/manpages/adabrowse.1 | 5 ----- debian/misc/adabrowse.gpr | 4 ++++ debian/patches/01-gnatmake.patch | 6 +++--- debian/rules | 10 +++++----- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/debian/control b/debian/control index 38e43b7..ef4ac7c 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,8 @@ Priority: optional Maintainer: Adrian-Ken Rueegsegger <k...@codelabs.ch> Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1), # dpkg-dev 1.16.1 provides /usr/share/dpkg/default.mk + gprbuild (>= 2015-2), +# gprbuild compatible with gnat-6 gnat, gnat-6, libasis2015-dev Standards-Version: 3.9.8 Homepage: http://home.datacomm.ch/t_wolf/tw/ada95/adabrowse/ @@ -13,7 +15,10 @@ Vcs-Git: https://git.codelabs.ch/git/debian/adabrowse.git Package: adabrowse Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: gprbuild Description: HTML generator for Ada 95 library unit specifications AdaBrowse is a javadoc-like HTML generator for Ada 95 library unit specifications. It can also generate XML output; a DTD is included in the distribution. + . + The gprbuild package adds support for .gpr GNAT projects. diff --git a/debian/manpages/adabrowse.1 b/debian/manpages/adabrowse.1 index fdb0703..6471b0c 100644 --- a/debian/manpages/adabrowse.1 +++ b/debian/manpages/adabrowse.1 @@ -366,11 +366,6 @@ for any other reasons, but will otherwise continue processing. The full user's guide in /usr/share/doc/adabrowse. -.SH BUGS -The Debian package of \fBadabrowse\fR does not have the Project -Manager feature; the command\-line option \fB\-P\fR \fIproject_file\fR -is therefore disabled. - .SH AUTHOR \fBadabrowse\fR and the accompanying documentation was written by Thomas Wolf <tw...@acm.org>. diff --git a/debian/misc/adabrowse.gpr b/debian/misc/adabrowse.gpr index 05e2999..0759126 100644 --- a/debian/misc/adabrowse.gpr +++ b/debian/misc/adabrowse.gpr @@ -21,6 +21,7 @@ project Adabrowse is for Object_Dir use "../../obj"; for Exec_Dir use "../.."; for Main use ("adabrowse"); + for Languages use ("Ada", "C"); Extra_Flags := External_As_List ("ADAFLAGS", " "); @@ -28,6 +29,9 @@ project Adabrowse is for Default_Switches ("Ada") use ("-O2", "-gnatafno", "-gnatVa", "-gnatwa", "-gnaty3abefhiklmprt") & Extra_Flags; + for Default_Switches ("C") use ("-O2") + & External_As_List ("CFLAGS", " ") + & External_As_List ("CPPFLAGS", " "); end Compiler; package Linker is diff --git a/debian/patches/01-gnatmake.patch b/debian/patches/01-gnatmake.patch index 522ca2f..eeecbba 100644 --- a/debian/patches/01-gnatmake.patch +++ b/debian/patches/01-gnatmake.patch @@ -1,5 +1,5 @@ Author: Ludovic Brenta <lbre...@debian.org> -Description: Make sure never to call the "gnat" command, just "gnatmake" or "gnatgcc". +Description: Make sure never to call the "gnat" command, just "gprbuild" or "gnatgcc". --- a/ad-driver.adb +++ b/ad-driver.adb @@ -8,7 +8,7 @@ Description: Make sure never to call the "gnat" command, just "gnatmake" or "gna -- Note: we also pass on -X options! AD.Compiler.Set_Compile_Command - ("gnat compile -c -gnatc -gnatt -P" & -+ ("gnatmake -c -gnatc -gnatt -P" & ++ ("gprbuild -c -gnatc -gnatt " & AD.Projects.Get_Project_File_Name & ASU.To_String (Pass_On_Options)); end if; @@ -22,7 +22,7 @@ Description: Make sure never to call the "gnat" command, just "gnatmake" or "gna - -- "gnat compile -P<file_name>", if it starts with the default compiler - -- name (which is "gcc" -- or "gnatgcc" on some Linux installations.) + -- Warning: if a project file is given, the compile command is -+ -- changed to "gnatmake -c -gnatc -gnatt -P<file_name>", if it ++ -- changed to "gprbuild -c -gnatc -gnatt <file_name>", if it + -- starts with the default compiler name (which is "gcc" -- or + -- "gnatgcc" on some Linux installations.) -- diff --git a/debian/rules b/debian/rules index 7282971..adeaf18 100755 --- a/debian/rules +++ b/debian/rules @@ -16,12 +16,12 @@ $(POLICY_TARGETS): override_dh_auto_clean: rm -fr obj - rm adabrowse + rm -f adabrowse auto.cgpr -override_dh_auto_build: obj/util-nl.o - gnatmake $(BUILDER_OPTIONS) -Pdebian/misc/adabrowse.gpr -obj/util-nl.o: util-nl.c | obj - $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) +override_dh_auto_build: auto.cgpr | obj + gprbuild $(BUILDER_OPTIONS) debian/misc/adabrowse.gpr +auto.cgpr: + gprconfig --config=Ada --config=C,,,,gnatgcc obj: mkdir $@ -- 2.8.1
>From d9b252f9f205e8ce8ac2d889c5b6260e7bd8a756 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nicolas.bouleng...@free.fr> Date: Fri, 3 Jun 2016 03:25:12 +0200 Subject: [PATCH 19/20] Depend: gnat, gnat-6 because the executable runs gnatgcc. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ef4ac7c..a5d1124 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Vcs-Git: https://git.codelabs.ch/git/debian/adabrowse.git Package: adabrowse Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, gnat, gnat-6 Recommends: gprbuild Description: HTML generator for Ada 95 library unit specifications AdaBrowse is a javadoc-like HTML generator for Ada 95 library unit -- 2.8.1