From Peter Harris via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2981 :
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 11 Sep 2009 18:06:50 +0000 (18:06 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 11 Sep 2009 18:06:50 +0000 (18:06 +0000)
Put the git version of mesa and xcbproto in the generated header files.

From me: Don't use 'which' to find git--it wouldn't work on Windows.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29865 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/process-x11-xcb.pl
epan/dissectors/x11-extension-errors.h
epan/dissectors/x11-extension-implementation.h
epan/dissectors/x11-glx-render-enum.h

index dfac652efb2ad0a83a5298dde71efd3036b641c2..0a772023c1e0ed7e3278f3a5ca5f9b4db3c32417 100755 (executable)
@@ -514,7 +514,7 @@ sub dissect_element($$$;$$)
        } else {
            die ("Unrecognized type: $type\n");
        }
-       
+
        if ($adjustlength && defined($lentype)) {
          # Some requests end with a list of unspecified length
          # Adjust the length field here so that the next $lencalc will be accurate
@@ -912,7 +912,7 @@ static void $header$name(tvbuff_t *tvb, int *offsetp, proto_tree *t, int little_
 eot
 ;
     }
-    
+
     my $varpat = $header.'_'.$name.'_%s';
     my $humanpat = "$header.$name.%s";
 
@@ -1042,12 +1042,29 @@ eot
     push @register, $header;
 }
 
+sub find_version {
+    #my $git = `which git`;
+    #chomp($git);
+    #-x $git or return 'unknown';
+
+    my $lib = shift;
+    # this will generate an error on stderr if git isn't in our $PATH
+    # but that's OK.  The version is still set to 'unknown' in that case
+    # and at least the operator could see it.
+    my $ver = `git --git-dir=$lib/.git describe`;
+    $ver //= 'unknown';
+    chomp $ver;
+    return $ver;
+}
+
 sub add_generated_header {
-    my ($out) = @_;
+    my ($out, $using) = @_;
+    my $ver = find_version($using);
 
     print $out <<eot
 /* Do not modify this file. */
-/* It was automatically generated by $0. */
+/* It was automatically generated by $0
+   using $using version $ver */
 eot
     ;
     # Since this file is checked in, add its SVN revision
@@ -1090,8 +1107,8 @@ $impl = new IO::File '> x11-extension-implementation.h'
 $error = new IO::File '> x11-extension-errors.h'
            or die ("Cannot open x11-extension-errors.h for writing\n");
 
-add_generated_header($impl);
-add_generated_header($error);
+add_generated_header($impl, 'xcbproto');
+add_generated_header($error, 'xcbproto');
 
 # Open the files generated by process-x11-fields.pl for appending
 $reg = new IO::File '>> x11-register-info.h'
@@ -1106,7 +1123,7 @@ print $decl "\n/* Generated by $0 below this line */\n";
 if (-e 'mesa/src/mesa/glapi/gl_API.xml') {
     $enum = new IO::File '> x11-glx-render-enum.h'
            or die ("Cannot open x11-glx-render-enum.h for writing\n");
-    add_generated_header($enum);
+    add_generated_header($enum, 'mesa');
     print $enum "static const value_string mesa_enum[] = {\n";
     print $impl '#include "x11-glx-render-enum.h"'."\n\n";
 
@@ -1155,14 +1172,14 @@ static void dispatch_glx_render(tvbuff_t *tvb, packet_info *pinfo, int *offsetp,
 
        op = VALUE16(tvb, *offsetp + 2);
        ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op);
-       
+
        tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle);
 
        ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian);
        *offsetp += 2;
        proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian);
        *offsetp += 2;
-       
+
        if (len < 4) {
            expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length");
            /* Eat the rest of the packet, mark it undecoded */
index 5e64537cc6ed354aafd00f6464abe7daf07b5f54..4fc17551291512ce9db827b33af5814ace295983 100644 (file)
@@ -1,5 +1,6 @@
 /* Do not modify this file. */
-/* It was automatically generated by process-x11-xcb.pl. */
+/* It was automatically generated by process-x11-xcb.pl
+   using xcbproto version 1.5-4-ga507629 */
 /* $Id$ */
 
 /*
index afdf48e382a7e25475f2babc1effe8759d5dfc94..4b68c0b5de65eadfe7efc82d336d391dfa62f07c 100644 (file)
@@ -1,5 +1,6 @@
 /* Do not modify this file. */
-/* It was automatically generated by process-x11-xcb.pl. */
+/* It was automatically generated by process-x11-xcb.pl
+   using xcbproto version 1.5-4-ga507629 */
 /* $Id$ */
 
 /*
@@ -3709,14 +3710,14 @@ static void dispatch_glx_render(tvbuff_t *tvb, packet_info *pinfo, int *offsetp,
 
        op = VALUE16(tvb, *offsetp + 2);
        ti = proto_tree_add_uint(t, hf_x11_glx_render_op_name, tvb, *offsetp, len, op);
-       
+
        tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle);
 
        ti = proto_tree_add_item(tt, hf_x11_request_length, tvb, *offsetp, 2, little_endian);
        *offsetp += 2;
        proto_tree_add_item(tt, hf_x11_glx_render_op_name, tvb, *offsetp, 2, little_endian);
        *offsetp += 2;
-       
+
        if (len < 4) {
            expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Invalid Length");
            /* Eat the rest of the packet, mark it undecoded */
index b2cf7c758b9f5228fe6f9399170b6a8993fdd021..1ca886eb6ab9235e34b6fc9eae9dd1a7b114702a 100644 (file)
@@ -1,5 +1,6 @@
 /* Do not modify this file. */
-/* It was automatically generated by process-x11-xcb.pl. */
+/* It was automatically generated by process-x11-xcb.pl
+   using mesa version mesa_7_5_1-3181-gd9dc4cb */
 /* $Id$ */
 
 /*