summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl/Makefile.PL.in4
-rw-r--r--perl/lib/Sys/Guestfs/Lib.pm9
-rwxr-xr-xsrc/generator.ml28
3 files changed, 27 insertions, 14 deletions
diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in
index d18aba63..410e076b 100644
--- a/perl/Makefile.PL.in
+++ b/perl/Makefile.PL.in
@@ -1,5 +1,5 @@
# libguestfs Perl bindings
-# Copyright (C) 2009 Red Hat Inc.
+# Copyright (C) 2009-2010 Red Hat Inc.
#
# 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
@@ -21,7 +21,7 @@ WriteMakefile (
FIRST_MAKEFILE => 'Makefile-pl',
NAME => 'Sys::Guestfs',
- VERSION => '@PACKAGE_VERSION@',
+ VERSION => '0.@MAX_PROC_NR@',
LIBS => '-L@top_builddir@/src/.libs -lguestfs',
INC => '-I@top_builddir@/src -I@top_srcdir@/src',
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm
index d3d652eb..fc3163f1 100644
--- a/perl/lib/Sys/Guestfs/Lib.pm
+++ b/perl/lib/Sys/Guestfs/Lib.pm
@@ -1,5 +1,5 @@
# Sys::Guestfs::Lib
-# Copyright (C) 2009 Red Hat Inc.
+# Copyright (C) 2009-2010 Red Hat Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,13 @@ package Sys::Guestfs::Lib;
use strict;
use warnings;
+# The minor part of this version number is incremented when some
+# change is made to this module. The major part is incremented if we
+# make a change which is not backwards compatible. It is not related
+# to the libguestfs version number.
+use vars qw($VERSION);
+$VERSION = '0.1';
+
use Carp qw(croak);
use Sys::Guestfs;
diff --git a/src/generator.ml b/src/generator.ml
index 31f0e027..37ff0d41 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -4636,6 +4636,16 @@ let all_functions_sorted =
List.sort (fun (n1,_,_,_,_,_,_) (n2,_,_,_,_,_,_) ->
compare n1 n2) all_functions
+(* This is used to generate the src/MAX_PROC_NR file which
+ * contains the maximum procedure number, a surrogate for the
+ * ABI version number. See src/Makefile.am for the details.
+ *)
+let max_proc_nr =
+ let proc_nrs = List.map (
+ fun (_, _, proc_nr, _, _, _, _) -> proc_nr
+ ) daemon_functions in
+ List.fold_left max 0 proc_nrs
+
(* Field types for structures. *)
type field =
| FChar (* C 'char' (really, a 7 bit byte). *)
@@ -8806,6 +8816,12 @@ package Sys::Guestfs;
use strict;
use warnings;
+# This version number changes whenever a new function
+# is added to the libguestfs API. It is not directly
+# related to the libguestfs version number.
+use vars qw($VERSION);
+$VERSION = '0.%d';
+
require XSLoader;
XSLoader::load ('Sys::Guestfs');
@@ -8824,7 +8840,7 @@ sub new {
return $self;
}
-";
+" max_proc_nr;
(* Actions. We only need to print documentation for these as
* they are pulled in from the XS code automatically.
@@ -11638,17 +11654,7 @@ let inspect ?connect ?xml names =
parse_operatingsystems xml
"
-(* This is used to generate the src/MAX_PROC_NR file which
- * contains the maximum procedure number, a surrogate for the
- * ABI version number. See src/Makefile.am for the details.
- *)
and generate_max_proc_nr () =
- let proc_nrs = List.map (
- fun (_, _, proc_nr, _, _, _, _) -> proc_nr
- ) daemon_functions in
-
- let max_proc_nr = List.fold_left max 0 proc_nrs in
-
pr "%d\n" max_proc_nr
let output_to filename k =