Package: src:gprbuild
Followup-For: Bug #763727

With the diff…
#
# old_revision [950bbf7e9813c77e32c46681053963808b47815c]
#
# patch "debian/patches/763727.patch"
#  from [6023754390a73c950a02592a9e006c3f23cb0a3c]
#    to [aa2bbcb0c95f667934874f7d26929d3e2909b5ab]
#
============================================================
--- debian/patches/763727.patch	6023754390a73c950a02592a9e006c3f23cb0a3c
+++ debian/patches/763727.patch	aa2bbcb0c95f667934874f7d26929d3e2909b5ab
@@ -11,43 +11,55 @@ Bug-Debian: https://bugs.debian.org/7637
 
 --- a/src/gprconfig-knowledge.adb
 +++ b/src/gprconfig-knowledge.adb
-@@ -722,7 +722,7 @@
-             elsif Node_Name (N) = "executable" then
-                declare
-                   Prefix : constant String :=
--                             Get_Attribute (N, "prefix", "@@");
-+                             Get_Attribute (N, "prefix", "-1");
-                   Val    : constant String := Node_Value_As_String (N);
-                begin
-                   if Val = "" then
---- a/share/gprconfig/compilers.xml
-+++ b/share/gprconfig/compilers.xml
-@@ -656,8 +656,8 @@
-     <languages>Ada</languages>
-     <variable name="gcc_version">4.9</variable>
-     <runtimes default="default,kernel,native">
--       <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
--       <directory group="default" contents="^rts-">\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory>
-+       <directory group="0" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
-+       <directory group="1" contents="^rts-">\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory>
-        <directory group="2" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory>
-     </runtimes>
-     <target>
-@@ -681,7 +681,7 @@
-       <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
-     </variable>
-     <runtimes default="default">
--       <directory group="default" >\.\./lib/gcc/.*/$gcc_version/adalib/</directory>
-+       <directory group="0" >\.\./lib/gcc/.*/$gcc_version/adalib/</directory>
-     </runtimes>
-     <target>codepeer</target>
-   </compiler_description>
-@@ -697,7 +697,7 @@
-     </version>
-     <languages>Ada</languages>
-     <runtimes default="default,kernel">
--       <directory group="default" >\.\./lib/dotgnat/adalib/</directory>
-+       <directory group="0" >\.\./lib/dotgnat/adalib/</directory>
-        <directory group="1" >\.\./lib/dotgnat/rts-(.*)/adalib/</directory>
-     </runtimes>
-     <target>dotnet</target>
+@@ -604,6 +604,8 @@
+                      C : constant String :=
+                        Get_Attribute (Tmp, "contents", "");
+                      Contents : Pattern_Matcher_Access;
++                     Group : constant String :=
++                       Get_Attribute (Tmp, "group", "0");
+                   begin
+                      if C /= "" then
+                         Contents := new Pattern_Matcher'(Compile (C));
+@@ -616,16 +618,15 @@
+                         Contents        => Contents,
+                         Dir_If_Match    => No_Name,
+                         Directory_Group => 0);
+-                  end;
+ 
+-                  begin
+-                     External_Node.Directory_Group := Integer'Value
+-                       (Get_Attribute (Tmp, "group", "0"));
+-                  exception
+-                     when Constraint_Error =>
++                     if Group /= ""
++                       and (for all Digit of Group => Digit in '0' .. '9')
++                     then
++                        External_Node.Directory_Group := Integer'Value (Group);
++                     else
+                         External_Node.Directory_Group := -1;
+-                        External_Node.Dir_If_Match :=
+-                          Get_String (Get_Attribute (Tmp, "group", "0"));
++                        External_Node.Dir_If_Match := Get_String (Group);
++                     end if;
+                   end;
+ 
+                   Append (Value, External_Node);
+@@ -735,12 +736,13 @@
+                   else
+                      Compiler.Executable := Get_String (Val);
+ 
+-                     begin
++                     if Prefix /= ""
++                       and (for all Digit of Prefix => Digit in '0' .. '9')
++                     then
+                         Compiler.Prefix_Index := Integer'Value (Prefix);
+-                     exception
+-                        when Constraint_Error =>
+-                           Compiler.Prefix_Index := -1;
+-                     end;
++                     else
++                        Compiler.Prefix_Index := -1;
++                     end if;
+ 
+                      if not Ends_With (Val, Exec_Suffix.all) then
+                         Compiler.Executable_Re := new Pattern_Matcher'

Reply via email to