--- gnat-gps-2.1.0.orig/debian/08-makefile-cairo.patch +++ gnat-gps-2.1.0/debian/08-makefile-cairo.patch @@ -0,0 +1,11 @@ +--- Makefile.in 2005-10-03 22:32:48.000000000 -0400 ++++ Makefile.in 2005-10-03 22:33:14.000000000 -0400 +@@ -9,7 +9,7 @@ bindir = $(prefix)/bin + sharedir = $(prefix)/share + + # Use these flags when compiling C files in all sub-makes. +-CFLAGS=-O3 ++CFLAGS=-O3 -I/usr/include/cairo + export CFLAGS + + default build compile link ada c c++: --- gnat-gps-2.1.0.orig/debian/323515.patch +++ gnat-gps-2.1.0/debian/323515.patch @@ -0,0 +1,34 @@ +From: Matt Kraai +To: submit@bugs.debian.org +Subject: FTBFS: Conflicting declarations of html_cluealigned_class +Date: Tue, 16 Aug 2005 12:44:40 -0700 + +Package: gnat-gps +Version: 2.1.0-4 +Severity: serious +Tags: patch + +gnat-gps fails to build because it contains conflicting declarations +of html_cluealigned_class: + +> i486-linux-gnu-gcc -c -O3 -DSYSTEM_INCLUDE="system/gnu-linux.h" -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_GNU_REGEX=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STROPTS_H=1 -DHAVE_GETPT=1 -DHAVE_SETPGID=1 -DHAVE_SETSID=1 -DSYSTEM_INCLUDE="system/gnu-linux.h" -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_GNU_REGEX=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_STROPTS_H=1 -DHAVE_GETPT=1 -DHAVE_SETPGID=1 -DHAVE_SETSID=1 /tmp/buildd/gnat-gps-2.1.0/widgets/cschtml/htmlcluealigned.c -o /tmp/buildd/gnat-gps-2.1.0/widgets/obj/htmlcluealigned.o +> /tmp/buildd/gnat-gps-2.1.0/widgets/cschtml/htmlcluealigned.c:28: error: static declaration of 'html_cluealigned_class' follows non-static declaration +> /tmp/buildd/gnat-gps-2.1.0/widgets/cschtml/htmlcluealigned.h:44: error: previous declaration of 'html_cluealigned_class' was here + +The attached patch makes it non-static in both cases. + +-- +Matt + + +--- widgets/cschtml/htmlcluealigned.c ++++ widgets/cschtml/htmlcluealigned.c +@@ -25,7 +25,7 @@ + #define ALIGN_BORDER 0 + + +-static HTMLClueAlignedClass html_cluealigned_class; ++HTMLClueAlignedClass html_cluealigned_class; + static HTMLClueClass *parent_class = NULL; + + --- gnat-gps-2.1.0.orig/debian/gnat-gps-doc.copyright +++ gnat-gps-2.1.0/debian/gnat-gps-doc.copyright @@ -0,0 +1,44 @@ +Using the GNAT Programming System +********************************* + + Version 2.1.0 + + Date: 2004/11/23 11:48:15 + + Copyright (C) 2001-2004, ACT Europe. This document may be copied, +in whole or in part, in any form or by any means, as is or with +alterations, provided that (1) alterations are clearly marked as +alterations and (2) this copyright notice is included unmodified in any +copy. + +TODO: add new tutorial and programmer's guide notices here + + +GNAT Programming System Tutorial +******************************** + +GNAT Programming System Tutorial + + Version 2.1.0 + + Date: 2004/11/22 16:14:08 + + Copyright (C) 2002-2004, ACT-Europe. This document may be copied, +in whole or in part, in any form or by any means, as is or with +alterations, provided that (1) alterations are clearly marked as +alterations and (2) this copyright notice is included unmodified in any +copy. + + +GPS Programmer's Guide +********************** + +Version 2.1.0 + + Date: $Date: 2004/04/21 14:17:06 $ + + Copyright (C) 2002-2003, ACT Europe. This document may be copied, +in whole or in part, in any form or by any means, as is or with +alterations, provided that (1) alterations are clearly marked as +alterations and (2) this copyright notice is included unmodified in any +copy. --- gnat-gps-2.1.0.orig/debian/README.Debian +++ gnat-gps-2.1.0/debian/README.Debian @@ -0,0 +1,79 @@ +* gnat-gps for Debian +--------------------- + +The upstream executable file, gps, conflicts with an existing Debian +package named `gps' which is unrelated. The executable file in Debian has +been renamed to /usr/bin/gnat-gps. + +** Python support +----------------- + +Support for python is enabled in the Debian package gnat-gps. Thus, +it is possible to program GPS to perform certain actions, using Python. +This however means that gnat-gps now depends on python2.3. + +The package gnat-gps installs some python files in /usr/share/gps/python. +These files export a programming interface to the python interpreter. +One important file in this directory is autoexec.py; GPS executes this +file on startup. The GPS documentation says that the system administrator +can change this file to configure GPS for specific needs. However, it is +against Debian policy to hold configuration files in /usr. Also, any +customisations made to this file are lost on every upgrade to the package. + +In Debian, the system administrator should create the system-wide +configuration file as /etc/gnat-gps/autoexec.py instead; GPS has been +patched to look there before it looks in /usr/share/gps/python. If +/etc/gnat-gps/autoexec.py exists, GPS executes it instead of the +default. + +Users can individually customise GPS by placing python files in +$HOME/.gps/python_startup; GPS executes them on startup. + +The package gnat-gps-doc provides several examples of python files +that users may want to use in customising GPS for their needs. Look +in /usr/share/doc/gnat-gps/examples/python. + + +** Updates to the GNAT run-time library +--------------------------------------- + +The upstream sources include a directory named `gnat_src' which +contains some files from the GNAT compiler and some files from the +GNAT run-time library, libgnat. These files are more recent than the +latest public release of libgnat, 3.15p, and contain some additions +and modifications to it. Because of this, we cannot link dynamically +against either libgnat-3.15p or libgtkada2 (which is linked with +libgnat-3.15p). In order to link dynamically, and because the files +under `gnat_src' are not from a public GNAT release, I have patched +GPS to not use these files. Here is a summary if these patches: + +- remove the conflicting files: + gnat_src/g-comlin.ad[bs] + gnat_src/g-dirope.ad[bs] + gnat_src/g-os_lib.ad[bs] + gnat_src/g-regpat.ad[bs] + +- keep the files that are not in GNAT 3.15p and thus do not conflict: + gnat_src/g-bubsor.ad[bs] + gnat_src/g-heasor.ad[bs] + gnat_src/g-string.ad[bs] + +- place the necessary updates to the RTL in new files that extend the + RTL instead of overriding it. These new files, compiled and linked + statically into GPS, are: + + gnat_src/g-diopex.ad[bs] GNAT.Directory_Operations.Extra + gnat_src/g-osliex.ad[bs] GNAT.OS_Lib.Extra + gnat_src/g-regext.ad[bs] GNAT.Regpat.Extra + +- Patch quite a large number of source files from GPS so they use the + *.Extra packages when required. Note that some files from gnat_src + are in this category. + +-- +Ludovic Brenta Wed, 2 Feb 2005 07:43:52 +0100 + +Local variables: +mode: text +mode: outline-minor +End: --- gnat-gps-2.1.0.orig/debian/changelog +++ gnat-gps-2.1.0/debian/changelog @@ -0,0 +1,172 @@ +gnat-gps (2.1.0-5ubuntu1) breezy; urgency=low + + * Change build-dep to python2.4-dev + * Ugly hack to find python2.4 + * --with-python=/usr/lib/libpython2.4.so in rules + * Add patch to include /usr/include/cairo in Makefile.in + * 08-makefile-cairo.patch + + -- Barry deFreese Mon, 3 Oct 2005 22:47:24 -0400 + +gnat-gps (2.1.0-5) unstable; urgency=medium + + * Change maintainer's email address. + * debian/323515.patch: new. Thanks, Matt Kraai. Closes: #323515. + + -- Ludovic Brenta Sun, 4 Sep 2005 00:01:38 +0200 + +gnat-gps (2.1.0-4) unstable; urgency=medium + + * debian/rules (clean): remove all files that are generated during build. + * debian/297980.patch: new; thanks to Jan Nordholz for the help. + Closes: #297980. + + -- Ludovic Brenta Wed, 27 Apr 2005 13:26:41 +0200 + +gnat-gps (2.1.0-3) unstable; urgency=low + + * Rebuild using libgtkada2_2.4.0-2; depend on libgtkada-2.4 instead of + libgtkada2-0 (see #293652). + * debian/gnat-gps-doc.copyright: updated to new upstream version. + + -- Ludovic Brenta Sun, 6 Feb 2005 00:12:37 +0100 + +gnat-gps (2.1.0-2) unstable; urgency=low + + * Acknowledge NMU from Matthias. + * Install python customisation files to /usr/share/gps/python, too. + (the example files are still in gnat-gps-doc under + /usr/share/doc/gnat-gps/examples). + * debian/07-python-customisation.patch: new patch, allows the sysadmin + to override /usr/share/gps/python/autoexec.py with + /etc/gnat-gps/autoexec.py. + * debian/README.Debian: information about python support. + + -- Ludovic Brenta Wed, 2 Feb 2005 12:13:02 +0100 + +gnat-gps (2.1.0-1.1) unstable; urgency=low + + * Enable python support. + + -- Matthias Klose Tue, 1 Feb 2005 13:22:22 +0100 + +gnat-gps (2.1.0-1) unstable; urgency=low + + * New upstream release. + + -- Ludovic Brenta Sun, 9 Jan 2005 18:40:50 +0100 + +gnat-gps (1.4.0-5) unstable; urgency=low + + * debian/gnat-gps-doc.copyright: Add a copyright file in gnat-gps-doc. + Closes: #264274. + + * debian/rules (clean): Remove all GNAT configuration files generated + during the build. They were mistakenly included in the *.diff.gz. + + * debian/rules (binary-indep): chmod all the gif files; upstream has + them executable and this is wrong. Insall the changelog and the + copyright file for gnat-gps-doc. + + * debian/rules (install): chmod all the .ali files; new versions of + linda and lintian check for their permissions properly. + + * debian/gnat.postinst: removed. + + * debian/rules (binary-arch): call dh_installdeb to generate the + postinst and postrm scripts. + + * debian/menu: use a quoted string for the section. + + * debian/control: Update Standards-Version to 3.6.1.1. + + -- Ludovic Brenta Tue, 10 Aug 2004 07:43:46 +0200 + +gnat-gps (1.4.0-4) unstable; urgency=low + + * Fix FTBFS on sparc, powerpc. Closes: #230082. + + * Update Standards-Version from 3.6.0 to 3.6.1. + + -- Ludovic Brenta Wed, 28 Jan 2004 16:05:24 +0100 + +gnat-gps (1.4.0-3) unstable; urgency=low + + * kernel/src/glide_kernel-project.adb (Execute): fix bug in the + command line used to call gnatmake. Closes: #226513. + + * Use gnat-gdb instead of gdb by default. Closes: #226517. + + * Do not generate the Pretty_Printer section in the GNAT project file; + GNAT 3.15p doesn't understand it. + + * Build and install the tools: gpr2make and gprcmd. Requires things from + the CVS repository for GCC. + + * Install Makefile.generic and Makefile.prolog in /usr/share/make. + + * Install pictures in /usr/share/gps. + + * Recommend gnat and gnat-gdb. + + -- Ludovic Brenta Mon, 26 Jan 2004 12:54:39 +0100 + +gnat-gps (1.4.0-2.1) unstable; urgency=low + + * Make gnat-gpc-doc binary-indep. + + -- Matthias Klose Sat, 6 Dec 2003 11:43:07 +0100 + +gnat-gps (1.4.0-2) unstable; urgency=low + + * Reinstate the Source Navigator sources; upstream modified them from + the original. + + * Put `dbimp' and `cbrowser' in /usr/lib/gps. + + * Copy the share/*.xml files into /usr/share/gps/customize. They are + now necessary at run time. + + -- Ludovic Brenta Thu, 4 Dec 2003 13:44:18 +0100 + +gnat-gps (1.4.0-1) unstable; urgency=low + + * New upstream version. + + * Do not call recursive makes silently; change $(MAKE) -s to just + $(MAKE) in all Makefiles. + + * Use consistent compiler flags for all C files by exporting CFLAGS from + the top-level Makefile, and using that in all relevant Makefiles. + + * Remove the source files for Red Hat Source Navigator. Depend on + sourcenav (>= 5.0) instead. + + * Build the Ada binding to Berkeley DB 1.85 against libdb3's + compatibility interface instead of the copy of Berkeley DB included in + Source Navigator. + + * Link against libgtkada2 (>= 2.2.1) as required upstream. + + * Streamline GNAT.Regpat.Extra to just the stuff required above and + beyond GNAT.Regpat in GNAT 3.15p. + + * Add GNAT.Heap_Sort (g-heasor.ad[bs]) from the CVS repository for GCC. + + -- Ludovic Brenta Mon, 1 Dec 2003 13:28:57 +0100 + +gnat-gps (1.2.2-1) unstable; urgency=low + + * Initial Release. + + * Link dynamically against libgnat-3.15p; do not use upstream's modified + libgnat. + + * Link dynamically against libgtkada2-0 (>= 2.2.0); do not use + upstream's 2.0.1. + + -- Ludovic Brenta Sun, 31 Aug 2003 20:19:19 +0200 + +Local variables: +left-margin: 2 +End: --- gnat-gps-2.1.0.orig/debian/control +++ gnat-gps-2.1.0/debian/control @@ -0,0 +1,47 @@ +Source: gnat-gps +Section: devel +Priority: optional +Maintainer: Ludovic Brenta +Uploaders: Matthias Klose +Build-Depends: debhelper (>> 4.0.0), gnat (>= 3.15p-1), libgtkada2-dev (>= 2.4.0-1), gcc, tetex-bin, texinfo, python2.4-dev +Standards-Version: 3.6.1.1 + +Package: gnat-gps +Architecture: i386 powerpc sparc +Depends: ${shlibs:Depends} +Recommends: gnat (>= 3.15p), gnat-doc, gnat-gdb, gnat-gdb-doc, gnat-gps-doc (= ${Source-Version}), ada-reference-manual +Description: The GNAT Programming System - advanced IDE for C and Ada + GPS is a complete integrated development environment that gives access + to a wide range of tools and integrates them smoothly. + . + GPS gives access to built-in file editing; HTML based help system; + complete compile/build/run cycle; intelligent source navigation; + project management; general graph technology giving access to many + different browsers such as source dependency, project dependency, call + graphs, etc.; fully integrated visual debugger, based on the GVD + technology, and enhanced for inclusion in GPS; generic version control + system, providing access to CVS, ClearCase, and possibly others in the + future; many other tools such as a visual comparison, automatic + generation of files, source reformatting. + . + GPS is fully customizable, providing several levels of customizations: + a first level, available through the preferences dialog; a second + level, which allows you to customize your menu items, tool bar and key + bindings; a third level, which allows you to automate processing + through scripts; and a fourth level, which allows any kind of very + specific or tight integration, due to the open nature of GPS, and to + its architecture. + . + GPS also integrates with existing editors such as Emacs and Vi. + +Package: gnat-gps-doc +Architecture: all +Section: doc +Description: The GNAT Programming System - documentation + This package contains the documentation for GPS, the GNAT Programming + System, in ASCII, Info, HTML and PostScript formats. This documentation + consists of: + . + - the GPS Tutorial: building Hello, World with the GPS + - a User's Guide: using the GPS for multi-language projects + - a Programmer's Manual: extending the GPS with new modules --- gnat-gps-2.1.0.orig/debian/copyright +++ gnat-gps-2.1.0/debian/copyright @@ -0,0 +1,35 @@ +This package was debianized by Ludovic Brenta on +Sun, 31 Aug 2003 20:19:19 +0200 + +It was downloaded from http://libre.act-europe.fr/gps. + +Upstream Authors: + +Please report suggestions, bugs to gps-devel (at lists.act-europe.fr). + +This software has been written and is maintained by Ada Core +Technologies and ACT Europe. If you are interested in getting +commercial support for this software, please contact sales@gnat.com or +sales@act-europe.fr. + +Copyright: + G P S + + Copyright (C) 2001-2003 + ACT-Europe + +GPS is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. You should have received +a copy of the GNU General Public License along with this program; +if not, write to the Free Software Foundation, Inc., 59 Temple +Place Suite 330, Boston, MA 021111307, USA. + +The full text of the GPL is available in the file +/usr/share/common-licenses/GPL. --- gnat-gps-2.1.0.orig/debian/gnat-gps.1 +++ gnat-gps-2.1.0/debian/gnat-gps.1 @@ -0,0 +1,27 @@ +.TH GNAT-GPS 1 "01 DEC 2003" "GNU Ada Tools" "GPS User's Guide" +.SH NAME +gnat-gps \- The GNAT Programming System +.SH SYNOPSIS +\fBgnat-gps\fR +.SH DESCRIPTION +GPS, the GNAT Programming System, is a cutting-edge Free Software IDE +that streamlines the interaction between developers and their +software. With its intuitive interface, GPS is easy to use, +simplifying source navigation and highlighting the fundamental ideas +in the program. By displaying core application structures, such as +call graphs, program entity graphs, and project dependencies, GPS +facilitates the development of systems. GPS helps construct reliable +code while providing the same interface and behavior across a variety +of platforms. Designed by programmers for programmers, GPS is a new +kind of IDE that offers the experience of designing software in a +uniquely comfortable environment. +.SH "SEE ALSO" +.BR gnat (1) +.SH AUTHOR +The GNAT Programming System has been written and is maintained by Ada +Core Technologies and ACT Europe. If you are interested in getting +commercial support for this software, please contact sales@gnat.com or +sales@act-europe.fr. + +This manual page has been written by Ludovic Brenta + for Debian GNU/Linux. --- gnat-gps-2.1.0.orig/debian/menu +++ gnat-gps-2.1.0/debian/menu @@ -0,0 +1,2 @@ +?package(gnat-gps):needs="X11" section="Apps/Programming"\ + title="GNAT Programming System" command="/usr/bin/gnat-gps" --- gnat-gps-2.1.0.orig/debian/rules +++ gnat-gps-2.1.0/debian/rules @@ -0,0 +1,179 @@ +#!/usr/bin/make -f +# debian/rules for gnat-gps. +# Copyright (c) 2003 - 2005 Ludovic Brenta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The full text of the GNU General Public License is in the file +# /usr/share/common-licenses/GPL on Debian systems. + +export DH_COMPAT = 4 + +patch-stamp: + if [ ! -f patch-stamp ]; then \ + for i in debian/*.patch; do \ + echo "Applying $$i..."; \ + patch --forward -p0 < $$i; \ + done; \ + touch patch-stamp; \ + fi + +unpatch: + if [ -f patch-stamp ] ; then \ + for i in debian/*.patch; do \ + echo "Reverting $$i..."; \ + patch --reverse -p0 < $$i; \ + done; \ + rm patch-stamp; \ + fi + +config.status: configure + dh_testdir + GTK_CONFIG=/usr/bin/gtkada2-config \ + PYTHON_BASE=/usr \ + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ + --with-python=/usr/lib/libpython2.4.so + +build: build-stamp + +build-stamp: patch-stamp config.status + dh_testdir + $(MAKE) GNATMAKE="gnatmake -j2" + mv glide/obj/gps glide/obj/gnat-gps + (cd docs; mkdir debian; \ + makeinfo -o debian/gnat_gps_pg.info gps_pg.texi --no-split; \ + makeinfo -o debian/gnat_gps.info gps.texi --no-split; \ + makeinfo -o debian/gnat_gps_tutorial.info tutorial.texi --no-split) + touch build-stamp + +# Upstream does not provide a "make distclean", and "make clean" fails +# to remove a number of files but incorrectly calls "configure" +# instead. Remove them ourselves. + + +PARSERS_GENERATED_FILES = \ +assembly/ppc601-eabi/Makefile assembly/ppc601-eabi/config.h \ +cpp/cbrowser cpp/cpplib/Makefile cpp/Makefile Makefile + +SNAVIGATOR_GENERATED_FILES = \ +dbutils/Makefile misc/libutils/Makefile misc/Makefile \ +db/dbcp db/dbdump db/dbimp db/Makefile \ +hyper/Makefile install/Makefile Makefile config.h + +SNSRC_GENERATED_FILES = \ +db/{PORT,include}/Makefile db/Makefile db/config.h \ +tcl8.1/unix/Makefile tcl8.1/Makefile Makefile \ +tcl8.1/unix/tclConfig.sh + +SN_GENERATED_FILES = src/Makefile include/config.h +GVD_GENERATED_FILES = gvd/common/gvd.ads gvd/Makefile.gvd_common gvd/gvd_common.gpr +PYTHON_GENERATED_FILES = python/Makefile.python python/python.gpr +WIDGETS_GENERATED_FILES = widgets/obj/htmltextslave.pp widgets/Makefile.widgets +DOC_GENERATED_FILES = docs/debian docs/Makefile po/Makefile +CONFLICTING_GNAT_SOURCES = \ +gnat_src/g-comlin.ad[bs] \ +gnat_src/g-dirope.ad[bs] \ +gnat_src/g-os_lib.ad[bs] \ +gnat_src/g-regpat.ad[bs] + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + rm -f gnat/*.* + rm -rf Makefile glide/obj/gnat-gps \ + gnat/sdefault/sdefault.adb \ + gtkada/gtkada.gpr \ + $(PYTHON_GENERATED_FILES) \ + $(WIDGETS_GENERATED_FILES) \ + $(DOC_GENERATED_FILES) \ + $(GVD_GENERATED_FILES) Makefile.common + (cd kernel/src_info/sn/snsrc/snavigator/parsers; \ + rm -f $(PARSERS_GENERATED_FILES) ) + (cd kernel/src_info/sn/snsrc/snavigator; \ + rm -f $(SNAVIGATOR_GENERATED_FILES) ) + (cd kernel/src_info/sn/snsrc; rm -f $(SNSRC_GENERATED_FILES) ) + cd kernel/src_info/sn && rm -f $(SN_GENERATED_FILES) + -rm -f $(CONFLICTING_GNAT_SOURCES) + find . \( -name config.log -o -name config.status -o -name \*.d \ + -o -name stamp-h -o -name \*.o -o -name \*.ali -o -name \*.a \ + -o -name b~\* -o -name GNAT-\* -o -name \*.orig \) -exec rm -f {} \; + rm -f glide/obj/gpslink + dh_clean + +binary-indep: + dh_testdir + dh_testroot + dh_installinfo -pgnat-gps-doc docs/debian/*.info + dh_installdocs -pgnat-gps-doc \ + docs/*.txt \ + docs/*.html \ + docs/*.gif \ + docs/*.jpg \ + docs/*.xml + dh_installexamples -pgnat-gps-doc examples/* + dh_installchangelogs -i + dh_fixperms -i + dh_compress -pgnat-gps-doc -X.xml -X.ads -X.adb -X.c -X.py + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +binary-arch: build + dh_testdir + dh_testroot + dh_installdirs usr/bin usr/lib/gps \ + usr/share/gps/customize usr/share/doc/gnat-gps \ + usr/share/gps/icons usr/share/gps/python \ + usr/share/make + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install glide/obj/gnat-gps usr/bin + dh_install kernel/src_info/sn/snsrc/snavigator/db/dbimp \ + kernel/src_info/sn/snsrc/snavigator/parsers/cpp/cbrowser \ + usr/lib/gps + dh_install docs/gps-animation.gif docs/gps-splash.jpg \ + usr/share/gps +# Upstream ships many files with executable permission, lintian complains + chmod u=rw,go=r debian/gnat-gps/usr/share/gps/*.* + dh_install share/customize/*.xml usr/share/gps/customize + dh_install share/icons/*.png usr/share/gps/icons + dh_install share/python/*.py usr/share/gps/python + dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman debian/gnat-gps.1 +# dh_link + dh_strip + dh_compress -X.py + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch + +.PHONY: build clean binary-indep binary-arch binary --- gnat-gps-2.1.0.orig/debian/297980.patch +++ gnat-gps-2.1.0/debian/297980.patch @@ -0,0 +1,19 @@ +I am indebted to Jan Nordholz for providing the insight necessary to +fix #297980. + +-- +Ludovic Brenta. + +--- gvd/gnat/gexpect_tty.c~ 2003-10-15 10:33:51.000000000 +0200 ++++ gvd/gnat/gexpect_tty.c 2005-04-27 08:25:51.000000000 +0200 +@@ -1708,10 +1708,8 @@ + else + err = ioctl (XINT (p->infd), TIOCGPGRP, &gid); + +-#ifdef pfa + if (err == -1) + gid = - XFASTINT (p->pid); +-#endif /* ! defined (pfa) */ + } + if (gid == -1) + no_pgrp = 1; --- gnat-gps-2.1.0.orig/debian/00-makefiles.patch +++ gnat-gps-2.1.0/debian/00-makefiles.patch @@ -0,0 +1,319 @@ +* Call make without -s. +* Use GtkAda in paths conformant to the GNU Ada Environment Specification. +* Use $(GNATMAKE) instead of $(CC) when compiling Ada source files. +* Really use the proper options in GVD, not -g -O2. +* Use gtkada2-config, not gtkada-config. +* Enable run-time checks for integer overflows (-gnato). + +-- +Ludovic Brenta. + +--- action_editor/Makefile~ ++++ action_editor/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.action_editor $@ ++ $(MAKE) -f Makefile.action_editor $@ + +--- ada_module/Makefile~ ++++ ada_module/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vsearch $@ ++ $(MAKE) -f Makefile.vsearch $@ + +--- aliases/Makefile~ ++++ aliases/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.aliases $@ ++ $(MAKE) -f Makefile.aliases $@ + +--- aunit/Makefile~ ++++ aunit/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.aunit $@ ++ $(MAKE) -f Makefile.aunit $@ +--- browsers/Makefile~ ++++ browsers/Makefile +@@ -1,2 +1,2 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.browsers $@ ++ $(MAKE) -f Makefile.browsers $@ +--- codefix/Makefile~ ++++ codefix/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.codefix $@ ++ $(MAKE) -f Makefile.codefix $@ +--- common/Makefile~ ++++ common/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.common $@ ADA_SOURCES="test_htables.adb test_rbtree.adb test_trie.adb test_arrays.adb" ++ $(MAKE) -f Makefile.common $@ ADA_SOURCES="test_htables.adb test_rbtree.adb test_trie.adb test_arrays.adb" +--- cpp_module/Makefile~ ++++ cpp_module/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vsearch $@ ++ $(MAKE) -f Makefile.vsearch $@ + +--- custom/Makefile~ ++++ custom/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.custom $@ ++ $(MAKE) -f Makefile.custom $@ +--- gbuilder/Makefile~ ++++ gbuilder/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.gbuilder $@ ADA_SOURCES="gbuilder.adb radical.adb" ++ $(MAKE) -f Makefile.gbuilder $@ ADA_SOURCES="gbuilder.adb radical.adb" +--- gtkada/Makefile.gtkada~ ++++ gtkada/Makefile.gtkada +@@ -21,6 +21,6 @@ + $(GTK_PREFIX)/include/pango-1.0 \ + $(GTK_PREFIX)/include/atk-1.0 + SRC_DIRS += $(GTKADA_SRC_DIRS) +-LDFLAGS += $(shell gtkada-config --libs) ++LDFLAGS += $(shell gtkada2-config --libs) + + endif +--- gtkada/gtkada.gpr.in~ ++++ gtkada/gtkada.gpr.in +@@ -1,6 +1,10 @@ + project Gtkada is + +- for Source_Dirs use ("@GTKADA_SRC@"); +- for Object_Dir use "@GTKADA_SRC@"; ++ for Source_Dirs use ("/usr/share/ada/adainclude/gtkada2"); ++ for Object_Dir use "/usr/lib/ada/adalib/gtkada2"; ++ ++ package Linker is ++ for Default_Switches ("Ada") use ("-lgtkada2"); ++ end Linker; + + end Gtkada; +--- gvd/gnat/Makefile.in~ ++++ gvd/gnat/Makefile.in +@@ -6,7 +6,7 @@ + static: all + + g-exptty.o: g-exptty.adb g-exptty.ads +- $(CC) -c -gnatg $(CFLAGS) g-exptty.adb ++ $(GNATMAKE) -c -gnatg $(CFLAGS) g-exptty.adb + + gexpect_tty.o: gexpect_tty.c systty.h Makefile + $(CC) -c $(ALL_CFLAGS) $< +--- gvd/Makefile.gvd_common.in~ ++++ gvd/Makefile.gvd_common.in +@@ -19,7 +19,7 @@ + GVD_COMMON_OBJ_DIR = $(GVD_COMMON_BASE_DIR)/common/obj + OBJ_DIR = $(GVD_COMMON_OBJ_DIR) + +-CFLAGS = -g -O2 -DSYSTEM_INCLUDE=@opsysfile@ @DEFS@ ++override CFLAGS += -DSYSTEM_INCLUDE=@opsysfile@ @DEFS@ + + PROJECT_FILE = gvd_common + LIBS := $(GVD_COMMON_OBJ_DIR)/libgvd_common$(AR_EXT) @TARGET_LFLAGS@ $(LIBS) +--- kernel/src_info/Makefile~ 2004-05-10 10:27:14.000000000 +0200 ++++ kernel/src_info/Makefile 2005-01-09 19:24:05.000000000 +0100 +@@ -1,3 +1,3 @@ + default build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.standalone $@ ++ $(MAKE) -f Makefile.standalone $@ + +--- kernel/Makefile~ ++++ kernel/Makefile +@@ -1,6 +1,6 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.kernel $@ ++ $(MAKE) -f Makefile.kernel $@ + + test: +- $(MAKE) -s -f Makefile.kernel ADA_SOURCES=read_ali.adb build ++ $(MAKE) -f Makefile.kernel ADA_SOURCES=read_ali.adb build + +--- keymanager/Makefile~ ++++ keymanager/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.keymanager $@ ++ $(MAKE) -f Makefile.keymanager $@ + +--- navigation/Makefile~ ++++ navigation/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.navigation $@ ++ $(MAKE) -f Makefile.navigation $@ +--- prj_editor/Makefile~ ++++ prj_editor/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.prj_editor $@ ++ $(MAKE) -f Makefile.prj_editor $@ +--- python/Makefile~ ++++ python/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.python $@ ++ $(MAKE) -f Makefile.python $@ + +--- refactoring/Makefile~ ++++ refactoring/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.theme_manager $@ ++ $(MAKE) -f Makefile.theme_manager $@ + +--- shell/Makefile~ ++++ shell/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.aliases $@ ++ $(MAKE) -f Makefile.aliases $@ + +--- socket/Makefile~ ++++ socket/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.socket $@ ++ $(MAKE) -f Makefile.socket $@ +--- src_editor/Makefile~ ++++ src_editor/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.src_editor $@ ++ $(MAKE) -f Makefile.src_editor $@ +--- syntax/Makefile~ ++++ syntax/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.syntax $@ ++ $(MAKE) -f Makefile.syntax $@ +--- theme_manager/Makefile~ ++++ theme_manager/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.theme_manager $@ ++ $(MAKE) -f Makefile.theme_manager $@ + +--- tools/custom_converter/Makefile~ ++++ tools/custom_converter/Makefile +@@ -1,2 +1,2 @@ + all: +- gnatmake -Pcustom_convert -largs `gtkada-config --libs` ++ gnatmake -Pcustom_convert -largs `gtkada2-config --libs` +--- vcs/Makefile~ ++++ vcs/Makefile +@@ -1,21 +1,21 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vcs $@ ++ $(MAKE) -f Makefile.vcs $@ + + shared: + cd obj; gnat bind -E -P../vcs -C -Lvcs_module_ -o vcs_init.c \ + vcs.ali vcs_*.ali commands-*.ali vcs-unknown*.ali log_utils.ali +- cd obj; gcc -c -fPIC vcs_init.c ++ cd obj; gcc -c -fPIC $(CFLAGS) vcs_init.c + cd obj; gcc -shared -o libvcs_module.so \ + vcs.o vcs_*.o vcs-unknown*.o commands*.o log_utils.o pixmaps_vcs.o + + cd obj; gnat bind -E -P../vcs -C -Lvcs__cvs_ -o cvs_init.c \ + vcs-cvs*.ali +- cd obj; gcc -c -fPIC cvs_init.c ++ cd obj; gcc -c -fPIC $(CFLAGS) cvs_init.c + cd obj; gcc -shared -o libvcs_cvs.so cvs_init.o vcs-cvs*.o + + cd obj; gnat bind -E -P../vcs -C -Lvcs__clearcase_ \ + -o clearcase_init.c vcs-clearcase*.ali +- cd obj; gcc -c -fPIC clearcase_init.c ++ cd obj; gcc -c -fPIC $(CFLAGS) clearcase_init.c + cd obj; gcc -shared -o libvcs_clearcase.so clearcase_init.o \ + vcs-clearcase*.o + +--- vdiff/Makefile~ ++++ vdiff/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vdiff $@ ++ $(MAKE) -f Makefile.vdiff $@ +--- vfs/Makefile~ ++++ vfs/Makefile +@@ -1,8 +1,8 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vfs $@ ++ $(MAKE) -f Makefile.vfs $@ + + shared: + cd obj; gnat bind -E -P../vfs -C -Lvfs_module_ -o vfs_init.c *.ali +- cd obj; gcc -c -fPIC vfs_init.c ++ cd obj; gcc -c -fPIC $(CFLAGS) vfs_init.c + cd obj; gcc -shared -o libvfs_module.so *.o + +--- vsearch/tests/Makefile~ ++++ vsearch/tests/Makefile +@@ -1,2 +1,2 @@ + all build compile link ada c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vsearch_tests $@ ++ $(MAKE) -f Makefile.vsearch_tests $@ +--- vsearch/Makefile~ ++++ vsearch/Makefile +@@ -1,3 +1,3 @@ + ada compile link c c++ clean internal-clean : +- $(MAKE) -s -f Makefile.vsearch $@ ++ $(MAKE) -f Makefile.vsearch $@ + +--- Makefile.in~ ++++ Makefile.in +@@ -8,13 +8,17 @@ + bindir = $(prefix)/bin + sharedir = $(prefix)/share + ++# Use these flags when compiling C files in all sub-makes. ++CFLAGS=-O3 ++export CFLAGS ++ + default build compile link ada c c++: +- $(MAKE) -s -C glide -f Makefile.gps $@ ++ $(MAKE) -C glide -f Makefile.gps $@ + + clean: +- $(RM) gnat/*.ad* ++ $(RM) gnat/*.ad* gnat/Makefile.* + $(RM) obj/*.ali obj/*.o +- $(MAKE) -s -C glide -f Makefile.gps $@ ++ $(MAKE) -C glide -f Makefile.gps $@ + + install-common: + $(MKDIR) $(bindir) +@@ -31,13 +35,11 @@ + + install: install-common + $(INSTALL_PROGRAM) glide/obj/gps $(bindir) +- $(MAKE) -C kernel/src_info/sn/snsrc install + + install-strip: install-common + $(INSTALL_PROGRAM) -s glide/obj/gps $(bindir) +- $(MAKE) -C kernel/src_info/sn/snsrc install-strip + + gvd: +- $(MAKE) -s -C gvd -f Makefile.gvd EXEC=gvd ADA_SOURCES=gvd_main.adb ++ $(MAKE) -C gvd -f Makefile.gvd EXEC=gvd ADA_SOURCES=gvd_main.adb + + .PHONY: gvd install install-common install-strip +--- shared.gpr~ ++++ shared.gpr +@@ -21,7 +21,7 @@ + ("-g", "-O", "-gnata", "-gnatVa", "-gnatQ", "-gnaty", + "-gnatwjmeurk", "-Wall"); + when "Production" => +- for Default_Switches ("Ada") use ("-O2", "-gnatn", "-gnatws"); ++ for Default_Switches ("Ada") use ("-O2", "-gnatno", "-gnatws"); + end case; + end Compiler; + --- gnat-gps-2.1.0.orig/debian/226513-pretty-printer.patch +++ gnat-gps-2.1.0/debian/226513-pretty-printer.patch @@ -0,0 +1,34 @@ +Disable the pretty-printer feature, which requires GCC >= 3.4. + +--- gnat_src/prj-attr.adb~ ++++ gnat_src/prj-attr.adb +@@ -151,9 +151,10 @@ + "Lbswitches#" & + + -- package Pretty_Printer + +- "Ppretty_printer#" & +- "Ladefault_switches#" & +- "Lbswitches#" & ++ -- Debian bug #226513: disable the pretty printer feature ++ -- "Ppretty_printer#" & ++ -- "Ladefault_switches#" & ++ -- "Lbswitches#" & + + -- package gnatstub +--- share/customize/gnatpp.xml~ 2004-06-17 17:32:26.000000000 +0200 ++++ share/customize/gnatpp.xml 2005-01-18 18:27:43.000000000 +0100 +@@ -2,6 +2,7 @@ + + ++ --- gnat-gps-2.1.0.orig/debian/03-command-line.patch +++ gnat-gps-2.1.0/debian/03-command-line.patch @@ -0,0 +1,19 @@ +Fixes a bug whereby GPS invokes gnat with an extra ASCII.NUL character at the +end of the command line. + + +--- kernel/src/glide_kernel-project.adb~ ++++ kernel/src/glide_kernel-project.adb +@@ -365,7 +367,11 @@ + -- A recursive function is probably not the most efficient way, but this + -- prevents limits on the command line lengths. This also avoids the use + -- of unbounded strings. +- return Concat ("", Scenario_Vars'First, Prefix); ++ if Scenario_Vars'Length = 0 then ++ return " "; -- ??? Remove this when moving to GNAT >> 3.15p. ++ else ++ return Concat ("", Scenario_Vars'First, Prefix); ++ end if; + end Scenario_Variables_Cmd_Line; + + ------------------------ --- gnat-gps-2.1.0.orig/debian/01-libgnat-extras.patch +++ gnat-gps-2.1.0/debian/01-libgnat-extras.patch @@ -0,0 +1,2688 @@ +This patch contains the GNAT.*.Extra packages that extend GNAT 3.15p's +library with features from recent versions of GCC. These features are +necessary for GPS. + +-- +Ludovic Brenta. + +--- Makefile.gnat~ 2004-11-02 18:02:39.000000000 +0100 ++++ Makefile.gnat 2005-01-27 07:55:27.000000000 +0100 +@@ -29,18 +29,16 @@ + fname.adb \ + g-bubsor.ads \ + g-bubsor.adb \ +- g-heasor.ads \ +- g-heasor.adb \ +- g-regpat.ads \ +- g-regpat.adb \ +- g-comlin.ads \ +- g-comlin.adb \ +- g-dirope.ads \ +- g-dirope.adb \ + g-expect.ads \ + g-expect.adb \ +- g-os_lib.ads \ +- g-os_lib.adb \ ++ g-heasor.ads \ ++ g-heasor.adb \ ++ g-regext.ads \ ++ g-regext.adb \ ++ g-diopex.ads \ ++ g-diopex.adb \ ++ g-osliex.ads \ ++ g-osliex.adb \ + g-string.ads \ + g-string.adb \ + gnatvsn.ads \ +--- gnat_src/g-diopex.adb~ ++++ gnat_src/g-diopex.adb 2004-01-11 14:58:33.000000000 +0100 +@@ -0,0 +1,66 @@ ++with GNAT.OS_Lib; ++ ++package body GNAT.Directory_Operations.Extra is ++ Filename_Max : constant Integer := 1024; ++ -- 1024 is the value of FILENAME_MAX in stdio.h ++ ++ ---------------- ++ -- Remove_Dir -- ++ ---------------- ++ ++ procedure Remove_Dir ++ (Dir_Name : Dir_Name_Str; ++ Recursive : Boolean := False) ++ is ++ C_Dir_Name : constant String := Dir_Name & ASCII.NUL; ++ Current_Dir : constant Dir_Name_Str := Get_Current_Dir; ++ Last : Integer; ++ Str : String (1 .. Filename_Max); ++ Success : Boolean; ++ Working_Dir : Dir_Type; ++ ++ procedure rmdir (Dir_Name : String); ++ pragma Import (C, rmdir, "rmdir"); ++ ++ begin ++ -- Remove the directory only if it is empty ++ ++ if not Recursive then ++ rmdir (C_Dir_Name); ++ ++ if GNAT.OS_Lib.Is_Directory (Dir_Name) then ++ raise Directory_Error; ++ end if; ++ ++ -- Remove directory and all files and directories that it may contain ++ ++ else ++ Change_Dir (Dir_Name); ++ Open (Working_Dir, "."); ++ ++ loop ++ Read (Working_Dir, Str, Last); ++ exit when Last = 0; ++ ++ if GNAT.OS_Lib.Is_Directory (Str (1 .. Last)) then ++ if Str (1 .. Last) /= "." and then Str (1 .. Last) /= ".." then ++ Remove_Dir (Str (1 .. Last), True); ++ Remove_Dir (Str (1 .. Last), False); ++ end if; ++ ++ else ++ GNAT.OS_Lib.Delete_File (Str (1 .. Last), Success); ++ ++ if not Success then ++ Change_Dir (Current_Dir); ++ raise Directory_Error; ++ end if; ++ end if; ++ end loop; ++ ++ Change_Dir (Current_Dir); ++ Close (Working_Dir); ++ Remove_Dir (Dir_Name, False); ++ end if; ++ end Remove_Dir; ++end GNAT.Directory_Operations.Extra; +--- gnat_src/g-diopex.ads~ ++++ gnat_src/g-diopex.ads 2004-01-11 14:58:33.000000000 +0100 +@@ -0,0 +1,8 @@ ++package GNAT.Directory_Operations.Extra is ++ procedure Remove_Dir ++ (Dir_Name : Dir_Name_Str; ++ Recursive : Boolean := False); ++ -- Remove the directory named Dir_Name. If Recursive is set to True, then ++ -- Remove_Dir removes all the subdirectories and files that are in ++ -- Dir_Name. Raises Directory_Error if Dir_Name cannot be removed. ++end GNAT.Directory_Operations.Extra; +--- gnat_src/g-osliex.adb~ ++++ gnat_src/g-osliex.adb 2005-01-23 15:30:42.000000000 +0100 +@@ -0,0 +1,800 @@ ++with Ada.Unchecked_Conversion; ++with System.Soft_Links; ++ ++package body GNAT.OS_Lib.Extra is ++ -- The following are used by Create_Temp_File ++ ++ package SSL renames System.Soft_Links; ++ ++ Current_Temp_File_Name : String := "GNAT-TEMP-000000.TMP"; ++ -- Name of the temp file last created ++ ++ Temp_File_Name_Last_Digit : constant Positive := ++ Current_Temp_File_Name'Last - 4; ++ -- Position of the last digit in Current_Temp_File_Name ++ ++ Max_Attempts : constant := 100; ++ -- The maximum number of attempts to create a new temp file ++ ++ ----------- ++ -- Close -- ++ ----------- ++ ++ procedure Close (FD : File_Descriptor; Status : out Boolean) is ++ function C_Close (FD : File_Descriptor) return Integer; ++ pragma Import (C, C_Close, "close"); ++ begin ++ Status := (C_Close (FD) = 0); ++ end Close; ++ ++ ++ --------------- ++ -- Copy_File -- ++ --------------- ++ ++ procedure Copy_File ++ (Name : String; ++ Pathname : String; ++ Success : out Boolean; ++ Mode : Copy_Mode := Copy; ++ Preserve : Attribute := Time_Stamps) ++ is ++ From : File_Descriptor; ++ To : File_Descriptor; ++ ++ Copy_Error : exception; ++ -- Internal exception raised to signal error in copy ++ ++ function Build_Path (Dir : String; File : String) return String; ++ -- Returns pathname Dir catenated with File adding the directory ++ -- separator only if needed. ++ ++ procedure Copy (From, To : File_Descriptor); ++ -- Read data from From and place them into To. In both cases the ++ -- operations uses the current file position. Raises Constraint_Error ++ -- if a problem occurs during the copy. ++ ++ procedure Copy_To (To_Name : String); ++ -- Does a straight copy from source to designated destination file ++ ++ ---------------- ++ -- Build_Path -- ++ ---------------- ++ ++ function Build_Path (Dir : String; File : String) return String is ++ Res : String (1 .. Dir'Length + File'Length + 1); ++ ++ Base_File_Ptr : Integer; ++ -- The base file name is File (Base_File_Ptr + 1 .. File'Last) ++ ++ function Is_Dirsep (C : Character) return Boolean; ++ pragma Inline (Is_Dirsep); ++ -- Returns True if C is a directory separator. On Windows we ++ -- handle both styles of directory separator. ++ ++ --------------- ++ -- Is_Dirsep -- ++ --------------- ++ ++ function Is_Dirsep (C : Character) return Boolean is ++ begin ++ return C = Directory_Separator or else C = '/'; ++ end Is_Dirsep; ++ ++ begin ++ -- Find base file name ++ ++ Base_File_Ptr := File'Last; ++ while Base_File_Ptr >= File'First loop ++ exit when Is_Dirsep (File (Base_File_Ptr)); ++ Base_File_Ptr := Base_File_Ptr - 1; ++ end loop; ++ ++ declare ++ Base_File : String renames ++ File (Base_File_Ptr + 1 .. File'Last); ++ ++ begin ++ Res (1 .. Dir'Length) := Dir; ++ ++ if Is_Dirsep (Dir (Dir'Last)) then ++ Res (Dir'Length + 1 .. Dir'Length + Base_File'Length) := ++ Base_File; ++ return Res (1 .. Dir'Length + Base_File'Length); ++ ++ else ++ Res (Dir'Length + 1) := Directory_Separator; ++ Res (Dir'Length + 2 .. Dir'Length + 1 + Base_File'Length) := ++ Base_File; ++ return Res (1 .. Dir'Length + 1 + Base_File'Length); ++ end if; ++ end; ++ end Build_Path; ++ ++ ---------- ++ -- Copy -- ++ ---------- ++ ++ procedure Copy (From, To : File_Descriptor) is ++ Buf_Size : constant := 200_000; ++ Buffer : array (1 .. Buf_Size) of Character; ++ R : Integer; ++ W : Integer; ++ ++ begin ++ if From = Invalid_FD or else To = Invalid_FD then ++ raise Copy_Error; ++ end if; ++ ++ loop ++ R := Read (From, Buffer (1)'Address, Buf_Size); ++ ++ -- For VMS, the buffer may not be full. So, we need to try again ++ -- until there is nothing to read. ++ ++ exit when R = 0; ++ ++ W := Write (To, Buffer (1)'Address, R); ++ ++ if W < R then ++ ++ -- Problem writing data, could be a disk full ++ ++ Close (From); ++ Close (To); ++ raise Copy_Error; ++ end if; ++ end loop; ++ ++ Close (From); ++ Close (To); ++ end Copy; ++ ++ ------------- ++ -- Copy_To -- ++ ------------- ++ ++ procedure Copy_To (To_Name : String) is ++ ++ function Copy_Attributes ++ (From, To : System.Address; ++ Mode : Integer) ++ return Integer; ++ pragma Import (C, Copy_Attributes, "__gnat_copy_attribs"); ++ -- Mode = 0 - copy only time stamps. ++ -- Mode = 1 - copy time stamps and read/write/execute attributes ++ ++ C_From : String (1 .. Name'Length + 1); ++ C_To : String (1 .. To_Name'Length + 1); ++ ++ begin ++ From := Open_Read (Name, Binary); ++ To := Create_File (To_Name, Binary); ++ Copy (From, To); ++ ++ -- Copy attributes ++ ++ C_From (1 .. Name'Length) := Name; ++ C_From (C_From'Last) := ASCII.Nul; ++ ++ C_To (1 .. To_Name'Length) := To_Name; ++ C_To (C_To'Last) := ASCII.Nul; ++ ++ case Preserve is ++ ++ when Time_Stamps => ++ if Copy_Attributes (C_From'Address, C_To'Address, 0) = -1 then ++ raise Copy_Error; ++ end if; ++ ++ when Full => ++ if Copy_Attributes (C_From'Address, C_To'Address, 1) = -1 then ++ raise Copy_Error; ++ end if; ++ ++ when None => ++ null; ++ end case; ++ ++ end Copy_To; ++ ++ -- Start of processing for Copy_File ++ ++ begin ++ Success := True; ++ ++ -- The source file must exist ++ ++ if not Is_Regular_File (Name) then ++ raise Copy_Error; ++ end if; ++ ++ -- The source file exists ++ ++ case Mode is ++ ++ -- Copy case, target file must not exist ++ ++ when Copy => ++ ++ -- If the target file exists, we have an error ++ ++ if Is_Regular_File (Pathname) then ++ raise Copy_Error; ++ ++ -- Case of target is a directory ++ ++ elsif Is_Directory (Pathname) then ++ declare ++ Dest : constant String := Build_Path (Pathname, Name); ++ ++ begin ++ -- If the target file exists, we have an error ++ -- otherwise do the copy. ++ ++ if Is_Regular_File (Dest) then ++ raise Copy_Error; ++ else ++ Copy_To (Dest); ++ end if; ++ end; ++ ++ -- Case of normal copy to file (destination does not exist) ++ ++ else ++ Copy_To (Pathname); ++ end if; ++ ++ -- Overwrite case, destination file may or may not exist ++ ++ when Overwrite => ++ if Is_Directory (Pathname) then ++ Copy_To (Build_Path (Pathname, Name)); ++ else ++ Copy_To (Pathname); ++ end if; ++ ++ -- Appending case, destination file may or may not exist ++ ++ when Append => ++ ++ -- Appending to existing file ++ ++ if Is_Regular_File (Pathname) then ++ ++ -- Append mode and destination file exists, append data ++ -- at the end of Pathname. ++ ++ From := Open_Read (Name, Binary); ++ To := Open_Read_Write (Pathname, Binary); ++ Lseek (To, 0, Seek_End); ++ ++ Copy (From, To); ++ ++ -- Appending to directory, not allowed ++ ++ elsif Is_Directory (Pathname) then ++ raise Copy_Error; ++ ++ -- Appending when target file does not exist ++ ++ else ++ Copy_To (Pathname); ++ end if; ++ end case; ++ ++ -- All error cases are caught here ++ ++ exception ++ when Copy_Error => ++ Success := False; ++ end Copy_File; ++ ++ ++ ---------------------- ++ -- Create_Temp_File -- ++ ---------------------- ++ ++ procedure Create_Temp_File ++ (FD : out File_Descriptor; ++ Name : out String_Access) ++ is ++ Pos : Positive; ++ Attempts : Natural := 0; ++ Current : String (Current_Temp_File_Name'Range); ++ ++ begin ++ -- Loop until a new temp file can be created ++ ++ File_Loop : loop ++ Locked : begin ++ -- We need to protect global variable Current_Temp_File_Name ++ -- against concurrent access by different tasks. ++ ++ SSL.Lock_Task.all; ++ ++ -- Start at the last digit ++ ++ Pos := Temp_File_Name_Last_Digit; ++ ++ Digit_Loop : ++ loop ++ -- Increment the digit by one ++ ++ case Current_Temp_File_Name (Pos) is ++ when '0' .. '8' => ++ Current_Temp_File_Name (Pos) := ++ Character'Succ (Current_Temp_File_Name (Pos)); ++ exit Digit_Loop; ++ ++ when '9' => ++ ++ -- For 9, set the digit to 0 and go to the previous digit ++ ++ Current_Temp_File_Name (Pos) := '0'; ++ Pos := Pos - 1; ++ ++ when others => ++ ++ -- If it is not a digit, then there are no available ++ -- temp file names. Return Invalid_FD. There is almost ++ -- no that this code will be ever be executed, since ++ -- it would mean that there are one million temp files ++ -- in the same directory! ++ ++ SSL.Unlock_Task.all; ++ FD := Invalid_FD; ++ Name := null; ++ exit File_Loop; ++ end case; ++ end loop Digit_Loop; ++ ++ Current := Current_Temp_File_Name; ++ ++ -- We can now release the lock, because we are no longer ++ -- accessing Current_Temp_File_Name. ++ ++ SSL.Unlock_Task.all; ++ ++ exception ++ when others => ++ SSL.Unlock_Task.all; ++ raise; ++ end Locked; ++ ++ -- Attempt to create the file ++ ++ FD := Create_New_File (Current, Binary); ++ ++ if FD /= Invalid_FD then ++ Name := new String'(Current); ++ exit File_Loop; ++ end if; ++ ++ if not Is_Regular_File (Current) then ++ ++ -- If the file does not already exist and we are unable to create ++ -- it, we give up after Max_Attempts. Otherwise, we try again with ++ -- the next available file name. ++ ++ Attempts := Attempts + 1; ++ ++ if Attempts >= Max_Attempts then ++ FD := Invalid_FD; ++ Name := null; ++ exit File_Loop; ++ end if; ++ end if; ++ end loop File_Loop; ++ end Create_Temp_File; ++ ++ ++ ---------------------- ++ -- Is_Symbolic_Link -- ++ ---------------------- ++ ++ function Is_Symbolic_Link (Name : C_File_Name) return Boolean is ++ function Is_Symbolic_Link (Name : System.Address) return Integer; ++ pragma Import (C, Is_Symbolic_Link, "__gnat_is_symbolic_link"); ++ ++ begin ++ return Is_Symbolic_Link (Name) /= 0; ++ end Is_Symbolic_Link; ++ ++ function Is_Symbolic_Link (Name : String) return Boolean is ++ F_Name : String (1 .. Name'Length + 1); ++ ++ begin ++ F_Name (1 .. Name'Length) := Name; ++ F_Name (F_Name'Last) := ASCII.NUL; ++ return Is_Symbolic_Link (F_Name'Address); ++ end Is_Symbolic_Link; ++ ++ ++ ------------------------ ++ -- Normalize_Pathname -- ++ ------------------------ ++ ++ ++ function Normalize_Pathname ++ (Name : String; ++ Directory : String := ""; ++ Resolve_Links : Boolean := True) ++ return String ++ is ++ Max_Path : Integer; ++ pragma Import (C, Max_Path, "__gnat_max_path_len"); ++ -- Maximum length of a path name ++ ++ procedure Get_Current_Dir ++ (Dir : System.Address; ++ Length : System.Address); ++ pragma Import (C, Get_Current_Dir, "__gnat_get_current_dir"); ++ ++ Path_Buffer : String (1 .. Max_Path + Max_Path + 2); ++ End_Path : Natural := 0; ++ Link_Buffer : String (1 .. Max_Path + 2); ++ Status : Integer; ++ Last : Positive; ++ Start : Natural; ++ Finish : Positive; ++ ++ Max_Iterations : constant := 500; ++ ++ function Readlink ++ (Path : System.Address; ++ Buf : System.Address; ++ Bufsiz : Integer) ++ return Integer; ++ pragma Import (C, Readlink, "__gnat_readlink"); ++ ++ function To_Canonical_File_Spec ++ (Host_File : System.Address) ++ return System.Address; ++ pragma Import ++ (C, To_Canonical_File_Spec, "__gnat_to_canonical_file_spec"); ++ ++ The_Name : String (1 .. Name'Length + 1); ++ Canonical_File_Addr : System.Address; ++ Canonical_File_Len : Integer; ++ ++ Need_To_Check_Drive_Letter : Boolean := False; ++ -- Set to true if Name is an absolute path that starts with "//" ++ ++ function Strlen (S : System.Address) return Integer; ++ pragma Import (C, Strlen, "strlen"); ++ ++ function Get_Directory return String; ++ -- If Directory is not empty, return it, adding a directory separator ++ -- if not already present, otherwise return current working directory ++ -- with terminating directory separator. ++ ++ function Final_Value (S : String) return String; ++ -- Make final adjustment to the returned string. ++ -- To compensate for non standard path name in Interix, ++ -- if S is "/x" or starts with "/x", where x is a capital ++ -- letter 'A' to 'Z', add an additional '/' at the beginning ++ -- so that the returned value starts with "//x". ++ ++ ------------------- ++ -- Get_Directory -- ++ ------------------- ++ ++ function Get_Directory return String is ++ begin ++ -- Directory given, add directory separator if needed ++ ++ if Directory'Length > 0 then ++ if Directory (Directory'Length) = Directory_Separator then ++ return Directory; ++ else ++ declare ++ Result : String (1 .. Directory'Length + 1); ++ ++ begin ++ Result (1 .. Directory'Length) := Directory; ++ Result (Result'Length) := Directory_Separator; ++ return Result; ++ end; ++ end if; ++ ++ -- Directory name not given, get current directory ++ ++ else ++ declare ++ Buffer : String (1 .. Max_Path + 2); ++ Path_Len : Natural := Max_Path; ++ ++ begin ++ Get_Current_Dir (Buffer'Address, Path_Len'Address); ++ ++ if Buffer (Path_Len) /= Directory_Separator then ++ Path_Len := Path_Len + 1; ++ Buffer (Path_Len) := Directory_Separator; ++ end if; ++ ++ return Buffer (1 .. Path_Len); ++ end; ++ end if; ++ end Get_Directory; ++ ++ Reference_Dir : constant String := Get_Directory; ++ -- Current directory name specified ++ ++ ----------------- ++ -- Final_Value -- ++ ----------------- ++ ++ function Final_Value (S : String) return String is ++ begin ++ -- Interix has the non standard notion of disk drive ++ -- indicated by two '/' followed by a capital letter ++ -- 'A' .. 'Z'. One of the two '/' may have been removed ++ -- by Normalize_Pathname. It has to be added again. ++ -- For other OSes, this should not make no difference. ++ ++ if Need_To_Check_Drive_Letter ++ and then S'Length >= 2 ++ and then S (S'First) = '/' ++ and then S (S'First + 1) in 'A' .. 'Z' ++ and then (S'Length = 2 or else S (S'First + 2) = '/') ++ then ++ declare ++ Result : String (1 .. S'Length + 1); ++ ++ begin ++ Result (1) := '/'; ++ Result (2 .. Result'Last) := S; ++ return Result; ++ end; ++ ++ else ++ return S; ++ end if; ++ ++ end Final_Value; ++ ++ -- Start of processing for Normalize_Pathname ++ ++ begin ++ -- Special case, if name is null, then return null ++ ++ if Name'Length = 0 then ++ return ""; ++ end if; ++ ++ -- First, convert VMS file spec to Unix file spec. ++ -- If Name is not in VMS syntax, then this is equivalent ++ -- to put Name at the begining of Path_Buffer. ++ ++ VMS_Conversion : begin ++ The_Name (1 .. Name'Length) := Name; ++ The_Name (The_Name'Last) := ASCII.NUL; ++ ++ Canonical_File_Addr := To_Canonical_File_Spec (The_Name'Address); ++ Canonical_File_Len := Strlen (Canonical_File_Addr); ++ ++ -- If VMS syntax conversion has failed, return an empty string ++ -- to indicate the failure. ++ ++ if Canonical_File_Len = 0 then ++ return ""; ++ end if; ++ ++ declare ++ subtype Path_String is String (1 .. Canonical_File_Len); ++ type Path_String_Access is access Path_String; ++ ++ function Address_To_Access is new ++ Ada.Unchecked_Conversion (Source => System.Address, ++ Target => Path_String_Access); ++ ++ Path_Access : constant Path_String_Access := ++ Address_To_Access (Canonical_File_Addr); ++ ++ begin ++ Path_Buffer (1 .. Canonical_File_Len) := Path_Access.all; ++ End_Path := Canonical_File_Len; ++ Last := 1; ++ end; ++ end VMS_Conversion; ++ ++ -- Replace all '/' by Directory Separators (this is for Windows) ++ ++ if Directory_Separator /= '/' then ++ for Index in 1 .. End_Path loop ++ if Path_Buffer (Index) = '/' then ++ Path_Buffer (Index) := Directory_Separator; ++ end if; ++ end loop; ++ end if; ++ ++ -- Start the conversions ++ ++ -- If this is not finished after Max_Iterations, give up and ++ -- return an empty string. ++ ++ for J in 1 .. Max_Iterations loop ++ ++ -- If we don't have an absolute pathname, prepend ++ -- the directory Reference_Dir. ++ ++ if Last = 1 ++ and then not Is_Absolute_Path (Path_Buffer (1 .. End_Path)) ++ then ++ Path_Buffer ++ (Reference_Dir'Last + 1 .. Reference_Dir'Length + End_Path) := ++ Path_Buffer (1 .. End_Path); ++ End_Path := Reference_Dir'Length + End_Path; ++ Path_Buffer (1 .. Reference_Dir'Length) := Reference_Dir; ++ Last := Reference_Dir'Length; ++ end if; ++ ++ -- If name starts with "//", we may have a drive letter on Interix ++ ++ if Last = 1 and then End_Path >= 3 then ++ Need_To_Check_Drive_Letter := (Path_Buffer (1 .. 2)) = "//"; ++ end if; ++ ++ Start := Last + 1; ++ Finish := Last; ++ ++ -- Ensure that Windows network drives are kept, e.g: \\server\drive-c ++ ++ if Start = 2 ++ and then Directory_Separator = '\' ++ and then Path_Buffer (1 .. 2) = "\\" ++ then ++ Start := 3; ++ end if; ++ ++ -- If we have traversed the full pathname, return it ++ ++ if Start > End_Path then ++ return Final_Value (Path_Buffer (1 .. End_Path)); ++ end if; ++ ++ -- Remove duplicate directory separators ++ ++ while Path_Buffer (Start) = Directory_Separator loop ++ if Start = End_Path then ++ return Final_Value (Path_Buffer (1 .. End_Path - 1)); ++ ++ else ++ Path_Buffer (Start .. End_Path - 1) := ++ Path_Buffer (Start + 1 .. End_Path); ++ End_Path := End_Path - 1; ++ end if; ++ end loop; ++ ++ -- Find the end of the current field: last character ++ -- or the one preceding the next directory separator. ++ ++ while Finish < End_Path ++ and then Path_Buffer (Finish + 1) /= Directory_Separator ++ loop ++ Finish := Finish + 1; ++ end loop; ++ ++ -- Remove "." field ++ ++ if Start = Finish and then Path_Buffer (Start) = '.' then ++ if Start = End_Path then ++ if Last = 1 then ++ return (1 => Directory_Separator); ++ else ++ return Path_Buffer (1 .. Last - 1); ++ end if; ++ ++ else ++ Path_Buffer (Last + 1 .. End_Path - 2) := ++ Path_Buffer (Last + 3 .. End_Path); ++ End_Path := End_Path - 2; ++ end if; ++ ++ -- Remove ".." fields ++ ++ elsif Finish = Start + 1 ++ and then Path_Buffer (Start .. Finish) = ".." ++ then ++ Start := Last; ++ loop ++ Start := Start - 1; ++ exit when Start < 1 or else ++ Path_Buffer (Start) = Directory_Separator; ++ end loop; ++ ++ if Start <= 1 then ++ if Finish = End_Path then ++ return (1 => Directory_Separator); ++ ++ else ++ Path_Buffer (1 .. End_Path - Finish) := ++ Path_Buffer (Finish + 1 .. End_Path); ++ End_Path := End_Path - Finish; ++ Last := 1; ++ end if; ++ ++ else ++ if Finish = End_Path then ++ return Final_Value (Path_Buffer (1 .. Start - 1)); ++ ++ else ++ Path_Buffer (Start + 1 .. Start + End_Path - Finish - 1) := ++ Path_Buffer (Finish + 2 .. End_Path); ++ End_Path := Start + End_Path - Finish - 1; ++ Last := Start; ++ end if; ++ end if; ++ ++ -- Check if current field is a symbolic link ++ ++ elsif Resolve_Links then ++ declare ++ Saved : constant Character := Path_Buffer (Finish + 1); ++ ++ begin ++ Path_Buffer (Finish + 1) := ASCII.NUL; ++ Status := Readlink (Path_Buffer'Address, ++ Link_Buffer'Address, ++ Link_Buffer'Length); ++ Path_Buffer (Finish + 1) := Saved; ++ end; ++ ++ -- Not a symbolic link, move to the next field, if any ++ ++ if Status <= 0 then ++ Last := Finish + 1; ++ ++ -- Replace symbolic link with its value. ++ ++ else ++ if Is_Absolute_Path (Link_Buffer (1 .. Status)) then ++ Path_Buffer (Status + 1 .. End_Path - (Finish - Status)) := ++ Path_Buffer (Finish + 1 .. End_Path); ++ End_Path := End_Path - (Finish - Status); ++ Path_Buffer (1 .. Status) := Link_Buffer (1 .. Status); ++ Last := 1; ++ ++ else ++ Path_Buffer ++ (Last + Status + 1 .. End_Path - Finish + Last + Status) := ++ Path_Buffer (Finish + 1 .. End_Path); ++ End_Path := End_Path - Finish + Last + Status; ++ Path_Buffer (Last + 1 .. Last + Status) := ++ Link_Buffer (1 .. Status); ++ end if; ++ end if; ++ ++ else ++ Last := Finish + 1; ++ end if; ++ end loop; ++ ++ -- Too many iterations: give up ++ ++ -- This can happen when there is a circularity in the symbolic links: ++ -- A is a symbolic link for B, which itself is a symbolic link, and ++ -- the target of B or of another symbolic link target of B is A. ++ -- In this case, we return an empty string to indicate failure to ++ -- resolve. ++ ++ return ""; ++ end Normalize_Pathname; ++ ++ ++ -------------------- ++ -- Set_Read_Only -- ++ -------------------- ++ ++ procedure Set_Read_Only (Name : String) is ++ procedure C_Set_Read_Only (Name : C_File_Name); ++ pragma Import (C, C_Set_Read_Only, "__gnat_set_readonly"); ++ C_Name : aliased String (Name'First .. Name'Last + 1); ++ begin ++ C_Name (Name'Range) := Name; ++ C_Name (C_Name'Last) := ASCII.NUL; ++ C_Set_Read_Only (C_Name (C_Name'First)'Address); ++ end Set_Read_Only; ++ ++end GNAT.OS_Lib.Extra; +--- gnat_src/g-osliex.ads~ ++++ gnat_src/g-osliex.ads 2005-01-23 15:30:17.000000000 +0100 +@@ -0,0 +1,139 @@ ++with Ada.Unchecked_Deallocation; ++ ++package GNAT.OS_Lib.Extra is ++ ++ Invalid_Time : constant OS_Time; ++ -- A special unique value used to flag an invalid time stamp value ++ ++ procedure Free is new Ada.Unchecked_Deallocation ++ (GNAT.OS_Lib.String_List, GNAT.OS_Lib.String_List_Access); ++ -- GNAT.OS_Lib in 3.15p does not have this procedure, but ++ -- later versions will have it. ++ ++ ++ procedure Close (FD : File_Descriptor; Status : out Boolean); ++ -- Close file referenced by FD. Status is False if the underlying service ++ -- failed. Reasons for failure include: disk full, disk quotas exceeded ++ -- and invalid file descriptor (the file may have been closed twice). ++ ++ type Copy_Mode is ++ (Copy, ++ -- Copy the file. It is an error if the target file already exists. ++ -- The time stamps and other file attributes are preserved in the copy. ++ ++ Overwrite, ++ -- If the target file exists, the file is replaced otherwise ++ -- the file is just copied. The time stamps and other file ++ -- attributes are preserved in the copy. ++ ++ Append); ++ -- If the target file exists, the contents of the source file ++ -- is appended at the end. Otherwise the source file is just ++ -- copied. The time stamps and other file attributes are ++ -- are preserved if the destination file does not exist. ++ ++ type Attribute is ++ (Time_Stamps, ++ -- Copy time stamps from source file to target file. All other ++ -- attributes are set to normal default values for file creation. ++ ++ Full, ++ -- All attributes are copied from the source file to the target ++ -- file. This includes the timestamps, and for example also includes ++ -- read/write/execute attributes in Unix systems. ++ ++ None); ++ -- No attributes are copied. All attributes including the time stamp ++ -- values are set to normal default values for file creation. ++ ++ -- Note: The default is Time_Stamps, which corresponds to the normal ++ -- default on Windows style systems. Full corresponds to the typical ++ -- effect of "cp -p" on Unix systems, and None corresponds to the ++ -- typical effect of "cp" on Unix systems. ++ ++ -- Note: Time_Stamps and Full are not supported on VMS and VxWorks ++ ++ procedure Copy_File ++ (Name : String; ++ Pathname : String; ++ Success : out Boolean; ++ Mode : Copy_Mode := Copy; ++ Preserve : Attribute := Time_Stamps); ++ -- Copy a file. Name must designate a single file (no wild cards allowed). ++ -- Pathname can be a filename or directory name. In the latter case Name ++ -- is copied into the directory preserving the same file name. Mode ++ -- defines the kind of copy, see above with the default being a normal ++ -- copy in which the target file must not already exist. Success is set ++ -- to True or False indicating if the copy is successful (depending on ++ -- the specified Mode). ++ -- ++ -- Note: this procedure is only supported to a very limited extent on ++ -- VMS. The only supported mode is Overwrite, and the only supported ++ -- value for Preserve is None, resulting in the default action which ++ -- for Overwrite is to leave attributes unchanged. Furthermore, the ++ -- copy only works for simple text files. ++ ++ procedure Create_Temp_File ++ (FD : out File_Descriptor; ++ Name : out String_Access); ++ -- Create and open for writing a temporary file in the current working ++ -- directory. The name of the file and the File Descriptor are returned. ++ -- No mode parameter is provided. Since this is a temporary file, ++ -- there is no point in doing text translation on it. ++ -- It is the responsibility of the caller to deallocate the access value ++ -- returned in Name. ++ -- This procedure will always succeed if the current working directory ++ -- is writable. If the current working directory is not writable, then ++ -- Invalid_FD is returned for the file descriptor and null for the Name. ++ -- There is no race condition problem between processes trying to ++ -- create temp files at the same time in the same directory. ++ ++ function Normalize_Pathname ++ (Name : String; ++ Directory : String := ""; ++ Resolve_Links : Boolean := True) ++ return String; ++ -- Returns a file name as an absolute path name, resolving all relative ++ -- directories, and symbolic links. The parameter Directory is a fully ++ -- resolved path name for a directory, or the empty string (the default). ++ -- Name is the name of a file, which is either relative to the given ++ -- directory name, if Directory is non-null, or to the current working ++ -- directory if Directory is null. The result returned is the normalized ++ -- name of the file. For most cases, if two file names designate the same ++ -- file through different paths, Normalize_Pathname will return the same ++ -- canonical name in both cases. However, there are cases when this is ++ -- not true; for example, this is not true in Unix for two hard links ++ -- designating the same file. ++ -- ++ -- If Resolve_Links is set to True, then the symbolic links, on systems ++ -- that support them, will be fully converted to the name of the file ++ -- or directory pointed to. This is slightly less efficient, since it ++ -- requires system calls. ++ -- ++ -- If Name cannot be resolved or is null on entry (for example if there is ++ -- a circularity in symbolic links: A is a symbolic link for B, while B is ++ -- a symbolic link for A), then Normalize_Pathname returns an empty string. ++ -- ++ -- In VMS, if Name follows the VMS syntax file specification, it is first ++ -- converted into Unix syntax. If the conversion fails, Normalize_Pathname ++ -- returns an empty string. ++ ++ function Is_Symbolic_Link (Name : String) return Boolean; ++ -- Determines if the given string, Name, is the path of a symbolic link ++ -- on systems that support it. Returns True if so, False if the path ++ -- is not a symbolic link or if the system does not support symbolic links. ++ -- ++ -- A symbolic link is an indirect pointer to a file; its directory entry ++ -- contains the name of the file to which it is linked. Symbolic links may ++ -- span file systems and may refer to directories. ++ ++ function Is_Symbolic_Link (Name : C_File_Name) return Boolean; ++ ++ procedure Set_Read_Only (Name : String); ++ -- Change the permissions on the named file to make it non-writable ++ -- for its owner. ++ ++private ++ Invalid_Time : constant OS_Time := -1; ++ -- This value should match the return valud by __gnat_file_time_* ++end GNAT.OS_Lib.Extra; +--- gnat_src/g-regext.adb~ ++++ gnat_src/g-regext.adb 2005-01-24 07:54:43.000000000 +0100 +@@ -0,0 +1,1514 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT LIBRARY COMPONENTS -- ++-- -- ++-- G N A T . R E G P A T . E X T R A -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1986 by University of Toronto. -- ++-- Copyright (C) 1996-2002 Ada Core Technologies, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 2, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- ++-- for more details. You should have received a copy of the GNU General -- ++-- Public License distributed with GNAT; see file COPYING. If not, write -- ++-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- ++-- MA 02111-1307, USA. -- ++-- -- ++-- As a special exception, if other files instantiate generics from this -- ++-- unit, or you link this unit with other files to produce an executable, -- ++-- this unit does not by itself cause the resulting executable to be -- ++-- covered by the GNU General Public License. This exception does not -- ++-- however invalidate any other reasons why the executable file might be -- ++-- covered by the GNU Public License. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is a Debian-specific package that extends GNAT.Regpat with ++-- the new features added in GPS 1.4.0. These features are required ++-- by GPS, but are not present in GNAT 3.15p. ++ ++with System.IO; use System.IO; ++with Ada.Characters.Handling; use Ada.Characters.Handling; ++with Unchecked_Conversion; ++ ++package body GNAT.Regpat.Extra is ++ ++ MAGIC : constant Character := Character'Val (10#0234#); ++ -- The first byte of the regexp internal "program" is actually ++ -- this magic number; the start node begins in the second byte. ++ -- ++ -- This is used to make sure that a regular expression was correctly ++ -- compiled. ++ ++ ---------------------------- ++ -- Implementation details -- ++ ---------------------------- ++ ++ -- This is essentially a linear encoding of a nondeterministic ++ -- finite-state machine, also known as syntax charts or ++ -- "railroad normal form" in parsing technology. ++ ++ -- Each node is an opcode plus a "next" pointer, possibly plus an ++ -- operand. "Next" pointers of all nodes except BRANCH implement ++ -- concatenation; a "next" pointer with a BRANCH on both ends of it ++ -- is connecting two alternatives. ++ ++ -- The operand of some types of node is a literal string; for others, ++ -- it is a node leading into a sub-FSM. In particular, the operand of ++ -- a BRANCH node is the first node of the branch. ++ -- (NB this is *not* a tree structure: the tail of the branch connects ++ -- to the thing following the set of BRANCHes). ++ ++ -- You can see the exact byte-compiled version by using the Dump ++ -- subprogram. However, here are a few examples: ++ ++ -- (a|b): 1 : MAGIC ++ -- 2 : BRANCH (next at 10) ++ -- 5 : EXACT (next at 18) operand=a ++ -- 10 : BRANCH (next at 18) ++ -- 13 : EXACT (next at 18) operand=b ++ -- 18 : EOP (next at 0) ++ -- ++ -- (ab)*: 1 : MAGIC ++ -- 2 : CURLYX (next at 26) { 0, 32767} ++ -- 9 : OPEN 1 (next at 13) ++ -- 13 : EXACT (next at 19) operand=ab ++ -- 19 : CLOSE 1 (next at 23) ++ -- 23 : WHILEM (next at 0) ++ -- 26 : NOTHING (next at 29) ++ -- 29 : EOP (next at 0) ++ ++ -- The opcodes are: ++ ++ type Opcode is ++ ++ -- Name Operand? Meaning ++ ++ (EOP, -- no End of program ++ MINMOD, -- no Next operator is not greedy ++ ++ -- Classes of characters ++ ++ ANY, -- no Match any one character except newline ++ SANY, -- no Match any character, including new line ++ ANYOF, -- class Match any character in this class ++ EXACT, -- str Match this string exactly ++ EXACTF, -- str Match this string (case-folding is one) ++ NOTHING, -- no Match empty string ++ SPACE, -- no Match any whitespace character ++ NSPACE, -- no Match any non-whitespace character ++ DIGIT, -- no Match any numeric character ++ NDIGIT, -- no Match any non-numeric character ++ ALNUM, -- no Match any alphanumeric character ++ NALNUM, -- no Match any non-alphanumeric character ++ ++ -- Branches ++ ++ BRANCH, -- node Match this alternative, or the next ++ ++ -- Simple loops (when the following node is one character in length) ++ ++ STAR, -- node Match this simple thing 0 or more times ++ PLUS, -- node Match this simple thing 1 or more times ++ CURLY, -- 2num node Match this simple thing between n and m times. ++ ++ -- Complex loops ++ ++ CURLYX, -- 2num node Match this complex thing {n,m} times ++ -- The nums are coded on two characters each. ++ ++ WHILEM, -- no Do curly processing and see if rest matches ++ ++ -- Matches after or before a word ++ ++ BOL, -- no Match "" at beginning of line ++ MBOL, -- no Same, assuming mutiline (match after \n) ++ SBOL, -- no Same, assuming single line (don't match at \n) ++ EOL, -- no Match "" at end of line ++ MEOL, -- no Same, assuming mutiline (match before \n) ++ SEOL, -- no Same, assuming single line (don't match at \n) ++ ++ BOUND, -- no Match "" at any word boundary ++ NBOUND, -- no Match "" at any word non-boundary ++ ++ -- Parenthesis groups handling ++ ++ REFF, -- num Match some already matched string, folded ++ OPEN, -- num Mark this point in input as start of #n ++ CLOSE); -- num Analogous to OPEN ++ ++ for Opcode'Size use 8; ++ ++ -- Opcode notes: ++ ++ -- BRANCH ++ -- The set of branches constituting a single choice are hooked ++ -- together with their "next" pointers, since precedence prevents ++ -- anything being concatenated to any individual branch. The ++ -- "next" pointer of the last BRANCH in a choice points to the ++ -- thing following the whole choice. This is also where the ++ -- final "next" pointer of each individual branch points; each ++ -- branch starts with the operand node of a BRANCH node. ++ ++ -- STAR,PLUS ++ -- '?', and complex '*' and '+', are implemented with CURLYX. ++ -- branches. Simple cases (one character per match) are implemented with ++ -- STAR and PLUS for speed and to minimize recursive plunges. ++ ++ -- OPEN,CLOSE ++ -- ...are numbered at compile time. ++ ++ -- EXACT, EXACTF ++ -- There are in fact two arguments, the first one is the length (minus ++ -- one of the string argument), coded on one character, the second ++ -- argument is the string itself, coded on length + 1 characters. ++ ++ -- A node is one char of opcode followed by two chars of "next" pointer. ++ -- "Next" pointers are stored as two 8-bit pieces, high order first. The ++ -- value is a positive offset from the opcode of the node containing it. ++ -- An operand, if any, simply follows the node. (Note that much of the ++ -- code generation knows about this implicit relationship.) ++ ++ -- Using two bytes for the "next" pointer is vast overkill for most ++ -- things, but allows patterns to get big without disasters. ++ ++ ----------------------- ++ -- Character classes -- ++ ----------------------- ++ -- This is the implementation for character classes ([...]) in the ++ -- syntax for regular expressions. Each character (0..256) has an ++ -- entry into the table. This makes for a very fast matching ++ -- algorithm. ++ ++ type Class_Byte is mod 256; ++ type Character_Class is array (Class_Byte range 0 .. 31) of Class_Byte; ++ ++ type Bit_Conversion_Array is array (Class_Byte range 0 .. 7) of Class_Byte; ++ Bit_Conversion : constant Bit_Conversion_Array := ++ (1, 2, 4, 8, 16, 32, 64, 128); ++ ++ function "=" (Left : Character; Right : Opcode) return Boolean; ++ ++ procedure Bitmap_Operand ++ (Program : Program_Data; ++ P : Pointer; ++ Op : out Character_Class); ++ -- Return a pointer to the string argument of the node at P ++ ++ function Get_From_Class ++ (Bitmap : Character_Class; ++ C : Character) ++ return Boolean; ++ -- Return True if the entry is set for C in the class Bitmap. ++ ++ function Get_Next ++ (Program : Program_Data; ++ IP : Pointer) ++ return Pointer; ++ -- Dig the next instruction pointer out of a node ++ ++ function Get_Next_Offset ++ (Program : Program_Data; ++ IP : Pointer) ++ return Pointer; ++ -- Get the offset field of a node. Used by Get_Next. ++ ++ function Is_Alnum (C : Character) return Boolean; ++ -- Return True if C is an alphanum character or an underscore ('_') ++ ++ function Is_White_Space (C : Character) return Boolean; ++ -- Return True if C is a whitespace character ++ ++ function Operand (P : Pointer) return Pointer; ++ -- Return a pointer to the first operand of the node at P ++ ++ function Read_Natural ++ (Program : Program_Data; ++ IP : Pointer) ++ return Natural; ++ -- Return the 2-byte natural coded at position IP. ++ ++ function String_Length ++ (Program : Program_Data; ++ P : Pointer) ++ return Program_Size; ++ -- Return the length of the string argument of the node at P ++ ++ function String_Operand (P : Pointer) return Pointer; ++ -- Return a pointer to the string argument of the node at P ++ ++ pragma Inline ("="); ++ pragma Inline (Bitmap_Operand); ++ pragma Inline (Get_From_Class); ++ pragma Inline (Get_Next); ++ pragma Inline (Get_Next_Offset); ++ pragma Inline (Is_Alnum); ++ pragma Inline (Is_White_Space); ++ pragma Inline (Operand); ++ pragma Inline (Read_Natural); ++ pragma Inline (String_Length); ++ pragma Inline (String_Operand); ++ ++ --------- ++ -- "=" -- ++ --------- ++ ++ function "=" (Left : Character; Right : Opcode) return Boolean is ++ begin ++ return Character'Pos (Left) = Opcode'Pos (Right); ++ end "="; ++ ++ -------------------- ++ -- Bitmap_Operand -- ++ -------------------- ++ ++ procedure Bitmap_Operand ++ (Program : Program_Data; ++ P : Pointer; ++ Op : out Character_Class) ++ is ++ function Convert is new Unchecked_Conversion ++ (Program_Data, Character_Class); ++ ++ begin ++ Op (0 .. 31) := Convert (Program (P + 3 .. P + 34)); ++ end Bitmap_Operand; ++ ++ -------------------- ++ -- Get_From_Class -- ++ -------------------- ++ ++ function Get_From_Class ++ (Bitmap : Character_Class; ++ C : Character) ++ return Boolean ++ is ++ Value : constant Class_Byte := Character'Pos (C); ++ ++ begin ++ return ++ (Bitmap (Value / 8) and Bit_Conversion (Value mod 8)) /= 0; ++ end Get_From_Class; ++ ++ -------------- ++ -- Get_Next -- ++ -------------- ++ ++ function Get_Next (Program : Program_Data; IP : Pointer) return Pointer is ++ Offset : constant Pointer := Get_Next_Offset (Program, IP); ++ ++ begin ++ if Offset = 0 then ++ return 0; ++ else ++ return IP + Offset; ++ end if; ++ end Get_Next; ++ ++ --------------------- ++ -- Get_Next_Offset -- ++ --------------------- ++ ++ function Get_Next_Offset ++ (Program : Program_Data; ++ IP : Pointer) ++ return Pointer ++ is ++ begin ++ return Pointer (Read_Natural (Program, IP + 1)); ++ end Get_Next_Offset; ++ ++ -------------- ++ -- Is_Alnum -- ++ -------------- ++ ++ function Is_Alnum (C : Character) return Boolean is ++ begin ++ return Is_Alphanumeric (C) or else C = '_'; ++ end Is_Alnum; ++ ++ -------------------- ++ -- Is_White_Space -- ++ -------------------- ++ ++ function Is_White_Space (C : Character) return Boolean is ++ begin ++ -- Note: HT = 9, LF = 10, VT = 11, FF = 12, CR = 13 ++ ++ return C = ' ' or else C in ASCII.HT .. ASCII.CR; ++ end Is_White_Space; ++ ++ ----------- ++ -- Match -- ++ ----------- ++ ++ procedure Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Matches : out Match_Array; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ is ++ Program : Program_Data renames Self.Program; -- Shorter notation ++ ++ First_In_Data : constant Integer := Integer'Max (Data_First, Data'First); ++ Last_In_Data : constant Integer := Integer'Min (Data_Last, Data'Last); ++ ++ -- Global work variables ++ ++ Input_Pos : Natural; -- String-input pointer ++ BOL_Pos : Natural; -- Beginning of input, for ^ check ++ Matched : Boolean := False; -- Until proven True ++ ++ Matches_Full : Match_Array (0 .. Natural'Max (Self.Paren_Count, ++ Matches'Last)); ++ -- Stores the value of all the parenthesis pairs. ++ -- We do not use directly Matches, so that we can also use back ++ -- references (REFF) even if Matches is too small. ++ ++ type Natural_Array is array (Match_Count range <>) of Natural; ++ Matches_Tmp : Natural_Array (Matches_Full'Range); ++ -- Save the opening position of parenthesis. ++ ++ Last_Paren : Natural := 0; ++ -- Last parenthesis seen ++ ++ Greedy : Boolean := True; ++ -- True if the next operator should be greedy ++ ++ type Current_Curly_Record; ++ type Current_Curly_Access is access all Current_Curly_Record; ++ type Current_Curly_Record is record ++ Paren_Floor : Natural; -- How far back to strip parenthesis data ++ Cur : Integer; -- How many instances of scan we've matched ++ Min : Natural; -- Minimal number of scans to match ++ Max : Natural; -- Maximal number of scans to match ++ Greedy : Boolean; -- Whether to work our way up or down ++ Scan : Pointer; -- The thing to match ++ Next : Pointer; -- What has to match after it ++ Lastloc : Natural; -- Where we started matching this scan ++ Old_Cc : Current_Curly_Access; -- Before we started this one ++ end record; ++ -- Data used to handle the curly operator and the plus and star ++ -- operators for complex expressions. ++ ++ Current_Curly : Current_Curly_Access := null; ++ -- The curly currently being processed. ++ ++ ----------------------- ++ -- Local Subprograms -- ++ ----------------------- ++ ++ function Index (Start : Positive; C : Character) return Natural; ++ -- Find character C in Data starting at Start and return position ++ ++ function Repeat ++ (IP : Pointer; ++ Max : Natural := Natural'Last) ++ return Natural; ++ -- Repeatedly match something simple, report how many ++ -- It only matches on things of length 1. ++ -- Starting from Input_Pos, it matches at most Max CURLY. ++ ++ function Try (Pos : in Positive) return Boolean; ++ -- Try to match at specific point ++ ++ function Match (IP : Pointer) return Boolean; ++ -- This is the main matching routine. Conceptually the strategy ++ -- is simple: check to see whether the current node matches, ++ -- call self recursively to see whether the rest matches, ++ -- and then act accordingly. ++ -- ++ -- In practice Match makes some effort to avoid recursion, in ++ -- particular by going through "ordinary" nodes (that don't ++ -- need to know whether the rest of the match failed) by ++ -- using a loop instead of recursion. ++ -- Why is the above comment part of the spec rather than body ??? ++ ++ function Match_Whilem (IP : Pointer) return Boolean; ++ -- Return True if a WHILEM matches ++ -- How come IP is unreferenced in the body ??? ++ ++ function Recurse_Match (IP : Pointer; From : Natural) return Boolean; ++ pragma Inline (Recurse_Match); ++ -- Calls Match recursively. It saves and restores the parenthesis ++ -- status and location in the input stream correctly, so that ++ -- backtracking is possible ++ ++ function Match_Simple_Operator ++ (Op : Opcode; ++ Scan : Pointer; ++ Next : Pointer; ++ Greedy : Boolean) ++ return Boolean; ++ -- Return True it the simple operator (possibly non-greedy) matches ++ ++ pragma Inline (Index); ++ pragma Inline (Repeat); ++ ++ -- These are two complex functions, but used only once. ++ ++ pragma Inline (Match_Whilem); ++ pragma Inline (Match_Simple_Operator); ++ ++ ----------- ++ -- Index -- ++ ----------- ++ ++ function Index ++ (Start : Positive; ++ C : Character) ++ return Natural ++ is ++ begin ++ for J in Start .. Last_In_Data loop ++ if Data (J) = C then ++ return J; ++ end if; ++ end loop; ++ ++ return 0; ++ end Index; ++ ++ ------------------- ++ -- Recurse_Match -- ++ ------------------- ++ ++ function Recurse_Match (IP : Pointer; From : Natural) return Boolean is ++ L : constant Natural := Last_Paren; ++ ++ Tmp_F : constant Match_Array := ++ Matches_Full (From + 1 .. Matches_Full'Last); ++ ++ Start : constant Natural_Array := ++ Matches_Tmp (From + 1 .. Matches_Tmp'Last); ++ Input : constant Natural := Input_Pos; ++ ++ begin ++ if Match (IP) then ++ return True; ++ end if; ++ ++ Last_Paren := L; ++ Matches_Full (Tmp_F'Range) := Tmp_F; ++ Matches_Tmp (Start'Range) := Start; ++ Input_Pos := Input; ++ return False; ++ end Recurse_Match; ++ ++ ----------- ++ -- Match -- ++ ----------- ++ ++ function Match (IP : Pointer) return Boolean is ++ Scan : Pointer := IP; ++ Next : Pointer; ++ Op : Opcode; ++ ++ begin ++ State_Machine : ++ loop ++ pragma Assert (Scan /= 0); ++ ++ -- Determine current opcode and count its usage in debug mode ++ ++ Op := Opcode'Val (Character'Pos (Program (Scan))); ++ ++ -- Calculate offset of next instruction. ++ -- Second character is most significant in Program_Data. ++ ++ Next := Get_Next (Program, Scan); ++ ++ case Op is ++ when EOP => ++ return True; -- Success ! ++ ++ when BRANCH => ++ if Program (Next) /= BRANCH then ++ Next := Operand (Scan); -- No choice, avoid recursion ++ ++ else ++ loop ++ if Recurse_Match (Operand (Scan), 0) then ++ return True; ++ end if; ++ ++ Scan := Get_Next (Program, Scan); ++ exit when Scan = 0 or Program (Scan) /= BRANCH; ++ end loop; ++ ++ exit State_Machine; ++ end if; ++ ++ when NOTHING => ++ null; ++ ++ when BOL => ++ exit State_Machine when Input_Pos /= BOL_Pos ++ and then ((Self.Flags and Multiple_Lines) = 0 ++ or else Data (Input_Pos - 1) /= ASCII.LF); ++ ++ when MBOL => ++ exit State_Machine when Input_Pos /= BOL_Pos ++ and then Data (Input_Pos - 1) /= ASCII.LF; ++ ++ when SBOL => ++ exit State_Machine when Input_Pos /= BOL_Pos; ++ ++ when EOL => ++ exit State_Machine when Input_Pos <= Data'Last ++ and then ((Self.Flags and Multiple_Lines) = 0 ++ or else Data (Input_Pos) /= ASCII.LF); ++ ++ when MEOL => ++ exit State_Machine when Input_Pos <= Data'Last ++ and then Data (Input_Pos) /= ASCII.LF; ++ ++ when SEOL => ++ exit State_Machine when Input_Pos <= Data'Last; ++ ++ when BOUND | NBOUND => ++ ++ -- Was last char in word ? ++ ++ declare ++ N : Boolean := False; ++ Ln : Boolean := False; ++ ++ begin ++ if Input_Pos /= First_In_Data then ++ N := Is_Alnum (Data (Input_Pos - 1)); ++ end if; ++ ++ if Input_Pos > Last_In_Data then ++ Ln := False; ++ else ++ Ln := Is_Alnum (Data (Input_Pos)); ++ end if; ++ ++ if Op = BOUND then ++ if N = Ln then ++ exit State_Machine; ++ end if; ++ else ++ if N /= Ln then ++ exit State_Machine; ++ end if; ++ end if; ++ end; ++ ++ when SPACE => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else not Is_White_Space (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when NSPACE => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else Is_White_Space (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when DIGIT => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else not Is_Digit (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when NDIGIT => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else Is_Digit (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when ALNUM => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else not Is_Alnum (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when NALNUM => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else Is_Alnum (Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ ++ when ANY => ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else Data (Input_Pos) = ASCII.LF; ++ Input_Pos := Input_Pos + 1; ++ ++ when SANY => ++ exit State_Machine when Input_Pos > Last_In_Data; ++ Input_Pos := Input_Pos + 1; ++ ++ when EXACT => ++ declare ++ Opnd : Pointer := String_Operand (Scan); ++ Current : Positive := Input_Pos; ++ ++ Last : constant Pointer := ++ Opnd + String_Length (Program, Scan); ++ ++ begin ++ while Opnd <= Last loop ++ exit State_Machine when Current > Last_In_Data ++ or else Program (Opnd) /= Data (Current); ++ Current := Current + 1; ++ Opnd := Opnd + 1; ++ end loop; ++ ++ Input_Pos := Current; ++ end; ++ ++ when EXACTF => ++ declare ++ Opnd : Pointer := String_Operand (Scan); ++ Current : Positive := Input_Pos; ++ ++ Last : constant Pointer := ++ Opnd + String_Length (Program, Scan); ++ ++ begin ++ while Opnd <= Last loop ++ exit State_Machine when Current > Last_In_Data ++ or else Program (Opnd) /= To_Lower (Data (Current)); ++ Current := Current + 1; ++ Opnd := Opnd + 1; ++ end loop; ++ ++ Input_Pos := Current; ++ end; ++ ++ when ANYOF => ++ declare ++ Bitmap : Character_Class; ++ ++ begin ++ Bitmap_Operand (Program, Scan, Bitmap); ++ exit State_Machine when Input_Pos > Last_In_Data ++ or else not Get_From_Class (Bitmap, Data (Input_Pos)); ++ Input_Pos := Input_Pos + 1; ++ end; ++ ++ when OPEN => ++ declare ++ No : constant Natural := ++ Character'Pos (Program (Operand (Scan))); ++ ++ begin ++ Matches_Tmp (No) := Input_Pos; ++ end; ++ ++ when CLOSE => ++ declare ++ No : constant Natural := ++ Character'Pos (Program (Operand (Scan))); ++ ++ begin ++ Matches_Full (No) := (Matches_Tmp (No), Input_Pos - 1); ++ ++ if Last_Paren < No then ++ Last_Paren := No; ++ end if; ++ end; ++ ++ when REFF => ++ declare ++ No : constant Natural := ++ Character'Pos (Program (Operand (Scan))); ++ ++ Data_Pos : Natural; ++ ++ begin ++ -- If we haven't seen that parenthesis yet ++ ++ if Last_Paren < No then ++ return False; ++ end if; ++ ++ Data_Pos := Matches_Full (No).First; ++ ++ while Data_Pos <= Matches_Full (No).Last loop ++ if Input_Pos > Last_In_Data ++ or else Data (Input_Pos) /= Data (Data_Pos) ++ then ++ return False; ++ end if; ++ ++ Input_Pos := Input_Pos + 1; ++ Data_Pos := Data_Pos + 1; ++ end loop; ++ end; ++ ++ when MINMOD => ++ Greedy := False; ++ ++ when STAR | PLUS | CURLY => ++ declare ++ Greed : constant Boolean := Greedy; ++ ++ begin ++ Greedy := True; ++ return Match_Simple_Operator (Op, Scan, Next, Greed); ++ end; ++ ++ when CURLYX => ++ ++ -- Looking at something like: ++ ++ -- 1: CURLYX {n,m} (->4) ++ -- 2: code for complex thing (->3) ++ -- 3: WHILEM (->0) ++ -- 4: NOTHING ++ ++ declare ++ Min : constant Natural := ++ Read_Natural (Program, Scan + 3); ++ Max : constant Natural := ++ Read_Natural (Program, Scan + 5); ++ Cc : aliased Current_Curly_Record; ++ ++ Has_Match : Boolean; ++ ++ begin ++ Cc := (Paren_Floor => Last_Paren, ++ Cur => -1, ++ Min => Min, ++ Max => Max, ++ Greedy => Greedy, ++ Scan => Scan + 7, ++ Next => Next, ++ Lastloc => 0, ++ Old_Cc => Current_Curly); ++ Current_Curly := Cc'Unchecked_Access; ++ ++ Has_Match := Match (Next - 3); ++ ++ -- Start on the WHILEM ++ ++ Current_Curly := Cc.Old_Cc; ++ return Has_Match; ++ end; ++ ++ when WHILEM => ++ return Match_Whilem (IP); ++ ++ when others => ++ raise Expression_Error; -- Invalid instruction ++ end case; ++ ++ Scan := Next; ++ end loop State_Machine; ++ ++ -- If we get here, there is no match. ++ -- For successful matches when EOP is the terminating point. ++ ++ return False; ++ end Match; ++ ++ --------------------------- ++ -- Match_Simple_Operator -- ++ --------------------------- ++ ++ function Match_Simple_Operator ++ (Op : Opcode; ++ Scan : Pointer; ++ Next : Pointer; ++ Greedy : Boolean) ++ return Boolean ++ is ++ Next_Char : Character := ASCII.Nul; ++ Next_Char_Known : Boolean := False; ++ No : Integer; -- Can be negative ++ Min : Natural; ++ Max : Natural := Natural'Last; ++ Operand_Code : Pointer; ++ Old : Natural; ++ Last_Pos : Natural; ++ Save : constant Natural := Input_Pos; ++ ++ begin ++ -- Lookahead to avoid useless match attempts ++ -- when we know what character comes next. ++ ++ if Program (Next) = EXACT then ++ Next_Char := Program (String_Operand (Next)); ++ Next_Char_Known := True; ++ end if; ++ ++ -- Find the minimal and maximal values for the operator ++ ++ case Op is ++ when STAR => ++ Min := 0; ++ Operand_Code := Operand (Scan); ++ ++ when PLUS => ++ Min := 1; ++ Operand_Code := Operand (Scan); ++ ++ when others => ++ Min := Read_Natural (Program, Scan + 3); ++ Max := Read_Natural (Program, Scan + 5); ++ Operand_Code := Scan + 7; ++ end case; ++ ++ -- Non greedy operators ++ ++ if not Greedy then ++ ++ -- Test the minimal repetitions ++ ++ if Min /= 0 ++ and then Repeat (Operand_Code, Min) < Min ++ then ++ return False; ++ end if; ++ ++ Old := Input_Pos; ++ ++ -- Find the place where 'next' could work ++ ++ if Next_Char_Known then ++ -- Last position to check ++ ++ Last_Pos := Input_Pos + Max; ++ ++ if Last_Pos > Last_In_Data ++ or else Max = Natural'Last ++ then ++ Last_Pos := Last_In_Data; ++ end if; ++ ++ -- Look for the first possible opportunity ++ ++ loop ++ -- Find the next possible position ++ ++ while Input_Pos <= Last_Pos ++ and then Data (Input_Pos) /= Next_Char ++ loop ++ Input_Pos := Input_Pos + 1; ++ end loop; ++ ++ if Input_Pos > Last_Pos then ++ return False; ++ end if; ++ ++ -- Check that we still match if we stop ++ -- at the position we just found. ++ ++ declare ++ Num : constant Natural := Input_Pos - Old; ++ ++ begin ++ Input_Pos := Old; ++ ++ if Repeat (Operand_Code, Num) < Num then ++ return False; ++ end if; ++ end; ++ ++ -- Input_Pos now points to the new position ++ ++ if Match (Get_Next (Program, Scan)) then ++ return True; ++ end if; ++ ++ Old := Input_Pos; ++ Input_Pos := Input_Pos + 1; ++ end loop; ++ ++ -- We know what the next character is ++ ++ else ++ while Max >= Min loop ++ ++ -- If the next character matches ++ ++ if Match (Next) then ++ return True; ++ end if; ++ ++ Input_Pos := Save + Min; ++ ++ -- Could not or did not match -- move forward ++ ++ if Repeat (Operand_Code, 1) /= 0 then ++ Min := Min + 1; ++ else ++ return False; ++ end if; ++ end loop; ++ end if; ++ ++ return False; ++ ++ -- Greedy operators ++ ++ else ++ No := Repeat (Operand_Code, Max); ++ ++ -- ??? Perl has some special code here in case the ++ -- next instruction is of type EOL, since $ and \Z ++ -- can match before *and* after newline at the end. ++ ++ -- ??? Perl has some special code here in case (paren) ++ -- is True. ++ ++ -- Else, if we don't have any parenthesis ++ ++ while No >= Min loop ++ if not Next_Char_Known ++ or else (Input_Pos <= Last_In_Data ++ and then Data (Input_Pos) = Next_Char) ++ then ++ if Match (Next) then ++ return True; ++ end if; ++ end if; ++ ++ -- Could not or did not work, we back up ++ ++ No := No - 1; ++ Input_Pos := Save + No; ++ end loop; ++ ++ return False; ++ end if; ++ end Match_Simple_Operator; ++ ++ ------------------ ++ -- Match_Whilem -- ++ ------------------ ++ ++ -- This is really hard to understand, because after we match what we ++ -- are trying to match, we must make sure the rest of the REx is going ++ -- to match for sure, and to do that we have to go back UP the parse ++ -- tree by recursing ever deeper. And if it fails, we have to reset ++ -- our parent's current state that we can try again after backing off. ++ ++ function Match_Whilem (IP : Pointer) return Boolean is ++ pragma Unreferenced (IP); ++ ++ Cc : Current_Curly_Access := Current_Curly; ++ N : constant Natural := Cc.Cur + 1; ++ Ln : Natural := 0; ++ ++ Lastloc : constant Natural := Cc.Lastloc; ++ -- Detection of 0-len. ++ ++ begin ++ -- If degenerate scan matches "", assume scan done. ++ ++ if Input_Pos = Cc.Lastloc ++ and then N >= Cc.Min ++ then ++ -- Temporarily restore the old context, and check that we ++ -- match was comes after CURLYX. ++ ++ Current_Curly := Cc.Old_Cc; ++ ++ if Current_Curly /= null then ++ Ln := Current_Curly.Cur; ++ end if; ++ ++ if Match (Cc.Next) then ++ return True; ++ end if; ++ ++ if Current_Curly /= null then ++ Current_Curly.Cur := Ln; ++ end if; ++ ++ Current_Curly := Cc; ++ return False; ++ end if; ++ ++ -- First, just match a string of min scans. ++ ++ if N < Cc.Min then ++ Cc.Cur := N; ++ Cc.Lastloc := Input_Pos; ++ ++ if Match (Cc.Scan) then ++ return True; ++ end if; ++ ++ Cc.Cur := N - 1; ++ Cc.Lastloc := Lastloc; ++ return False; ++ end if; ++ ++ -- Prefer next over scan for minimal matching. ++ ++ if not Cc.Greedy then ++ Current_Curly := Cc.Old_Cc; ++ ++ if Current_Curly /= null then ++ Ln := Current_Curly.Cur; ++ end if; ++ ++ if Recurse_Match (Cc.Next, Cc.Paren_Floor) then ++ return True; ++ end if; ++ ++ if Current_Curly /= null then ++ Current_Curly.Cur := Ln; ++ end if; ++ ++ Current_Curly := Cc; ++ ++ -- Maximum greed exceeded ? ++ ++ if N >= Cc.Max then ++ return False; ++ end if; ++ ++ -- Try scanning more and see if it helps ++ Cc.Cur := N; ++ Cc.Lastloc := Input_Pos; ++ ++ if Recurse_Match (Cc.Scan, Cc.Paren_Floor) then ++ return True; ++ end if; ++ ++ Cc.Cur := N - 1; ++ Cc.Lastloc := Lastloc; ++ return False; ++ end if; ++ ++ -- Prefer scan over next for maximal matching ++ ++ if N < Cc.Max then -- more greed allowed ? ++ Cc.Cur := N; ++ Cc.Lastloc := Input_Pos; ++ ++ if Recurse_Match (Cc.Scan, Cc.Paren_Floor) then ++ return True; ++ end if; ++ end if; ++ ++ -- Failed deeper matches of scan, so see if this one works ++ ++ Current_Curly := Cc.Old_Cc; ++ ++ if Current_Curly /= null then ++ Ln := Current_Curly.Cur; ++ end if; ++ ++ if Match (Cc.Next) then ++ return True; ++ end if; ++ ++ if Current_Curly /= null then ++ Current_Curly.Cur := Ln; ++ end if; ++ ++ Current_Curly := Cc; ++ Cc.Cur := N - 1; ++ Cc.Lastloc := Lastloc; ++ return False; ++ end Match_Whilem; ++ ++ ------------ ++ -- Repeat -- ++ ------------ ++ ++ function Repeat ++ (IP : Pointer; ++ Max : Natural := Natural'Last) ++ return Natural ++ is ++ Scan : Natural := Input_Pos; ++ Last : Natural; ++ Op : constant Opcode := Opcode'Val (Character'Pos (Program (IP))); ++ Count : Natural; ++ C : Character; ++ Is_First : Boolean := True; ++ Bitmap : Character_Class; ++ ++ begin ++ if Max = Natural'Last or else Scan + Max - 1 > Last_In_Data then ++ Last := Last_In_Data; ++ else ++ Last := Scan + Max - 1; ++ end if; ++ ++ case Op is ++ when ANY => ++ while Scan <= Last ++ and then Data (Scan) /= ASCII.LF ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when SANY => ++ Scan := Last + 1; ++ ++ when EXACT => ++ ++ -- The string has only one character if Repeat was called ++ ++ C := Program (String_Operand (IP)); ++ while Scan <= Last ++ and then C = Data (Scan) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when EXACTF => ++ ++ -- The string has only one character if Repeat was called ++ ++ C := Program (String_Operand (IP)); ++ while Scan <= Last ++ and then To_Lower (C) = Data (Scan) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when ANYOF => ++ if Is_First then ++ Bitmap_Operand (Program, IP, Bitmap); ++ Is_First := False; ++ end if; ++ ++ while Scan <= Last ++ and then Get_From_Class (Bitmap, Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when ALNUM => ++ while Scan <= Last ++ and then Is_Alnum (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when NALNUM => ++ while Scan <= Last ++ and then not Is_Alnum (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when SPACE => ++ while Scan <= Last ++ and then Is_White_Space (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when NSPACE => ++ while Scan <= Last ++ and then not Is_White_Space (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when DIGIT => ++ while Scan <= Last ++ and then Is_Digit (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when NDIGIT => ++ while Scan <= Last ++ and then not Is_Digit (Data (Scan)) ++ loop ++ Scan := Scan + 1; ++ end loop; ++ ++ when others => ++ raise Program_Error; ++ end case; ++ ++ Count := Scan - Input_Pos; ++ Input_Pos := Scan; ++ return Count; ++ end Repeat; ++ ++ --------- ++ -- Try -- ++ --------- ++ ++ function Try (Pos : in Positive) return Boolean is ++ begin ++ Input_Pos := Pos; ++ Last_Paren := 0; ++ Matches_Full := (others => No_Match); ++ ++ if Match (Program_First + 1) then ++ Matches_Full (0) := (Pos, Input_Pos - 1); ++ return True; ++ end if; ++ ++ return False; ++ end Try; ++ ++ -- Start of processing for Match ++ ++ begin ++ -- Do we have the regexp Never_Match? ++ ++ if Self.Size = 0 then ++ Matches (0) := No_Match; ++ return; ++ end if; ++ ++ -- Check validity of program ++ ++ pragma Assert ++ (Program (Program_First) = MAGIC, ++ "Corrupted Pattern_Matcher"); ++ ++ -- If there is a "must appear" string, look for it ++ ++ if Self.Must_Have_Length > 0 then ++ declare ++ First : constant Character := Program (Self.Must_Have); ++ Must_First : constant Pointer := Self.Must_Have; ++ Must_Last : constant Pointer := ++ Must_First + Pointer (Self.Must_Have_Length - 1); ++ Next_Try : Natural := Index (First_In_Data, First); ++ ++ begin ++ while Next_Try /= 0 ++ and then Data (Next_Try .. Next_Try + Self.Must_Have_Length - 1) ++ = String (Program (Must_First .. Must_Last)) ++ loop ++ Next_Try := Index (Next_Try + 1, First); ++ end loop; ++ ++ if Next_Try = 0 then ++ Matches_Full := (others => No_Match); ++ return; -- Not present ++ end if; ++ end; ++ end if; ++ ++ -- Mark beginning of line for ^ ++ ++ BOL_Pos := Data'First; ++ ++ -- Simplest case first: an anchored match need be tried only once ++ ++ if Self.Anchored and then (Self.Flags and Multiple_Lines) = 0 then ++ Matched := Try (First_In_Data); ++ ++ elsif Self.Anchored then ++ declare ++ Next_Try : Natural := First_In_Data; ++ begin ++ -- Test the first position in the buffer ++ Matched := Try (Next_Try); ++ ++ -- Else only test after newlines ++ ++ if not Matched then ++ while Next_Try <= Last_In_Data loop ++ while Next_Try <= Last_In_Data ++ and then Data (Next_Try) /= ASCII.LF ++ loop ++ Next_Try := Next_Try + 1; ++ end loop; ++ ++ Next_Try := Next_Try + 1; ++ ++ if Next_Try <= Last_In_Data then ++ Matched := Try (Next_Try); ++ exit when Matched; ++ end if; ++ end loop; ++ end if; ++ end; ++ ++ elsif Self.First /= ASCII.NUL then ++ -- We know what char it must start with ++ ++ declare ++ Next_Try : Natural := Index (First_In_Data, Self.First); ++ ++ begin ++ while Next_Try /= 0 loop ++ Matched := Try (Next_Try); ++ exit when Matched; ++ Next_Try := Index (Next_Try + 1, Self.First); ++ end loop; ++ end; ++ ++ else ++ -- Messy cases: try all locations (including for the empty string) ++ ++ Matched := Try (First_In_Data); ++ ++ if not Matched then ++ for S in First_In_Data + 1 .. Last_In_Data loop ++ Matched := Try (S); ++ exit when Matched; ++ end loop; ++ end if; ++ end if; ++ ++ -- Matched has its value ++ ++ for J in Last_Paren + 1 .. Matches'Last loop ++ Matches_Full (J) := No_Match; ++ end loop; ++ ++ Matches := Matches_Full (Matches'Range); ++ return; ++ end Match; ++ ++ function Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Natural ++ is ++ Matches : Match_Array (0 .. 0); ++ ++ begin ++ Match (Self, Data, Matches, Data_First, Data_Last); ++ if Matches (0) = No_Match then ++ return Data'First - 1; ++ else ++ return Matches (0).First; ++ end if; ++ end Match; ++ ++ procedure Match ++ (Expression : String; ++ Data : String; ++ Matches : out Match_Array; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ is ++ PM : Pattern_Matcher (Size); ++ Finalize_Size : Program_Size; ++ ++ begin ++ if Size = 0 then ++ Match (Compile (Expression), Data, Matches, Data_First, Data_Last); ++ else ++ Compile (PM, Expression, Finalize_Size); ++ Match (PM, Data, Matches, Data_First, Data_Last); ++ end if; ++ end Match; ++ ++ function Match ++ (Expression : String; ++ Data : String; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Natural ++ is ++ PM : Pattern_Matcher (Size); ++ Final_Size : Program_Size; -- unused ++ ++ begin ++ if Size = 0 then ++ return Match (Compile (Expression), Data, Data_First, Data_Last); ++ else ++ Compile (PM, Expression, Final_Size); ++ return Match (PM, Data, Data_First, Data_Last); ++ end if; ++ end Match; ++ ++ function Match ++ (Expression : String; ++ Data : String; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Boolean ++ is ++ Matches : Match_Array (0 .. 0); ++ PM : Pattern_Matcher (Size); ++ Final_Size : Program_Size; -- unused ++ ++ begin ++ if Size = 0 then ++ Match (Compile (Expression), Data, Matches, Data_First, Data_Last); ++ else ++ Compile (PM, Expression, Final_Size); ++ Match (PM, Data, Matches, Data_First, Data_Last); ++ end if; ++ ++ return Matches (0).First >= Data'First; ++ end Match; ++ ++ ------------- ++ -- Operand -- ++ ------------- ++ ++ function Operand (P : Pointer) return Pointer is ++ begin ++ return P + 3; ++ end Operand; ++ ++ ------------------ ++ -- Read_Natural -- ++ ------------------ ++ ++ function Read_Natural ++ (Program : Program_Data; ++ IP : Pointer) ++ return Natural ++ is ++ begin ++ return Character'Pos (Program (IP)) + ++ 256 * Character'Pos (Program (IP + 1)); ++ end Read_Natural; ++ ++ ------------------- ++ -- String_Length -- ++ ------------------- ++ ++ function String_Length ++ (Program : Program_Data; ++ P : Pointer) ++ return Program_Size ++ is ++ begin ++ pragma Assert (Program (P) = EXACT or else Program (P) = EXACTF); ++ return Character'Pos (Program (P + 3)); ++ end String_Length; ++ ++ -------------------- ++ -- String_Operand -- ++ -------------------- ++ ++ function String_Operand (P : Pointer) return Pointer is ++ begin ++ return P + 4; ++ end String_Operand; ++ ++ ----------- ++ -- Match -- ++ ----------- ++ ++ function Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) return Boolean ++ is ++ Matches : Match_Array (0 .. 0); ++ ++ begin ++ Match (Self, Data, Matches, Data_First, Data_Last); ++ return Matches (0).First >= Data'First; ++ end Match; ++ ++end GNAT.Regpat.Extra; +--- gnat_src/g-regext.ads~ ++++ gnat_src/g-regext.ads 2005-01-24 07:53:35.000000000 +0100 +@@ -0,0 +1,107 @@ ++package GNAT.Regpat.Extra is ++ procedure Match ++ (Expression : String; ++ Data : String; ++ Matches : out Match_Array; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last); ++ -- Match Expression against Data (Data_First .. Data_Last) and store ++ -- result in Matches. ++ -- ++ -- Data_First defaults to Data'First if unspecified (that is the ++ -- dummy value of -1 is interpreted to mean Data'First). ++ -- ++ -- Data_Last defaults to Data'Last if unspecified (that is the ++ -- dummy value of Positive'Last is interpreted to mean Data'Last) ++ -- ++ -- It is important that Data contains the whole string (or file) you ++ -- want to matched against, even if you start in the middle, since ++ -- otherwise regular expressions starting with "^" or ending with "$" will ++ -- be improperly processed. ++ -- ++ -- Function raises Storage_Error if Size is too small for Expression, ++ -- or Expression_Error if Expression is not a legal regular expression. ++ -- If Size is 0, then the appropriate size is automatically calculated ++ -- by this package, but this is slightly slower. ++ -- ++ -- At most Matches'Length parenthesis are returned. ++ ++ ++ function Match ++ (Expression : String; ++ Data : String; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Natural; ++ -- Return the position where Data matches, or (Data'First - 1) if ++ -- there is no match. ++ -- ++ -- Function raises Storage_Error if Size is too small for Expression ++ -- or Expression_Error if Expression is not a legal regular expression ++ -- ++ -- If Size is 0, then the appropriate size is automatically calculated ++ -- by this package, but this is slightly slower. ++ -- See description of Data_First and Data_Last above. ++ ++ function Match ++ (Expression : String; ++ Data : String; ++ Size : Program_Size := 0; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Boolean; ++ -- Return True if Data matches Expression. Match raises Storage_Error ++ -- if Size is too small for Expression, or Expression_Error if Expression ++ -- is not a legal regular expression. ++ -- ++ -- If Size is 0, then the appropriate size is automatically calculated ++ -- by this package, but this is slightly slower. ++ -- ++ -- See description of Data_First and Data_Last above. ++ ++ ------------------------------------------------ ++ -- Matching a pre-compiled regular expression -- ++ ------------------------------------------------ ++ ++ -- The following functions are significantly faster if you need to reuse ++ -- the same regular expression multiple times, since you only have to ++ -- compile it once. ++ ++ function Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) ++ return Natural; ++ -- Return the position where Data matches, or (Data'First - 1) if there is ++ -- no match. Raises Expression_Error if Expression is not a legal regular ++ -- expression. ++ -- ++ -- See description of Data_First and Data_Last above. ++ ++ pragma Inline (Match); ++ -- All except the last one below. ++ ++ procedure Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Matches : out Match_Array; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last); ++ -- Match Data using the given pattern matcher and store result in Matches. ++ -- Raises Expression_Error if Expression is not a legal regular expression. ++ -- The expression matches if Matches (0) /= No_Match. ++ -- ++ -- At most Matches'Length parenthesis are returned. ++ -- ++ -- See description of Data_First and Data_Last above. ++ ++ function Match ++ (Self : Pattern_Matcher; ++ Data : String; ++ Data_First : Integer := -1; ++ Data_Last : Positive := Positive'Last) return Boolean; ++ -- Return True if Data matches using the given pattern matcher. ++end GNAT.Regpat.Extra; --- gnat-gps-2.1.0.orig/debian/04-command-names.patch +++ gnat-gps-2.1.0/debian/04-command-names.patch @@ -0,0 +1,58 @@ +Use external commands in the Debian paths. + +--- cpp_module/src/cpp_parser.adb~ 2004-10-27 10:20:12.000000000 +0200 ++++ cpp_module/src/cpp_parser.adb 2005-01-17 08:26:21.000000000 +0100 +@@ -51,8 +51,8 @@ + Me : constant Debug_Handle := Create ("CPP"); + + Xref_Suffix : constant String := ".xref"; +- DBIMP : constant String := "dbimp"; -- SN database engine +- CBrowser : constant String := "cbrowser"; -- SN C and C++ parser ++ DBIMP : constant String := "/usr/lib/gps/dbimp"; -- SN database engine ++ CBrowser : constant String := "/usr/lib/gps/cbrowser"; -- SN C and C++ parser + + Unresolved : constant E_Kind := + (Entities.Unresolved_Entity, +--- glide/src/gpslink.adb~ ++++ glide/src/gpslink.adb 2005-01-23 16:51:32.000000000 +0100 +@@ -33,5 +33,5 @@ + -- versions of GNAT when building GPS. + + Args (Args'Last) := new String'("../../common/obj/libcommon.a"); +- return Spawn (Locate_Exec_On_Path ("gcc").all, Args); ++ return Spawn (Locate_Exec_On_Path ("gnatgcc").all, Args); + end GPSLink; +--- gvd/glide/gvd_module.adb~ ++++ gvd/glide/gvd_module.adb +@@ -1513,7 +1514,7 @@ + GNAT.OS_Lib.Argument_String_To_List + (Get_Attribute_Value + (Get_Project (K), Debugger_Command_Attribute, +- Default => "gdb")); ++ Default => "gnatgdb")); + + begin + Proxy := new GPS_Proxy; +--- gvd/gvd/debugger-gdb.adb~ ++++ gvd/gvd/debugger-gdb.adb +@@ -73,7 +73,7 @@ + Prompt_Length : constant := 6; + -- Length of the prompt ("(gdb) "). + +- Gdb_Command : constant String := "gdb"; ++ Gdb_Command : constant String := "gnatdb"; + -- Name of the command to launch gdb. + + Gdb_Options : constant String := "-nw -q"; +--- share/customize/projects.xml~ 2004-11-29 14:45:06.000000000 +0100 ++++ share/customize/projects.xml 2005-01-18 07:40:10.000000000 +0100 +@@ -80,7 +80,8 @@ + description="The application to use when debugging applications. Only gdb and its variants are currently supported by GPS" + hide_in="wizard" + label="Debugger"> +- gdb ++ gnatgdb ++ gdb + powerpc-wrs-vxworks-gdb + powerpc-wrs-vxworksae-gdb + powerpc-elf-gdb --- gnat-gps-2.1.0.orig/debian/02-use-libgnat-extras.patch +++ gnat-gps-2.1.0/debian/02-use-libgnat-extras.patch @@ -0,0 +1,1931 @@ +This patch changes the sources of GPS so that it uses the GNAT +run-time library provided by gnat 3.15p. The upstream sources require +GCC >= 3.4 or GNAT Pro. See README.Debian for more information. + +-- +Ludovic Brenta. + +--- action_editor/src/action_editor.adb~ ++++ action_editor/src/action_editor.adb 2005-01-20 08:44:04.000000000 +0100 +@@ -322,6 +322,7 @@ + Free (Comp_Iter); + end Add_Components; + ++ use type GNAT.OS_Lib.String_Access; + begin + Dialog := new Action_Editor_Dialog_Record; + Dialog.Action := Action; +@@ -514,7 +515,7 @@ + begin + Action.Modified := True; + +- Free (Action.Description); ++ GNAT.OS_Lib.Free (Action.Description); + + Get_Start_Iter (Dialog.Description, Start_Iter); + Get_End_Iter (Dialog.Description, End_Iter); +@@ -793,7 +794,7 @@ + Filename : constant String := + Get_Home_Dir (Module.Kernel) & "actions.xml"; + Tree : Node_Ptr; +- Error : String_Access; ++ Error : GNAT.OS_Lib.String_Access; + Action : Action_Record_Access; + Action_Iter : Action_Iterator := Start (Module.Kernel); + Child : Node_Ptr; +@@ -805,7 +806,7 @@ + + if GNAT.OS_Lib.Is_Regular_File (Filename) then + Parse (Filename, Tree, Error); +- Free (Error); ++ GNAT.OS_Lib.Free (Error); + end if; + + if Tree = null then +@@ -862,7 +863,7 @@ + Filename : constant String := + Get_Home_Dir (Kernel) & "actions.xml"; + Tree : Node_Ptr; +- Err : String_Access; ++ Err : GNAT.OS_Lib.String_Access; + begin + Action_Editor_Module := new Action_Editor_Module_Record; + Action_Editor_Module.Kernel := Kernel_Handle (Kernel); +@@ -887,7 +888,7 @@ + Free (Tree); + else + Insert (Kernel, Err.all, Mode => Glide_Kernel.Console.Error); +- Free (Err); ++ GNAT.OS_Lib.Free (Err); + end if; + end if; + end Register_Module; +--- browsers/src/browsers-canvas.adb~ ++++ browsers/src/browsers-canvas.adb 2005-01-21 08:17:56.000000000 +0100 +@@ -54,6 +54,8 @@ + with Ada.Exceptions; use Ada.Exceptions; + with Ada.Unchecked_Deallocation; + with GNAT.Strings; use GNAT.Strings; ++with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + with Gtkada.Canvas; use Gtkada.Canvas; + with Gtkada.Handlers; use Gtkada.Handlers; +@@ -1814,7 +1816,7 @@ + begin + if List.Lines /= null then + for L in List.Lines'Range loop +- Free (List.Lines (L).Text); ++ GNAT.OS_Lib.Free (List.Lines (L).Text); + + for C in List.Lines (L).Callbacks'Range loop + -- Do not actually destroy, since these are still used in the +@@ -1919,7 +1921,7 @@ + Callbacks => new Active_Area_Cb_Array' + (Tmp.Callbacks.all & Callback), + Length => Tmp.Length); +- Free (Tmp.Text); ++ GNAT.OS_Lib.Free (Tmp.Text); + Unchecked_Free (Tmp.Callbacks); + end if; + end Expand_Line; +@@ -1941,7 +1943,7 @@ + Longest1, Longest2 : Gint := 0; + H2, W : Gint; + Last : Natural; +- Line : GNAT.Strings.String_Access; ++ Line : GNAT.OS_Lib.String_Access; + + begin + H := 0; +@@ -2020,7 +2022,7 @@ + GC : Gdk_GC; + W, H : Gint; + Num_In_Line : Natural; +- Text : String_Access; ++ Text : GNAT.OS_Lib.String_Access; + + procedure Display (Text : String; Line : Xref_Line); + -- Display Text on Item. +--- cpp_module/src/cpp_parser.adb~ ++++ cpp_module/src/cpp_parser.adb 2005-01-21 08:26:49.000000000 +0100 +@@ -30,6 +30,7 @@ + with DB_API; use DB_API; + with Projects; use Projects; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with Ada.Exceptions; use Ada.Exceptions; + with Ada.Calendar; use Ada.Calendar; +@@ -2902,7 +2903,7 @@ + DBIMP_Path => Iterator.Handler.DBIMP_Path.all, + Temp_Name => Iterator.Tmp_Filename, + PD => Iterator.PD); +- Free (DB_Dirs); ++ GNAT.OS_Lib.Extra.Free (DB_Dirs); + + when Process_Xrefs => + if Iterator.Process_Running then +--- custom/src/expect_interface.adb~ ++++ custom/src/expect_interface.adb 2005-01-21 08:30:27.000000000 +0100 +@@ -19,7 +19,9 @@ + ----------------------------------------------------------------------- + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Regpat; use GNAT.Regpat; ++with GNAT.Regpat.Extra; + with GNAT.Expect; use GNAT.Expect; + with System; + with Ada.Unchecked_Conversion; +@@ -120,7 +122,7 @@ + + procedure Free (X : in out Custom_Action_Record) is + begin +- Free (X.Command); ++ GNAT.OS_Lib.Extra.Free (X.Command); + Unchecked_Free (X.Pattern); + Free (X.Unmatched_Output); + Free (X.Processed_Output); +@@ -273,7 +275,7 @@ + + loop + Action_To_Execute := D.On_Match; +- Match ++ GNAT.Regpat.Extra.Match + (D.Pattern.all, + D.Unmatched_Output.all, + Matches, +--- glide/src/ssh_protocol.adb~ ++++ glide/src/ssh_protocol.adb +@@ -22,6 +22,7 @@ + with Gtk.Enums; use Gtk.Enums; + with Remote_Connections; use Remote_Connections; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.Expect; use GNAT.Expect; + with GNAT.Regpat; use GNAT.Regpat; +@@ -438,7 +439,7 @@ + Add_Filter (Fd, Trace_Filter_Input'Access, Input); + end if; + +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + + if Is_Interactive_Shell + and then not Connection.Commands.Has_Shell_Prompt +--- glide/src/welcome.adb~ ++++ glide/src/welcome.adb +@@ -49,6 +49,7 @@ + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Projects; use Projects; + with Traces; use Traces; + with Ada.Exceptions; use Ada.Exceptions; +@@ -204,7 +205,8 @@ + + if Project_Name /= "" then + Set_Text (Get_Entry (Screen.Open_Project), +- Normalize_Pathname (Project_Name, Resolve_Links => False)); ++ GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Project_Name, Resolve_Links => False)); + end if; + + Gtk_New (Screen.Open_Browse, -"Browse"); +@@ -347,7 +349,8 @@ + return Boolean + is + S : constant Welcome_Screen := Welcome_Screen (Screen); +- Project_Name : constant String := Normalize_Pathname ++ Project_Name : constant String := ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Get_Text (Get_Entry (S.Open_Project)), Resolve_Links => False); + Button : Message_Dialog_Buttons; + pragma Unreferenced (Button); +--- gnat_src/fmap.adb~ ++++ gnat_src/fmap.adb +@@ -25,6 +25,7 @@ + ------------------------------------------------------------------------------ + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Namet; use Namet; + with Opt; use Opt; + with Osint; use Osint; +@@ -523,7 +524,7 @@ + Fail ("disk full"); + end if; + +- Close (File, Status); ++ GNAT.OS_Lib.Extra.Close (File, Status); + + if not Status then + Fail ("disk full"); +--- gnat_src/mlib.adb~ ++++ gnat_src/mlib.adb 2005-01-23 15:33:07.000000000 +0100 +@@ -36,6 +36,7 @@ + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + package body MLib is + +@@ -131,11 +132,11 @@ + + for Index in Files'Range loop + Verbose_Copy (Index); +- Copy_File ++ GNAT.OS_Lib.Extra.Copy_File + (Files (Index).all, + To_Dir, + Success, +- Mode => Overwrite, ++ Mode => GNAT.OS_Lib.Extra.Overwrite, + Preserve => Preserve); + + exit when not Success; +@@ -208,7 +209,7 @@ + + -- We are done with the input file, so we close it + +- Close (FD, Status); ++ GNAT.OS_Lib.Extra.Close (FD, Status); + -- We simply ignore any bad status + + P_Line_Found := False; +@@ -251,7 +252,7 @@ + if FD /= Invalid_FD then + Actual_Len := Write (FD, S (1)'Address, Len + 3); + +- Close (FD, Status); ++ GNAT.OS_Lib.Extra.Close (FD, Status); + + -- Set Success to True only if the newly + -- created file has been correctly written. +@@ -259,8 +260,8 @@ + Success := Status and Actual_Len = Len + 3; + + if Success then +- Set_Read_Only ( +- Name_Buffer (1 .. Name_Len - 1)); ++ GNAT.OS_Lib.Extra.Set_Read_Only ++ (Name_Buffer (1 .. Name_Len - 1)); + end if; + end if; + end if; +@@ -310,6 +311,6 @@ + -- Copy_Attributes always fails on VMS + + if Hostparm.OpenVMS then +- Preserve := None; ++ Preserve := GNAT.OS_Lib.Extra.None; + end if; + end MLib; +--- gnat_src/mlib.ads~ ++++ gnat_src/mlib.ads +@@ -28,6 +28,7 @@ + -- and GNATMAKE to build libraries + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Osint; use Osint; + with Types; use Types; + +@@ -67,7 +68,7 @@ + + private + +- Preserve : Attribute := Time_Stamps; ++ Preserve : GNAT.OS_Lib.Extra.Attribute := GNAT.OS_Lib.Extra.Time_Stamps; + -- Used by Copy_ALI_Files. Changed to None for OpenVMS, because + -- Copy_Attributes always fails on VMS. + +--- gnat_src/osint.adb~ ++++ gnat_src/osint.adb +@@ -38,6 +38,7 @@ + with Unchecked_Conversion; + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.HTable; + + package body Osint is +@@ -343,7 +344,7 @@ + + -- We are done with the file, so we close it + +- Close (File_FD, Status); ++ GNAT.OS_Lib.Extra.Close (File_FD, Status); + -- We ignore any error here, because we have successfully read the + -- file. + +@@ -2041,14 +2042,14 @@ + + elsif Fatal_Err then + Get_Name_String (Current_Full_Obj_Name); +- Close (Lib_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Lib_FD, Status); + -- No need to check the status, we fail anyway + + Fail ("Cannot find: ", Name_Buffer (1 .. Name_Len)); + + else + Current_Full_Obj_Stamp := Empty_Time_Stamp; +- Close (Lib_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Lib_FD, Status); + + -- No need to check the status, we return null anyway + +@@ -2094,7 +2095,7 @@ + + -- Read is complete, close file and we are done + +- Close (Lib_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Lib_FD, Status); + -- The status should never be False. But, if it is, what can we do? + -- So, we don't test it. + +@@ -2219,7 +2220,7 @@ + + -- Read is complete, get time stamp and close file and we are done + +- Close (Source_File_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Source_File_FD, Status); + + -- The status should never be False. But, if it is, what can we do? + -- So, we don't test it. +--- gnat_src/prj-env.adb~ ++++ gnat_src/prj-env.adb +@@ -34,6 +34,7 @@ + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + package body Prj.Env is + +@@ -926,7 +927,7 @@ + + -- Close the temporary file + +- GNAT.OS_Lib.Close (File, Status); ++ GNAT.OS_Lib.Extra.Close (File, Status); + + if not Status then + Prj.Com.Fail ("disk full"); +@@ -1111,7 +1112,7 @@ + end loop; + end if; + +- GNAT.OS_Lib.Close (File, Status); ++ GNAT.OS_Lib.Extra.Close (File, Status); + + if not Status then + Prj.Com.Fail ("disk full"); +@@ -2121,7 +2122,7 @@ + end if; + end loop; + +- Close (Source_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Source_FD, Status); + + if not Status then + Prj.Com.Fail ("disk full"); +@@ -2140,7 +2141,7 @@ + end if; + end loop; + +- Close (Object_FD, Status); ++ GNAT.OS_Lib.Extra.Close (Object_FD, Status); + + if not Status then + Prj.Com.Fail ("disk full"); +--- gnat_src/prj-nmsc.adb~ ++++ gnat_src/prj-nmsc.adb 2005-01-21 18:51:03.000000000 +0100 +@@ -48,7 +48,7 @@ + + with GNAT.Case_Util; use GNAT.Case_Util; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; +-with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.HTable; + + package body Prj.Nmsc is +@@ -2450,12 +2450,11 @@ + declare + File_Name : constant Name_Id := Name_Find; + Path : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Name => Name_Buffer (1 .. Name_Len), + Directory => Source_Directory + (Source_Directory'First .. Dir_Last), +- Resolve_Links => Follow_Links, +- Case_Sensitive => True); ++ Resolve_Links => Follow_Links); + Path_Name : Name_Id; + + begin +@@ -2985,7 +2984,7 @@ + Canonical_Path : Name_Id := No_Name; + + The_Path : constant String := +- Normalize_Pathname (Get_Name_String (Path)) & ++ GNAT.OS_Lib.Extra.Normalize_Pathname (Get_Name_String (Path)) & + Directory_Separator; + + The_Path_Last : constant Natural := +@@ -3084,13 +3083,12 @@ + + declare + Path_Name : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Name => Name (1 .. Last), + Directory => + The_Path + (The_Path'First .. The_Path_Last), +- Resolve_Links => False, +- Case_Sensitive => True); ++ Resolve_Links => False); + + begin + if Is_Directory (Path_Name) then +@@ -3156,12 +3154,11 @@ + declare + Base_Dir : constant Name_Id := Name_Find; + Root_Dir : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Name => Get_Name_String (Base_Dir), + Directory => + Get_Name_String (Data.Display_Directory), +- Resolve_Links => False, +- Case_Sensitive => True); ++ Resolve_Links => False); + + begin + if Root_Dir'Length = 0 then +@@ -3933,16 +3930,14 @@ + if Is_Directory (The_Name) then + declare + Normed : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (The_Name, +- Resolve_Links => False, +- Case_Sensitive => True); ++ Resolve_Links => False); + + Canonical_Path : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Normed, +- Resolve_Links => True, +- Case_Sensitive => False); ++ Resolve_Links => True); + + begin + Name_Len := Normed'Length; +@@ -3965,16 +3960,14 @@ + if Is_Directory (Full_Path) then + declare + Normed : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Full_Path, +- Resolve_Links => False, +- Case_Sensitive => True); ++ Resolve_Links => False); + + Canonical_Path : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Normed, +- Resolve_Links => True, +- Case_Sensitive => False); ++ Resolve_Links => True); + + begin + Name_Len := Normed'Length; +@@ -4439,10 +4432,9 @@ + + declare + Canonical_Path : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Get_Name_String (Path_Name), +- Resolve_Links => Follow_Links, +- Case_Sensitive => False); ++ Resolve_Links => Follow_Links); + begin + Name_Len := 0; + Add_Str_To_Name_Buffer (Canonical_Path); +--- gnat_src/prj-part.adb~ ++++ gnat_src/prj-part.adb 2005-01-21 08:42:13.000000000 +0100 +@@ -44,7 +44,7 @@ + with Ada.Exceptions; use Ada.Exceptions; + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; +-with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + with System.HTable; use System.HTable; + +@@ -703,10 +703,9 @@ + Project_Directory_Path); + + Resolved_Path : constant String := +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Imported_Path_Name, +- Resolve_Links => True, +- Case_Sensitive => True); ++ Resolve_Links => True); + + Withed_Project : Project_Node_Id := Empty_Node; + +@@ -869,12 +868,12 @@ + Extends_All := False; + + declare +- Normed_Path : constant String := Normalize_Pathname +- (Path_Name, Resolve_Links => False, +- Case_Sensitive => True); +- Canonical_Path : constant String := Normalize_Pathname +- (Normed_Path, Resolve_Links => True, +- Case_Sensitive => False); ++ Normed_Path : constant String := ++ GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Path_Name, Resolve_Links => False); ++ Canonical_Path : constant String := ++ GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Normed_Path, Resolve_Links => True); + + begin + Name_Len := Normed_Path'Length; +@@ -1679,10 +1678,9 @@ + else + declare + Final_Result : constant String := +- GNAT.OS_Lib.Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Result.all, +- Resolve_Links => False, +- Case_Sensitive => True); ++ Resolve_Links => False); + begin + Free (Result); + return Final_Result; +--- gnat_src/tempdir.adb~ ++++ gnat_src/tempdir.adb +@@ -25,6 +25,7 @@ + ------------------------------------------------------------------------------ + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; ++with GNAT.OS_Lib.Extra; + + with Namet; use Namet; + with Opt; use Opt; +@@ -82,11 +83,11 @@ + -- then change back immediately to the previous directory. + + Change_Dir (Temp_Dir.all); +- Create_Temp_File (FD, File_Name); ++ GNAT.OS_Lib.Extra.Create_Temp_File (FD, File_Name); + Change_Dir (Current_Dir); + + else +- Create_Temp_File (FD, File_Name); ++ GNAT.OS_Lib.Extra.Create_Temp_File (FD, File_Name); + end if; + + if FD = Invalid_FD then +--- gvd/common/file_utils.adb~ ++++ gvd/common/file_utils.adb +@@ -23,6 +23,7 @@ + with Ada.Strings.Fixed; use Ada.Strings.Fixed; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with String_Utils; use String_Utils; + with OS_Utils; use OS_Utils; + with VFS; use VFS; +@@ -333,9 +334,11 @@ + (File_Name : String; Base_Name : String) return String + is + Base : constant String := Name_As_Directory +- (Normalize_Pathname (Base_Name, Resolve_Links => False)); ++ (GNAT.OS_Lib.Extra.Normalize_Pathname (Base_Name, ++ Resolve_Links => False)); + File : constant String := +- Normalize_Pathname (File_Name, Resolve_Links => False); ++ GNAT.OS_Lib.Extra.Normalize_Pathname (File_Name, ++ Resolve_Links => False); + Level : Natural := 0; + Base_End : Natural := Base'Last; + Length : Natural; +@@ -454,7 +454,7 @@ + begin + GM_Split (T, Year, Month, Day, Hour, Minute, Second); + +- if T = Invalid_Time then ++ if T = GNAT.OS_Lib.Extra.Invalid_Time then + return No_Time; + end if; + +--- gvd/common/histories.adb~ ++++ gvd/common/histories.adb +@@ -21,6 +21,7 @@ + with Ada.Text_IO; use Ada.Text_IO; + with Glib; use Glib; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Gtk.Check_Menu_Item; use Gtk.Check_Menu_Item; + with Gtk.Combo; use Gtk.Combo; + with Gtk.GEntry; use Gtk.GEntry; +@@ -337,7 +338,7 @@ + exit when Value = Null_History; + + case Value.Typ is +- when Strings => Free (Value.List); ++ when Strings => GNAT.OS_Lib.Extra.Free (Value.List); + when Booleans => null; + end case; + +--- gvd/common/language.adb~ ++++ gvd/common/language.adb 2005-01-21 08:11:49.000000000 +0100 +@@ -23,6 +23,7 @@ + + with Basic_Types; use Basic_Types; + with GNAT.Regpat; use GNAT.Regpat; ++with GNAT.Regpat.Extra; + with GNAT.OS_Lib; + with Odd_Intl; use Odd_Intl; + with String_Utils; use String_Utils; +@@ -202,7 +203,7 @@ + + -- Do we have a comment that ends on newline ? + +- if Match ++ if GNAT.Regpat.Extra.Match + (Context.New_Line_Comment_Start.all, + Buffer (First .. Buffer'Last)) + then +--- gvd/common/os_utils.adb~ ++++ gvd/common/os_utils.adb 2005-01-20 19:34:13.000000000 +0100 +@@ -25,6 +25,7 @@ + pragma Warnings (On); + with Interfaces.C.Strings; use Interfaces.C.Strings; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; ++with GNAT.OS_Lib.Extra; + with Glib.Convert; use Glib.Convert; + with Traces; use Traces; + +@@ -94,7 +95,7 @@ + + begin + Change_Dir (Temp_Dir); +- Create_Temp_File (Fd, Base); ++ GNAT.OS_Lib.Extra.Create_Temp_File (Fd, Base); + Close (Fd); + + declare +--- gvd/common/vfs.ads~ ++++ gvd/common/vfs.ads +@@ -25,6 +25,7 @@ + with Glib; use Glib; + with Glib.Values; + with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Ada.Finalization; + with Remote_Connections; + with Ada.Calendar; +@@ -33,12 +34,12 @@ + package VFS is + + No_Time : constant Ada.Calendar.Time := GNAT.Calendar.Time_Of +- (GNAT.OS_Lib.GM_Year (GNAT.OS_Lib.Invalid_Time), +- GNAT.OS_Lib.GM_Month (GNAT.OS_Lib.Invalid_Time), +- GNAT.OS_Lib.GM_Day (GNAT.OS_Lib.Invalid_Time), +- GNAT.OS_Lib.GM_Hour (GNAT.OS_Lib.Invalid_Time), +- GNAT.OS_Lib.GM_Minute (GNAT.OS_Lib.Invalid_Time), +- GNAT.OS_Lib.GM_Second (GNAT.OS_Lib.Invalid_Time)); ++ (GNAT.OS_Lib.GM_Year (GNAT.OS_Lib.Extra.Invalid_Time), ++ GNAT.OS_Lib.GM_Month (GNAT.OS_Lib.Extra.Invalid_Time), ++ GNAT.OS_Lib.GM_Day (GNAT.OS_Lib.Extra.Invalid_Time), ++ GNAT.OS_Lib.GM_Hour (GNAT.OS_Lib.Extra.Invalid_Time), ++ GNAT.OS_Lib.GM_Minute (GNAT.OS_Lib.Extra.Invalid_Time), ++ GNAT.OS_Lib.GM_Second (GNAT.OS_Lib.Extra.Invalid_Time)); + + subtype UTF8_String_Access is GNAT.OS_Lib.String_Access; + type Cst_UTF8_String_Access is access constant Glib.UTF8_String; +--- gvd/common/vfs.adb~ ++++ gvd/common/vfs.adb +@@ -197,7 +198,7 @@ + -- are encoded the same in UTF8 anyway. + + File.Value.Normalized_Full := new UTF8_String' +- (Normalize_Pathname ++ (GNAT.OS_Lib.Extra.Normalize_Pathname + (File.Value.Full_Name.all, + Resolve_Links => Active (Resolve_Links_Handle))); + +@@ -425,7 +426,7 @@ + Base : String_Access; + begin + Change_Dir (Temporary_Dir); +- Create_Temp_File (Fd, Base); ++ GNAT.OS_Lib.Extra.Create_Temp_File (Fd, Base); + Tmp := new String'(Name_As_Directory (Temporary_Dir) & Base.all); + Free (Base); + Change_Dir (Current_Dir); +--- gvd/glide/gvd_module.adb~ ++++ gvd/glide/gvd_module.adb +@@ -71,6 +71,7 @@ + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.Expect; + with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + with Glide_Main_Window; use Glide_Main_Window; + with Glide_Kernel; use Glide_Kernel; +@@ -363,7 +364,7 @@ + + for L in List'Range loop + declare +- Dir : constant String := GNAT.OS_Lib.Normalize_Pathname ++ Dir : constant String := GNAT.OS_Lib.Extra.Normalize_Pathname + (Dir_Name (List (L).all), + Dir_Name (Exec).all, + Resolve_Links => False); +@@ -1534,7 +1535,7 @@ + Debugger_Name => Args (1).all, + History => Get_History (K), + Success => Success); +- GNAT.OS_Lib.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + Free (Module); + + if not Success then +--- gvd/gvd/debugger.adb~ ++++ gvd/gvd/debugger.adb +@@ -24,6 +24,7 @@ + pragma Warnings (On); + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Ada.Strings; use Ada.Strings; + with Ada.Strings.Fixed; use Ada.Strings.Fixed; + with Ada.Unchecked_Deallocation; +@@ -286,7 +287,7 @@ + Free (Real_Arguments (J)); + end loop; + +- Free (Remote_Args); ++ GNAT.OS_Lib.Extra.Free (Remote_Args); + + exception + when Invalid_Process => +--- gvd/gvd/gvd-process.adb~ ++++ gvd/gvd/gvd-process.adb 2005-01-21 08:33:14.000000000 +0100 +@@ -60,7 +60,7 @@ + pragma Warnings (On); + + with GNAT.Regpat; use GNAT.Regpat; +-with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + with Odd_Intl; use Odd_Intl; + with Display_Items; use Display_Items; +@@ -682,7 +682,7 @@ + (Full_Filename => + -- ??? Normalize_Pathname only needed when to get absolute + -- file name +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Process.Current_Output (File_First .. File_Last), + Resolve_Links => False)); + begin +--- kernel/src/commands-custom.adb~ ++++ kernel/src/commands-custom.adb +@@ -55,6 +55,7 @@ + with Ada.Unchecked_Conversion; + with GNAT.Regpat; use GNAT.Regpat; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; ++with GNAT.OS_Lib.Extra; + with System; + + package body Commands.Custom is +@@ -616,7 +617,7 @@ + begin + if Execution /= null then + Free (Execution.Current_Output); +- GNAT.OS_Lib.Free (Execution.Outputs); ++ GNAT.OS_Lib.Extra.Free (Execution.Outputs); + Unchecked_Free (Execution.Save_Output); + Unchecked_Free (Execution.Progress_Matcher); + Unref (Execution.Context); +@@ -1408,7 +1408,7 @@ + Callback_Data => Convert (Custom_Command_Access (Command)), + Line_By_Line => False, + Directory => To_String (Context.Dir)); +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + + Command.Execution.External_Process_Console := Console; + Command.Execution.External_Process_In_Progress := True; +--- kernel/src/commands-external.adb~ ++++ kernel/src/commands-external.adb 2005-01-21 18:18:39.000000000 +0100 +@@ -22,6 +22,7 @@ + + with GNAT.Expect; use GNAT.Expect; + with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.Strings; + +@@ -217,6 +218,7 @@ + if Host = Windows then + declare + Exec_Command_Args : GNAT.OS_Lib.Argument_List_Access; ++ use type GNAT.OS_Lib.String_List; + begin + Exec_Command_Args := + GNAT.OS_Lib.Argument_String_To_List (Exec_Command); +@@ -233,8 +235,8 @@ + Err_To_Out => True, + Buffer_Size => 0); + +- GNAT.OS_Lib.Free (Real_Args); +- GNAT.OS_Lib.Free (Exec_Command_Args); ++ GNAT.OS_Lib.Extra.Free (Real_Args); ++ GNAT.OS_Lib.Extra.Free (Exec_Command_Args); + end; + + else +--- kernel/src/commands-interactive.adb~ ++++ kernel/src/commands-interactive.adb 2005-01-20 20:00:28.000000000 +0100 +@@ -21,6 +21,7 @@ + with Gdk.Event; use Gdk.Event; + with Glide_Intl; use Glide_Intl; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Gtk.Label; use Gtk.Label; + with Ada.Unchecked_Deallocation; + with Glib.Xml_Int; use Glib.Xml_Int; +@@ -252,7 +253,7 @@ + Free (X.Args (J)); + end loop; + +- Free (X.Args); ++ GNAT.OS_Lib.Extra.Free (X.Args); + end if; + + Free (X.Dir); +--- kernel/src/commands-locations.adb~ ++++ kernel/src/commands-locations.adb +@@ -18,6 +18,8 @@ + -- Place - Suite 330, Boston, MA 02111-1307, USA. -- + ----------------------------------------------------------------------- + ++with GNAT.OS_Lib.Extra; ++ + with Glide_Kernel.Standard_Hooks; use Glide_Kernel.Standard_Hooks; + with Glide_Kernel.Scripts; use Glide_Kernel.Scripts; + with VFS; use VFS; +@@ -82,7 +84,7 @@ + Item.Kernel := Kernel; + + if Item.Args /= null then +- Free (Item.Args); ++ GNAT.OS_Lib.Extra.Free (Item.Args); + end if; + + for J in Args'Range loop +@@ -124,7 +126,7 @@ + + procedure Free (X : in out Generic_Location_Command_Type) is + begin +- Free (X.Args); ++ GNAT.OS_Lib.Extra.Free (X.Args); + end Free; + + ------------- +--- kernel/src/glide_kernel-project.adb~ 2004-10-27 15:45:37.000000000 +0200 ++++ kernel/src/glide_kernel-project.adb 2005-01-14 08:14:36.000000000 +0100 +@@ -19,6 +19,7 @@ + ----------------------------------------------------------------------- + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + + with Projects; use Projects; +@@ -83,7 +84,7 @@ + Handle.GNAT_Version := GNAT_Version; + + Free (Path); +- Free (Gnatls_Args); ++ GNAT.OS_Lib.Extra.Free (Gnatls_Args); + + else + Insert (Handle, +@@ -92,7 +93,7 @@ + + Set_Predefined_Source_Path (Handle.Registry.all, ""); + Set_Predefined_Object_Path (Handle.Registry.all, ""); +- Free (Gnatls_Args); ++ GNAT.OS_Lib.Extra.Free (Gnatls_Args); + end if; + end if; + +@@ -127,7 +128,8 @@ + + Load_Default_Project + (Kernel.Registry.all, +- Normalize_Pathname (Directory, Resolve_Links => False)); ++ GNAT.OS_Lib.Extra.Normalize_Pathname (Directory, ++ Resolve_Links => False)); + + -- For all registered tool that contain default switches, set these up + +@@ -150,7 +152,7 @@ + (Prop.Project_Package.all, Prop.Project_Attribute.all), + Values => Switches.all, + Attribute_Index => Prop.Project_Index.all); +- Free (Switches); ++ GNAT.OS_Lib.Extra.Free (Switches); + end; + end if; + +@@ -460,7 +460,7 @@ + Project => Prj.No_Project, + Default => True, + Values => L); +- Free (Cmd); ++ GNAT.OS_Lib.Extra.Free (Cmd); + end; + end if; + end if; +--- kernel/src/glide_kernel-timeout.adb~ ++++ kernel/src/glide_kernel-timeout.adb 2005-01-20 19:28:32.000000000 +0100 +@@ -33,6 +33,7 @@ + with GNAT.Regpat; use GNAT.Regpat; + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Ada.Exceptions; use Ada.Exceptions; + with Ada.Unchecked_Conversion; + +@@ -313,8 +314,8 @@ + & Arguments, + Err_To_Out => True); + +- GNAT.OS_Lib.Free (Real_Args); +- GNAT.OS_Lib.Free (Exec_Command_Args); ++ GNAT.OS_Lib.Extra.Free (Real_Args); ++ GNAT.OS_Lib.Extra.Free (Exec_Command_Args); + end; + else + Non_Blocking_Spawn +--- kernel/src_info/entities.adb~ ++++ kernel/src_info/entities.adb 2005-01-20 19:13:28.000000000 +0100 +@@ -22,6 +22,7 @@ + with Ada.Unchecked_Deallocation; + with VFS; use VFS; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Projects; use Projects; + with Traces; use Traces; + with Language_Handlers.Glide; use Language_Handlers.Glide; +@@ -1151,7 +1152,8 @@ + VFS.No_File, LI, Timestamp, Allow_Create); + else + declare +- Str : aliased constant String := Normalize_Pathname ++ Str : aliased constant String := ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Full_Filename, Resolve_Links => False); + begin + return Internal_Get_Or_Create +--- kernel/src_info/entities-debug.adb~ ++++ kernel/src_info/entities-debug.adb 2005-01-21 08:20:29.000000000 +0100 +@@ -22,7 +22,6 @@ + with GNAT.Calendar; use GNAT.Calendar; + with String_Utils; use String_Utils; + with VFS; use VFS; +-with GNAT.Strings; use GNAT.Strings; + with GNAT.Bubble_Sort; use GNAT.Bubble_Sort; + with Traces; use Traces; + +@@ -351,6 +350,7 @@ + + procedure Dump + (Entity : Entity_Information; Full : Boolean; Name : String) is ++ use type GNAT.OS_Lib.String_Access; + begin + if Entity /= null then + if not Full and then Name /= "" then +--- kernel/src_info/sn_wrapper/sn-browse.adb~ ++++ kernel/src_info/sn_wrapper/sn-browse.adb + 2005-01-21 18:44:11.000000000 +0100 +@@ -32,6 +32,7 @@ + with Traces; use Traces; + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + package body SN.Browse is + +@@ -161,7 +162,7 @@ + Trace (Me, "Spawn: " & DBIMP_Path + & " " & Argument_List_To_String (Args.all)); + Non_Blocking_Spawn (PD, DBIMP_Path, Args.all, Err_To_Out => True); +- GNAT.OS_Lib.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Generate_Xrefs; + + -------------- +--- kernel/src_info/projects-editor.adb~ ++++ kernel/src_info/projects-editor.adb +@@ -23,6 +23,7 @@ + with Glide_Intl; use Glide_Intl; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Namet; use Namet; + with Prj.Attr; use Prj.Attr; + with Prj.Com; use Prj.Com; +@@ -2742,7 +2743,7 @@ + (Imported_Project_Location, Project_File_Extension); + Dep_ID : Name_Id; + Dep_Name : Prj.Tree.Tree_Private_Part.Project_Name_And_Node; +- Imported : constant String := Normalize_Pathname ++ Imported : constant String := GNAT.OS_Lib.Extra.Normalize_Pathname + (Name => Imported_Project_Location, + Resolve_Links => True); + +@@ -2979,7 +2980,7 @@ + Set_String_Value_Of + (Node, + Get_String (Relative_Path_Name +- (Normalize_Pathname ++ (GNAT.OS_Lib.Extra.Normalize_Pathname + (D, Old_Path, Resolve_Links => False), + New_Path))); + end if; +--- kernel/src_info/projects-registry.adb~ ++++ kernel/src_info/projects-registry.adb 2005-01-23 22:55:21.000000000 +0100 +@@ -31,6 +31,7 @@ + with String_Utils; use String_Utils; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Case_Util; use GNAT.Case_Util; + pragma Warnings (Off); + with GNAT.Expect.TTY; use GNAT.Expect, GNAT.Expect.TTY; +@@ -404,7 +405,8 @@ + end Extension; + + begin +- return Normalize_Pathname (Path, Resolve_Links => False) & Extension; ++ return GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Path, Resolve_Links => False) & Extension; + end Normalize_Project_Path; + + ---------- +@@ -1664,7 +1666,8 @@ + if Is_Absolute_Path (Filename) then + declare + S : constant String := Locale_To_UTF8 +- (Normalize_Pathname (Locale, Resolve_Links => False)); ++ (GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Locale, Resolve_Links => False)); + begin + Name_Len := S'Length; + Name_Buffer (1 .. Name_Len) := S; +@@ -1763,7 +1766,7 @@ + if Path /= null then + declare + Full : constant String := Locale_To_UTF8 +- (Normalize_Pathname ++ (GNAT.OS_Lib.Extra.Normalize_Pathname + (Path.all, Resolve_Links => False)); + begin + Free (Path); +@@ -1866,8 +1869,9 @@ + -- for files opened from the command line. + return Create + (Full_Filename => Locale_To_UTF8 +- (Normalize_Pathname (Locale_From_UTF8 (Name), +- Resolve_Links => False))); ++ (GNAT.OS_Lib.Extra.Normalize_Pathname ++ (Locale_From_UTF8 (Name), ++ Resolve_Links => False))); + end if; + end Create; + +--- prj_editor/src/project_explorers.adb~ ++++ prj_editor/src/project_explorers.adb 2005-01-23 18:57:23.000000000 +0100 +@@ -19,6 +19,7 @@ + ----------------------------------------------------------------------- + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with Ada.Exceptions; use Ada.Exceptions; + +@@ -1645,7 +1646,7 @@ + Index : Natural; + N, N2 : Gtk_Tree_Iter; + Dir : constant String := Name_As_Directory +- (Normalize_Pathname ++ (GNAT.OS_Lib.Extra.Normalize_Pathname + (Get_Directory_From_Node (Explorer.Tree.Model, Node), + Resolve_Links => False)); + +--- prj_editor/src/project_properties.adb~ ++++ prj_editor/src/project_properties.adb 2005-01-20 19:42:47.000000000 +0100 +@@ -34,6 +34,7 @@ + with Glide_Kernel; use Glide_Kernel; + with Glide_Kernel.Standard_Hooks; use Glide_Kernel.Standard_Hooks; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Gtk.Box; use Gtk.Box; + with Gtk.Check_Button; use Gtk.Check_Button; + with Gtkada.Dialogs; use Gtkada.Dialogs; +@@ -613,7 +614,7 @@ + if Ed.Current_Values /= null then + for C in Ed.Current_Values'Range loop + Free (Ed.Current_Values (C).Index); +- Free (Ed.Current_Values (C).Values); ++ GNAT.OS_Lib.Extra.Free (Ed.Current_Values (C).Values); + end loop; + Unchecked_Free (Ed.Current_Values); + end if; +@@ -1927,7 +1928,7 @@ + if Value /= "" then + Append (Ed.Model, Iter, Null_Iter); + if Ed.As_Directory then +- Set (Ed.Model, Iter, 0, Normalize_Pathname ++ Set (Ed.Model, Iter, 0, GNAT.OS_Lib.Extra.Normalize_Pathname + (Value, + Directory => Get_Text (Ed.Path_Widget), + Resolve_Links => False)); +@@ -2087,7 +2088,7 @@ + Iter := Get_Iter_First (Ed.Model); + while Iter /= Null_Iter loop + Set (Ed.Model, Iter, 0, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Get_String (Ed.Model, Iter, 2), + Directory => Directory, + Resolve_Links => False)); +@@ -2218,7 +2219,7 @@ + Value (V) (Value (V)'Last - 2 .. Value (V)'Last) = "/**" + then + Set (Editor.Model, Iter, 0, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Value (V) (Value (V)'First .. Value (V)'Last - 3), + Directory => Get_Text (Path_Widget), + Resolve_Links => False)); +@@ -2231,7 +2232,7 @@ + Set (Editor.Model, Iter, 1, False); + else + Set (Editor.Model, Iter, 0, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Value (V).all, + Directory => Get_Text (Path_Widget), + Resolve_Links => False)); +@@ -2260,7 +2261,7 @@ + Set_Text (Editor.Ent, Current); + else + Set_Text (Editor.Ent, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Current, + Directory => Get_Text (Path_Widget), + Resolve_Links => False)); +@@ -2917,7 +2918,7 @@ + if Ed.Current_Values (C).Index.all = + Attribute_Index + then +- Free (Ed.Current_Values (C).Values); ++ GNAT.OS_Lib.Extra.Free (Ed.Current_Values (C).Values); + Ed.Current_Values (C).Values := + new GNAT.OS_Lib.String_List' + (Get_Value_As_List (Value_Ed, "")); +--- prj_editor/src/project_viewers.adb~ ++++ prj_editor/src/project_viewers.adb +@@ -56,6 +56,7 @@ + with GNAT.Case_Util; use GNAT.Case_Util; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Ada.Unchecked_Deallocation; + with Ada.Characters.Handling; use Ada.Characters.Handling; + with System; +@@ -1325,7 +1326,7 @@ + loop + Changed := Add_Imported_Project + (Importing_Project, +- Normalize_Pathname (Imported_Project_Path, Base), ++ GNAT.OS_Lib.Extra.Normalize_Pathname (Imported_Project_Path, Base), + Report_Error'Unrestricted_Access, + Use_Relative_Path => Use_Relative_Path); + +@@ -1982,7 +1983,7 @@ + ------------------------ + + procedure On_Project_Changed (Kernel : access Kernel_Handle_Record'Class) is +- Filename : constant String := Normalize_Pathname ++ Filename : constant String := GNAT.OS_Lib.Extra.Normalize_Pathname + (Project_Path (Get_Project (Kernel)), Resolve_Links => False); + begin + if Filename /= "" then +@@ -2948,7 +2949,7 @@ + begin + Free (Creator.XML_Node); + Free (Creator.Tool_Name); +- Free (Creator.Languages); ++ GNAT.OS_Lib.Extra.Free (Creator.Languages); + end Destroy; + + ---------------------------------- +--- prj_editor/src/switches_editors.adb~ ++++ prj_editor/src/switches_editors.adb +@@ -44,6 +44,7 @@ + with Gtkada.Handlers; use Gtkada.Handlers; + + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Case_Util; use GNAT.Case_Util; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with Ada.Characters.Handling; use Ada.Characters.Handling; +@@ -1489,15 +1490,15 @@ + procedure Page_Destroyed (Page : access Gtk_Widget_Record'Class) is + P : Switches_Editor_Page := Switches_Editor_Page (Page); + begin +- Free (P.Lang_Filter); ++ GNAT.OS_Lib.Extra.Free (P.Lang_Filter); + Free (P.Attribute_Index); + Free (P.Title); + Free (P.Pkg); +- Free (P.Coalesce_Switches); +- Free (P.Coalesce_Switches_Default); ++ GNAT.OS_Lib.Extra.Free (P.Coalesce_Switches); ++ GNAT.OS_Lib.Extra.Free (P.Coalesce_Switches_Default); + + for C in P.Expansion_Switches'Range loop +- Free (P.Expansion_Switches (C)); ++ GNAT.OS_Lib.Extra.Free (P.Expansion_Switches (C)); + end loop; + + Unchecked_Free (P.Expansion_Switches); +--- refactoring/src/refactoring-rename.adb~ ++++ refactoring/src/refactoring-rename.adb 2005-01-21 10:50:33.000000000 +0100 +@@ -19,7 +19,8 @@ + ----------------------------------------------------------------------- + + with Ada.Exceptions; use Ada.Exceptions; +-with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + + with Glide_Kernel; use Glide_Kernel; + with Glide_Kernel.Contexts; use Glide_Kernel.Contexts; +@@ -161,8 +162,8 @@ + -- the file, and the locations would become invalid + for L in reverse Location_Arrays.First .. Last (Refs) loop + declare +- Args : Argument_List_Access := +- new Argument_List' ++ Args : GNAT.OS_Lib.Argument_List_Access := ++ new GNAT.OS_Lib.Argument_List' + (new String' + (Full_Name (Get_Filename (Refs.Table (L).File)).all), + new String'(Integer'Image (Refs.Table (L).Line)), +@@ -173,7 +174,7 @@ + begin + Execute_GPS_Shell_Command + (Kernel, "Editor.replace_text", Args.all); +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end; + + if Factory.Auto_Save +--- src_editor/src/casing_exceptions.adb~ ++++ src_editor/src/casing_exceptions.adb 2005-01-21 17:17:15.000000000 +0100 +@@ -22,6 +22,7 @@ + with Ada.Characters.Handling; use Ada.Characters.Handling; + with Ada.Strings.Maps; use Ada.Strings.Maps; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Glib.Object; use Glib.Object; + with Glide_Intl; use Glide_Intl; + with Glide_Kernel.Modules; use Glide_Kernel.Modules; +@@ -252,7 +253,7 @@ + begin + Execute_GPS_Shell_Command + (Get_Kernel (Context), "Editor.replace_text", Args.all); +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Set_Casing; + + ------------------ +--- src_editor/src/src_contexts.adb~ ++++ src_editor/src/src_contexts.adb 2005-01-21 17:19:52.000000000 +0100 +@@ -45,6 +45,7 @@ + with File_Utils; use File_Utils; + with Traces; use Traces; + with GNAT.Regpat; use GNAT.Regpat; ++with GNAT.Regpat.Extra; + with GNAT.Regexp; use GNAT.Regexp; + with GNAT.OS_Lib; use GNAT.OS_Lib; + with GNAT.OS_Lib.Extra; +@@ -340,8 +341,9 @@ + exit; + + else +- Match (Lang.New_Line_Comment_Start.all, +- Buffer, Matches, Pos); ++ GNAT.Regpat.Extra.Match ++ (Lang.New_Line_Comment_Start.all, ++ Buffer, Matches, Pos); + + if Matches (0) /= No_Match then + State := Mono_Comments; +--- src_editor/src/src_editor_buffer.adb~ ++++ src_editor/src/src_editor_buffer.adb 2005-01-21 17:22:21.000000000 +0100 +@@ -23,7 +23,7 @@ + with Ada.Characters.Handling; use Ada.Characters.Handling; + with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; + with Ada.Unchecked_Deallocation; +-with GNAT.Regpat; ++with GNAT.Regpat.Extra; + with Interfaces.C.Strings; use Interfaces.C.Strings; + with System; + +@@ -2277,7 +2277,7 @@ + begin + -- We really need to get the full line here as New_Line_Comment_Start + -- is a regular expression. +- return GNAT.Regpat.Match ++ return GNAT.Regpat.Extra.Match + (Lang_Context.New_Line_Comment_Start.all, S_Line); + end; + end Is_In_Comment; +--- shell/src/shell_script.adb~ ++++ shell/src/shell_script.adb 2005-01-20 19:53:40.000000000 +0100 +@@ -28,6 +28,7 @@ + with Generic_List; + with GNAT.Debug_Utilities; use GNAT.Debug_Utilities; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Glib.Xml_Int; use Glib.Xml_Int; + with Glib.Object; use Glib.Object; + with Glide_Intl; use Glide_Intl; +@@ -1223,7 +1224,7 @@ + end loop; + + Data.Command_Handler (Callback, Data.Short_Command.all); +- Free (Callback.Args); ++ GNAT.OS_Lib.Extra.Free (Callback.Args); + + if Callback.Return_As_Error then + Errors.all := True; +@@ -1408,7 +1409,7 @@ + Args => Args (Args'First + 1 .. Args'Last), + Errors => Errors); + begin +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + + if Last > Command'Last then + return R; +@@ -1470,7 +1471,7 @@ + + procedure Free (Data : in out Shell_Callback_Data) is + begin +- Free (Data.Args); ++ GNAT.OS_Lib.Extra.Free (Data.Args); + end Free; + + ------------ +--- src_editor/src/src_editor_buffer-blocks.adb~ ++++ src_editor/src/src_editor_buffer-blocks.adb 2005-01-21 18:56:25.000000000 +0100 +@@ -40,7 +40,7 @@ + procedure Compute_Blocks (Buffer : access Source_Buffer_Record'Class) is + + function Copy +- (Str : Basic_Types.String_Access) return GNAT.Strings.String_Access; ++ (Str : Basic_Types.String_Access) return GNAT.OS_Lib.String_Access; + pragma Inline (Copy); + -- Returns a copy of Str. + +@@ -58,7 +58,7 @@ + ---------- + + function Copy +- (Str : Basic_Types.String_Access) return GNAT.Strings.String_Access is ++ (Str : Basic_Types.String_Access) return GNAT.OS_Lib.String_Access is + begin + if Str = null then + return null; + +--- src_editor/src/src_contexts.adb~ ++++ src_editor/src/src_contexts.adb +@@ -46,6 +46,7 @@ + with GNAT.Regpat; use GNAT.Regpat; + with GNAT.Regexp; use GNAT.Regexp; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with Language; use Language; + with Language_Handlers; use Language_Handlers; +@@ -1809,7 +1810,7 @@ + if Context.Recurse + and then File_Name (1 .. Last) /= "." + and then File_Name (1 .. Last) /= ".." +- and then not Is_Symbolic_Link (File_Name (1 .. Last)) ++ and then not GNAT.OS_Lib.Extra.Is_Symbolic_Link (File_Name (1 .. Last)) + then + -- ??? Do not try to follow symbolic links for now, + -- so that we avoid infinite recursions. +--- src_editor/src/src_editor_module.adb~ ++++ src_editor/src/src_editor_module.adb +@@ -23,6 +23,7 @@ + + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Glib.Xml_Int; use Glib.Xml_Int; + with Glib.Convert; use Glib.Convert; + with Gdk; use Gdk; +@@ -2527,7 +2528,7 @@ + Arguments => Cmd (Cmd'First + 1 .. Cmd'Last), + Console => Get_Console (Kernel), + Success => Success); +- Free (Cmd); ++ GNAT.OS_Lib.Extra.Free (Cmd); + end; + end if; + end if; +--- vcs/src/vcs-cvs.adb~ ++++ vcs/src/vcs-cvs.adb +@@ -34,6 +34,7 @@ + with Glide_Kernel.Standard_Hooks; use Glide_Kernel.Standard_Hooks; + + with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Case_Util; use GNAT.Case_Util; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + +@@ -1122,7 +1123,7 @@ + end if; + end loop; + +- Free (Diff_Args); ++ GNAT.OS_Lib.Extra.Free (Diff_Args); + + if Version_1 /= "" then + Append (Args, "-r" & Version_1); +--- vcs/src/vcs-generic_vcs.adb~ ++++ vcs/src/vcs-generic_vcs.adb +@@ -44,9 +44,10 @@ + + with Basic_Types; use Basic_Types; + with GNAT.Regpat; use GNAT.Regpat; ++with GNAT.Regpat.Extra; + with GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Directory_Operations; +-with GNAT.Strings; + + with Generic_List; + with Ada.Unchecked_Deallocation; +@@ -355,7 +356,7 @@ + while Node /= Null_Node loop + declare + Args : GNAT.OS_Lib.String_List_Access; +- Dir : GNAT.Strings.String_Access; ++ Dir : GNAT.OS_Lib.String_Access; + + begin + -- Args and Dir freed when the command proxy is destroyed. +@@ -439,7 +440,7 @@ + while Node /= Null_Node loop + declare + Args : GNAT.OS_Lib.String_List_Access; +- Dir : GNAT.Strings.String_Access; ++ Dir : GNAT.OS_Lib.String_Access; + + begin + -- Args, Dir and Dir_Args are freed when the command proxy is +@@ -513,10 +514,9 @@ + Lookup_Action (Kernel, Ref.Commands (Action)); + Custom : Command_Access; + Args : GNAT.OS_Lib.String_List_Access; +- Dir : GNAT.Strings.String_Access; ++ Dir : GNAT.OS_Lib.String_Access; + + use type GNAT.OS_Lib.String_List_Access; +- use GNAT.Strings; + + begin + if not Ref.Absolute_Names then +@@ -601,7 +601,7 @@ + end if; + + String_List.Free (Sorted); +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Get_Status; + + --------------------- +@@ -691,7 +691,7 @@ + + Generic_Command (Rep, Filenames, Args, Commit); + +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Commit; + + ------------ +@@ -735,7 +735,7 @@ + + Generic_Command (Rep, Filenames, Args, Add); + +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Add; + + ------------ +@@ -755,7 +755,7 @@ + + Generic_Command (Rep, Filenames, Args, Remove); + +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Remove; + + ------------ +@@ -793,7 +793,7 @@ + Args := new GNAT.OS_Lib.String_List (1 .. 1); + Args (1) := new String'(Version_1); + Generic_Command (Rep, File, Args, Diff); +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + + elsif Version_1 /= "" + and then Version_2 /= "" +@@ -802,7 +802,7 @@ + Args (1) := new String'(Version_1); + Args (2) := new String'(Version_2); + Generic_Command (Rep, File, Args, Diff2); +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end if; + end Diff; + +@@ -845,7 +845,7 @@ + Args (1) := new String'(Rev); + + Generic_Command (Rep, File, Args, History_Revision); +- GNAT.Strings.Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + else + Generic_Command (Rep, File, Args, History); + end if; +@@ -1150,7 +1150,11 @@ + Command.Prev_Start := Command.Start; + + while Num_Matches < Max_Matches loop +- Match (Command.Parser.Regexp.all, S, Matches, Command.Start, S'Last); ++ GNAT.Regpat.Extra.Match (Command.Parser.Regexp.all, ++ S, ++ Matches, ++ Command.Start, ++ S'Last); + + if Matches (0) = No_Match then + Display_File_Status +@@ -1366,7 +1370,11 @@ + A : Line_Information_Array (1 .. Max); + begin + loop +- Match (Parser.Regexp.all, S, Matches, Start, S'Last); ++ GNAT.Regpat.Extra.Match (Parser.Regexp.all, ++ S, ++ Matches, ++ Start, ++ S'Last); + + exit when Matches (0) = No_Match or else Line > Max; + +--- vcs/src/vcs_module.adb~ ++++ vcs/src/vcs_module.adb +@@ -49,6 +49,7 @@ + with VCS.Generic_VCS; use VCS.Generic_VCS; + with Ada.Exceptions; use Ada.Exceptions; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Projects; use Projects; + with Projects.Registry; use Projects.Registry; + with VFS; use VFS; +@@ -284,7 +285,7 @@ + + procedure Destroy (Module : in out VCS_Module_ID_Record) is + begin +- Free (Module.VCS_List); ++ GNAT.OS_Lib.Extra.Free (Module.VCS_List); + end Destroy; + + ------------------ +--- vdiff/src/diff_utils.adb~ ++++ vdiff/src/diff_utils.adb +@@ -28,6 +28,7 @@ + + with GNAT.Regpat; use GNAT.Regpat; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Glide_Kernel.Preferences; use Glide_Kernel.Preferences; + with String_Utils; use String_Utils; + with Traces; use Traces; +@@ -141,7 +142,7 @@ + if Cmd.all = "" then + Trace (Me, "command not found: " & Diff_Command); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.Os_Lib.Extra.Free (Cmd_Args); + return Ret; + end if; + +@@ -155,7 +156,7 @@ + (Descriptor, Cmd.all, + Cmd_Args (Cmd_Args'First + 1 .. Cmd_Args'Last) & Args); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.OS_Lib.Extra.Free (Cmd_Args); + + for J in Args'Range loop + Free (Args (J)); +@@ -215,7 +216,7 @@ + if Cmd.all = "" then + Trace (Me, "command not found: " & Patch_Command); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.Os_Lib.Extra.Free (Cmd_Args); + return Ret; + end if; + +@@ -215,7 +246,7 @@ + Cmd_Args (Cmd_Args'First + 1 .. Cmd_Args'Last) & + Args (1 .. Num_Args)); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.Os_Lib.Extra.Free (Cmd_Args); + Basic_Types.Free (Args); + + loop +--- vdiff/src/diff_utils2.adb~ ++++ vdiff/src/diff_utils2.adb 2005-01-21 18:33:42.000000000 +0100 +@@ -23,6 +23,7 @@ + + with Ada.Text_IO; use Ada.Text_IO; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Expect; use GNAT.Expect; + with GNAT.Regpat; use GNAT.Regpat; + pragma Warnings (Off); +@@ -280,7 +281,7 @@ + (Descriptor, Cmd.all, + Cmd_Args (Cmd_Args'First + 1 .. Cmd_Args'Last) & Args); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.OS_Lib.Extra.Free (Cmd_Args); + Basic_Types.Free (Args); + + loop +@@ -336,7 +337,7 @@ + if Cmd.all = "" then + Trace (Me, "command not found: " & Patch_Command); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.OS_Lib.Extra.Free (Cmd_Args); + return Ret; + end if; + +@@ -364,7 +365,7 @@ + Cmd_Args (Cmd_Args'First + 1 .. Cmd_Args'Last) & + Args (1 .. Num_Args)); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.OS_Lib.Extra.Free (Cmd_Args); + Basic_Types.Free (Args); + + loop +@@ -493,7 +494,7 @@ + (Descriptor, Cmd.all, + Cmd_Args (Cmd_Args'First + 1 .. Cmd_Args'Last) & Args); + Free (Cmd); +- Free (Cmd_Args); ++ GNAT.OS_Lib.Extra.Free (Cmd_Args); + Basic_Types.Free (Args); + + loop +@@ -638,8 +639,8 @@ + pragma Unreferenced (N); + + begin +- Create_Temp_File (FD1, Fich1); +- Create_Temp_File (FD2, Fich2); ++ GNAT.OS_Lib.Extra.Create_Temp_File (FD1, Fich1); ++ GNAT.OS_Lib.Extra.Create_Temp_File (FD2, Fich2); + + V_Fich1 := Create (Fich1.all); + V_Fich2 := Create (Fich2.all); +--- vdiff/src/vdiff2_module-utils-shell_command.adb~ ++++ vdiff/src/vdiff2_module-utils-shell_command.adb 2005-01-21 18:36 +@@ -24,6 +24,7 @@ + + with String_Utils; use String_Utils; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Basic_Types; + + with Gdk.Color; use Gdk.Color; +@@ -108,6 +109,6 @@ + Execute_GPS_Shell_Command + (Kernel, "Editor.set_synchronized_scrolling", Args.all); + Basic_Types.Free (Args.all); +- Free (Args); ++ GNAT.OS_Lib.Extra.Free (Args); + end Synchronize_Scrolling; + +--- vfs/src/vfs_module.adb~ ++++ vfs/src/vfs_module.adb +@@ -21,7 +21,9 @@ + with Ada.Exceptions; use Ada.Exceptions; + with File_Utils; use File_Utils; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; ++with GNAT.Directory_Operations.Extra; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with GNAT.Regexp; use GNAT.Regexp; + with Glib; use Glib; + with Glib.Object; use Glib.Object; +@@ -121,7 +123,8 @@ + end if; + + Is_Cur_Dir := +- Normalize_Pathname (Directory.all, Resolve_Links => False) = ++ GNAT.OS_Lib.Extra.Normalize_Pathname (Directory.all, ++ Resolve_Links => False) = + Get_Current_Dir; + Open (Dir, Directory.all); + +@@ -172,7 +175,7 @@ + File : constant String := Nth_Arg (Data, 1); + begin + if Is_Directory (File) then +- Remove_Dir (File, True); ++ GNAT.Directory_Operations.Extra.Remove_Dir (File, True); + else + Delete_File (File, Success); + +@@ -227,7 +230,7 @@ + Delete (File_Information (File)); + else + begin +- Remove_Dir (Dir, True); ++ GNAT.Directory_Operations.Extra.Remove_Dir (Dir, True); + exception + when Directory_Error => + Console.Insert +--- vsearch/src/find_utils.adb~ ++++ vsearch/src/find_utils.adb +@@ -24,6 +24,7 @@ + with Glide_Kernel; use Glide_Kernel; + with Traces; use Traces; + with GNAT.Regpat; use GNAT.Regpat; ++with GNAT.Regpat.Extra; + with GNAT.OS_Lib; use GNAT.OS_Lib; + with Gtk.Widget; use Gtk.Widget; + with Vsearch_Ext; use Vsearch_Ext; +@@ -190,7 +191,8 @@ + end if; + + loop +- Match (RE, Buffer, Context.Sub_Matches.all, Pos, End_Index); ++ GNAT.Regpat.Extra.Match ++ (RE, Buffer, Context.Sub_Matches.all, Pos, End_Index); + + -- The second test below works around an apparent bug in + -- GNAT.Regpat +--- widgets/src/directory_tree.adb~ ++++ widgets/src/directory_tree.adb +@@ -21,6 +21,7 @@ + with Ada.Exceptions; use Ada.Exceptions; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; + with GNAT.OS_Lib; use GNAT.OS_Lib; ++with GNAT.OS_Lib.Extra; + with Glib; use Glib; + with Glib.Convert; use Glib.Convert; + with Glib.Object; use Glib.Object; +@@ -504,7 +505,7 @@ + Dir_Name : constant String := Dir & File (1 .. Last); + begin + if Is_Directory (Dir_Name) +- and then not Is_Symbolic_Link (Dir_Name) ++ and then not GNAT.OS_Lib.Extra.Is_Symbolic_Link (Dir_Name) + and then Filter (Selector.Directory, File (1 .. Last)) + then + Add_Directory (Selector, Name_As_Directory (Dir_Name), True); +@@ -940,11 +941,11 @@ + for J in Initial_Selection'Range loop + Append (Selector.List_Model, Iter, Null_Iter); + Set (Selector.List_Model, Iter, Absolute_Name_Column, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Initial_Selection (J).all, + Resolve_Links => False)); + Set (Selector.List_Model, Iter, Base_Name_Column, +- Normalize_Pathname ++ GNAT.OS_Lib.Extra.Normalize_Pathname + (Initial_Selection (J).all, + Resolve_Links => False)); + end loop; +--- widgets/src/gtkada-file_selector.adb~ ++++ widgets/src/gtkada-file_selector.adb 2005-01-21 08:23:52.000000000 +0100 +@@ -63,6 +63,7 @@ + + with GNAT.Regexp; use GNAT.Regexp; + with GNAT.Directory_Operations; use GNAT.Directory_Operations; ++with GNAT.OS_Lib.Extra; + with Ada.Characters.Handling; use Ada.Characters.Handling; + with Ada.Exceptions; use Ada.Exceptions; + +@@ -341,7 +342,7 @@ + return Create + (Full_Filename => + Locale_To_UTF8 +- (Normalize_Pathname ++ (GNAT.OS_Lib.Extra.Normalize_Pathname + (File, Directory => Dialog.Current_Directory.all, + Resolve_Links => False))); + end; +@@ -588,7 +589,7 @@ + return ""; + else + declare +- Dir : constant String := Normalize_Pathname ++ Dir : constant String := GNAT.OS_Lib.Extra.Normalize_Pathname + (Locale_From_UTF8 (Get_Text (File_Selector.Selection_Entry)), + Resolve_Links => False); + begin +@@ -869,7 +870,7 @@ + Dir : String) + is + Normalized : constant String := +- Normalize_Pathname (Dir, Resolve_Links => False); ++ GNAT.OS_Lib.Extra.Normalize_Pathname (Dir, Resolve_Links => False); + begin + -- If the new directory is not the one currently shown in the File_List, + -- then update the File_List. +@@ -978,7 +979,9 @@ + begin + if H.all /= "" then + Change_Directory +- (Win, Normalize_Pathname (H.all, Resolve_Links => False)); ++ (Win, ++ GNAT.OS_Lib.Extra.Normalize_Pathname (H.all, ++ Resolve_Links => False)); + else + Change_Directory (Win, Win.Home_Directory.all); + end if; +@@ -1545,7 +1548,7 @@ + if Is_Directory (Win.Current_Directory.all + & Best_Match (1 .. Suffix_Length)) + and then Win.Current_Directory.all +- /= Normalize_Pathname ++ /= GNAT.OS_Lib.Extra.Normalize_Pathname + (Win.Current_Directory.all + & Best_Match (1 .. Suffix_Length), + Resolve_Links => False) +@@ -2028,7 +2031,7 @@ + (-"Select directory", + Parent => Gtk_Window (Get_Toplevel (Ent)), + Base_Directory => +- Dir_Name (Normalize_Pathname ++ Dir_Name (GNAT.OS_Lib.Extra.Normalize_Pathname + (Locale_From_UTF8 (Get_Text (Result)), + Resolve_Links => False))); + begin --- gnat-gps-2.1.0.orig/debian/05-texinfo.patch +++ gnat-gps-2.1.0/debian/05-texinfo.patch @@ -0,0 +1,98 @@ +* Place all info files under "GNU Ada tools" in the Info directory. +* Change names to gnat_gps, gnat_gps_pg and gnat_gps_tutorial. +* Fix minor errors reported by makeinfo. + + +--- docs/gps.texi ++++ docs/gps.texi 2005-01-24 11:34:36.000000000 +0100 +@@ -2,11 +2,16 @@ + @input texiplus + + @c %**start of header +-@setfilename gps.info ++@setfilename gnat_gps.info + @settitle Using the GNAT Programming System + @setchapternewpage odd + @syncodeindex fn cp + ++@dircategory GNU Ada tools ++@direntry ++* GPS: (gnat_gps). Using the GNAT Programming System ++@end direntry ++ + @set GPS + @set GPSVersion 2.1.0 + +--- docs/gps_pg.texi~ ++++ docs/gps_pg.texi 2005-01-24 11:27:32.000000000 +0100 +@@ -1,14 +1,19 @@ + \input texinfo @c -*-texinfo-*- + @input texiplus + +-@set GPS +-@set GPSVersion 2.1.0 +- + @c %**start of header +-@setfilename gps_pg.info ++@setfilename gnat_gps_pg.info + @settitle GPS Programmer's Guide + @syncodeindex fn cp + ++@dircategory GNU Ada tools ++@direntry ++* GPS Programmer's Guide: (gnat_gps_pg). Using the GNAT Programming System ++@end direntry ++ ++@set GPS ++@set GPSVersion 2.1.0 ++ + @titlepage + + @title{GPS Programmer's Guide} +@@ -167,7 +172,7 @@ + + Generally speaking, a module provides a limited set of features, and adds + new GUI features in the GPS interface, like menus, toolbar buttons, contextual +-menu entries, new windows,@dots As much as possible, a menu shouldn't directly ++menu entries, new windows,@dots{} As much as possible, a menu shouldn't directly + depend on any other module, only on the GPS kernel itself. + + See the file @file{glide_kernel-modules.ads} for more information on modules. +@@ -401,7 +406,7 @@ + Hooks are similar to the usual gtk+ signals. + Each hook is a named collection of subprograms to be called when the hook is + executed. Such hooks are executed by various parts of GPS when some actions +-take place, like reloading the project, loading a file,@dots ++take place, like reloading the project, loading a file,@dots{} + + These are the most powerful way for a module to react to actions taking place + in other parts of GPS, and to act appropriately. +--- docs/tutorial.texi~ ++++ docs/tutorial.texi 2005-01-24 11:32:59.000000000 +0100 +@@ -1,11 +1,16 @@ + \input texiplus @c -*-texinfo-*- + @c %**start of header +-@setfilename tutorial.info ++@setfilename gnat_gps_tutorial.info + @settitle GNAT Programming System Tutorial + @syncodeindex fn cp + + @set GPSVersion 2.1.0 + ++@dircategory GNU Ada tools ++@direntry ++* GPS Tutorial: (gnat_gps_tutorial). GNAT Programming System Tutorial ++@end direntry ++ + @titlepage + + @title GNAT Programming System Tutorial +@@ -423,7 +428,7 @@ + @c -------------------------------------------------------------------- + + @noindent +-From @i{view}, click on the blue link: code{stack.ads:32}, this will open ++From @i{view}, click on the blue link: @code{stack.ads:32}, this will open + the file @file{stack.ads} at line 32. + Then from the source editor (file @file{stack.ads}), select the contextual + menu @code{References->Find all references to View}: this highlights the --- gnat-gps-2.1.0.orig/debian/07-python-customisation.patch +++ gnat-gps-2.1.0/debian/07-python-customisation.patch @@ -0,0 +1,37 @@ +By default, the python startup file that GPS looks for is +/usr/share/gps/python/autoexec.py. The documentation says that the system +administrator may customise this file. However, it is against Debian policy +to have configuration files in /usr. This patch changes GPS so that it first +looks for a file named /etc/gnat-gps/autoexec.py; if this file exists, it +overrides /usr/share/gps/python/autoexec.py. + +-- +Ludovic Brenta. + +--- python/src/python_module.adb~ 2004-11-04 07:29:53.000000000 -0400 ++++ python/src/python_module.adb 2005-02-02 07:00:59.000000000 -0400 +@@ -853,6 +853,7 @@ + procedure Load_Python_Startup_Files + (Kernel : access Glide_Kernel.Kernel_Handle_Record'Class) + is ++ Etc : constant String := "/etc/gnat-gps/"; + Sys : constant String := + Format_Pathname (Get_System_Dir (Kernel), UNIX) + & "share/gps/python/"; +@@ -870,7 +871,15 @@ + return; + end if; + +- if Is_Regular_File (Sys & "autoexec.py") then ++ if Is_Regular_File (Etc & "autoexec.py") then ++ Trace (Me, "Load python files from " & Etc & "autoexec.py"); ++ ++ Execute_Command ++ (Python_Module_Id.Script, ++ "execfile (""" & Etc & "autoexec.py"")", ++ Hide_Output => True, ++ Errors => Errors); ++ elsif Is_Regular_File (Sys & "autoexec.py") then + Trace (Me, "Load python files from " & Sys & "autoexec.py"); + + Execute_Command --- gnat-gps-2.1.0.orig/debian/06-documentation-path.patch +++ gnat-gps-2.1.0/debian/06-documentation-path.patch @@ -0,0 +1,113 @@ +Place documentation files in /usr/share/doc/gnat-gps-doc. The +documentation is describe by XML files that GPS parsess at run time: +place them in /usr/share/doc/gnat-gps-doc, too, and patch GPS so it +looks for them there. The XML files refer to other files; adjust the +path to match. + +-- +Ludovic Brenta. + + +--- help/src/help_module.adb~ ++++ help/src/help_module.adb 2005-01-27 11:54:19.000000000 +0100 +@@ -465,10 +465,11 @@ + begin + Trace (Me, "Parsing XML file " + & Get_System_Dir (Kernel) +- & "share/gps/shell_commands.xml"); ++ & "share/doc/gnat-gps-doc/shell_commands.xml"); + XML_Parsers.Parse + (File => +- Get_System_Dir (Kernel) & "share/gps/shell_commands.xml", ++ Get_System_Dir (Kernel) & ++ "share/doc/gnat-gps-doc/shell_commands.xml", + Tree => Tmp, + Error => Error); + if Error /= null then +@@ -530,7 +531,7 @@ + elsif Command = "file" then + Set_Return_Value + (Data, Get_System_Dir (Kernel) +- & "share/gps/shell_commands.xml"); ++ & "share/doc/gnat-gps-doc/shell_commands.xml"); + + elsif Command = "reset" then + Inst := Nth_Arg (Data, 1, Help_Module_ID.Help_Class); +@@ -1398,7 +1399,8 @@ + Top : constant Glide_Window := Glide_Window + (Get_Main_Window (Kernel)); + About_File : constant String := +- Format_Pathname (Top.Prefix_Directory.all & "/share/gps/about.txt"); ++ Format_Pathname (Top.Prefix_Directory.all & ++ "/share/doc/gnat-gps-doc/about.txt"); + Contents : GNAT.OS_Lib.String_Access; + + begin +@@ -1706,11 +1708,11 @@ + + if Path_From_Env = null or else Path_From_Env.all = "" then + Help_Module_ID.Doc_Path := new String' +- (Get_System_Dir (Kernel) & "/doc/gps/html/"); ++ (Get_System_Dir (Kernel) & "share/doc/gnat-gps-doc"); + else + Help_Module_ID.Doc_Path := new String' + (Path_From_Env.all & Path_Separator +- & Get_System_Dir (Kernel) & "/doc/gps/html/"); ++ & Get_System_Dir (Kernel) & "share/doc/gnat-gps-doc"); + end if; + + Free (Path_From_Env); +--- docs/gps_index.xml~ ++++ docs/gps_index.xml 2005-01-27 12:23:24.000000000 +0100 +@@ -22,45 +22,31 @@ + + + +- gnat_ugn.html +- Native GNAT User's Guide ++ /usr/share/doc/gnat-doc/gnat_ug/index.html ++ GNAT User's Guide + GNAT +- /Help/GNAT/Native GNAT User's Guide ++ /Help/GNAT/GNAT User's Guide + + + +- gnat_ugx.html +- Cross GNAT User's Guide +- GNAT +- /Help/GNAT/Cross GNAT User's Guide +- +- +- +- gnat_rm.html ++ /usr/share/doc/gnat-doc/gnat_rm/index.html + GNAT Reference Manual + /Help/GNAT/GNAT Reference Manual + GNAT + + + +- arm95.html ++ /usr/share/doc/ada-reference-manual/html/arm95tc1/RM-TOC.html + Ada 95 Reference Manual + /Help/GNAT/Ada 95 Reference Manual + GNAT + + + +- gdb.html ++ /usr/share/doc/gnat-gdb-doc/gnatgdb/index.html + Using the GNU Debugger + /Help/Using the GNU Debugger + General + + +- +- gcc.html +- Using GCC +- /Help/Using GCC +- General +- +- +