[Pkg-sssd-devel] ding-libs: Changes to 'ubuntu'

Timo Aaltonen tjaalton-guest at alioth.debian.org
Mon Apr 29 13:26:52 UTC 2013


 Makefile.am                           |   90 -
 basicobjects/basicobjects.cfg.doxy.in | 1533 +++++++++++++++++++
 basicobjects/basicobjects.pc.in       |   11 
 basicobjects/simplebuffer.c           |  215 ++
 basicobjects/simplebuffer.h           |   80 +
 basicobjects/simplebuffer_ut.c        |  146 +
 collection/collection.c               |   79 
 collection/collection.cfg.doxy.in     |   35 
 collection/collection.h               |   63 
 collection/collection_cmp.c           |    3 
 collection/collection_cnv.c           |    3 
 collection/collection_iter.c          |    3 
 collection/collection_queue.c         |    1 
 collection/collection_queue.h         |    3 
 collection/collection_queue_ut.c      |    3 
 collection/collection_stack.c         |    1 
 collection/collection_stack.h         |    3 
 collection/collection_stack_ut.c      |    3 
 collection/collection_tools.c         |   10 
 collection/collection_tools.h         |    4 
 collection/collection_ut.c            |  123 +
 configure.ac                          |   13 
 contrib/ding-libs.spec.in             |   59 
 debian/changelog                      |   34 
 debian/control                        |   52 
 debian/copyright                      |    3 
 debian/libbasicobjects-dev.install    |    3 
 debian/libbasicobjects0.install       |    1 
 debian/libdhash-dev.docs              |    1 
 debian/libdhash-dev.install           |    3 
 debian/libini-config-dev.docs         |    1 
 debian/libini-config-dev.install      |    3 
 debian/libini-config2.install         |    1 
 debian/libini-config3.install         |    1 
 debian/libini_config-dev.docs         |    1 
 debian/libpath-utils-dev.docs         |    1 
 debian/libpath-utils-dev.install      |    1 
 debian/libpath_utils-dev.docs         |    2 
 debian/libref-array-dev.docs          |    1 
 debian/libref-array-dev.install       |    1 
 debian/libref_array-dev.docs          |    2 
 debian/rules                          |   10 
 dhash/dhash.c                         |   10 
 dhash/dhash.h                         |    2 
 dhash/examples/dhash_test.c           |   11 
 ini/ini.d/first.conf                  |   25 
 ini/ini.d/foo.conf.in                 |   12 
 ini/ini.d/ipa.conf                    |   77 
 ini/ini.d/mergecheck.conf             |  592 +++++++
 ini/ini.d/mysssd.conf                 |   70 
 ini/ini.d/real.conf                   |    4 
 ini/ini.d/second.conf                 |   28 
 ini/ini.d/sexpect.conf                |  379 ++++
 ini/ini.d/smerge.conf                 |   33 
 ini/ini.d/space.conf                  |    5 
 ini/ini.d/test.conf                   |   18 
 ini/ini_comment.c                     |  416 ++++-
 ini/ini_comment.h                     |   66 
 ini/ini_comment_ut.c                  |  245 ++-
 ini/ini_config.c                      |  171 ++
 ini/ini_config.cfg.doxy.in            |   37 
 ini/ini_config.h                      |   20 
 ini/ini_config_priv.h                 |  101 +
 ini/ini_config_ut.c                   |   63 
 ini/ini_configobj.c                   | 1041 +++++++++++++
 ini/ini_configobj.h                   | 1727 +++++++++++++++++++++
 ini/ini_defines.h                     |   44 
 ini/ini_fileobj.c                     |  382 ++++
 ini/ini_get_array.c                   |    3 
 ini/ini_get_array_valueobj.c          |  388 ++++
 ini/ini_get_value.c                   |    3 
 ini/ini_get_valueobj.c                |  801 ++++++++++
 ini/ini_list.c                        |   12 
 ini/ini_list_valueobj.c               |  135 +
 ini/ini_metadata.c                    |    3 
 ini/ini_parse.c                       | 1700 ++++++++++++++++++++-
 ini/ini_parse.h                       |   36 
 ini/ini_parse_ut.c                    | 2691 ++++++++++++++++++++++++++++++++++
 ini/ini_print.c                       |  132 +
 ini/ini_serialize.c                   |   97 +
 ini/ini_valueobj.c                    | 1154 ++++++++++++++
 ini/ini_valueobj.h                    |  147 +
 ini/ini_valueobj_ut.c                 |  743 +++++++++
 path_utils/path_utils.c               |   70 
 path_utils/path_utils.cfg.doxy.in     |   35 
 path_utils/path_utils.h               |    3 
 path_utils/path_utils_ut.c            |   99 -
 refarray/ref_array.c                  |  158 +
 refarray/ref_array.cfg.doxy.in        |   35 
 refarray/ref_array.h                  |   50 
 refarray/ref_array_ut.c               |  213 ++
 scripts/release.sh                    |   29 
 trace/trace.h                         |   16 
 version.m4                            |    8 
 94 files changed, 16307 insertions(+), 639 deletions(-)

New commits:
commit 0d83afa317530a5b33f76ce4ff87b4073b1093ef
Author: Timo Aaltonen <tjaalton at ubuntu.com>
Date:   Mon Apr 29 16:24:13 2013 +0300

    release to saucy

diff --git a/debian/changelog b/debian/changelog
index fd2379d..e4e2214 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ding-libs (0.3.0.1-0ubuntu1) saucy; urgency=low
+
+  * Sync from unreleased debian git.
+
+ -- Timo Aaltonen <tjaalton at ubuntu.com>  Mon, 29 Apr 2013 16:23:38 +0300
+
 ding-libs (0.3.0.1-1) UNRELEASED; urgency=low
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 16886f4..89bd2a0 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
 Source: ding-libs
 Section: libs
 Priority: extra
-Maintainer: Debian SSSD Team <pkg-sssd-devel at lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian SSSD Team <pkg-sssd-devel at lists.alioth.debian.org>
 Uploaders: Timo Aaltonen <tjaalton at ubuntu.com>
 Build-Depends: debhelper (>= 9),
  autotools-dev,

commit 81bb722fdc952ccabc0e1e4de727a3b6e45b463c
Author: Timo Aaltonen <tjaalton at ubuntu.com>
Date:   Mon Apr 29 16:05:40 2013 +0300

    various packaging updates

diff --git a/debian/changelog b/debian/changelog
index 9fa5137..fd2379d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,13 @@ ding-libs (0.3.0.1-1) UNRELEASED; urgency=low
 
   * New upstream release.
   * rules: Use --fail-missing for dh_install.
+  * Add packaging for libbasicobjects.
+  * Bump soname for libini-config to 3.
+  * Rename *.docs files to actually do something.
+  * rules: Build using --disable-static.
+  * rules: Remove .la files.
+  * libini-config-dev: Add new headers.
+  * control: Wrap Depends.
 
  -- Timo Aaltonen <tjaalton at ubuntu.com>  Mon, 29 Apr 2013 15:14:29 +0300
 
diff --git a/debian/control b/debian/control
index dfc43cb..16886f4 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,8 @@ Vcs-Browser: http://git.debian.org/?p=pkg-sssd/ding-libs.git;a=summary
 Package: libpath-utils-dev
 Section: libdevel
 Architecture: any
-Depends: libpath-utils1 (= ${binary:Version}), ${misc:Depends}
+Depends: ${misc:Depends},
+ libpath-utils1 (= ${binary:Version}),
 Description: Development files for libpath_utils
  Utility functions to manipulate filesystem pathnames. Development files.
  .
@@ -37,7 +38,8 @@ Description: Filesystem Path Utilities
 Package: libdhash-dev
 Section: libdevel
 Architecture: any
-Depends: libdhash1 (= ${binary:Version}), ${misc:Depends}
+Depends: ${misc:Depends},
+ libdhash1 (= ${binary:Version}),
 Description: Development files for libdhash
  A hash table which will dynamically resize to achieve optimal storage & access
  time properties. Development files.
@@ -63,7 +65,8 @@ Description: Dynamic hash table
 Package: libcollection-dev
 Section: libdevel
 Architecture: any
-Depends: libcollection2 (= ${binary:Version}), ${misc:Depends}
+Depends: ${misc:Depends},
+ libcollection2 (= ${binary:Version}),
 Description: Development files for libcollection
  A data-type to collect data in a hierarchical structure for easy iteration
  and serialization. Development files.
@@ -89,7 +92,8 @@ Description: Collection data-type for C
 Package: libref-array-dev
 Section: libdevel
 Architecture: any
-Depends: libref-array1 (= ${binary:Version}), ${misc:Depends}
+Depends: ${misc:Depends},
+ libref-array1 (= ${binary:Version}),
 Description: Development files for refcounted array for C
  A dynamically-growing, reference-counted array. Development files.
  .
@@ -113,7 +117,9 @@ Description: refcounted array for C
 Package: libini-config-dev
 Section: libdevel
 Architecture: any
-Depends: libini-config2 (= ${binary:Version}), libcollection-dev (= ${binary:Version}), ${misc:Depends}
+Depends: ${misc:Depends},
+ libini-config3 (= ${binary:Version}),
+ libcollection-dev (= ${binary:Version}),
 Description: Development files for libini_config
  Library to process config files in INI format into a libcollection data
  structure. Development files.
@@ -121,7 +127,7 @@ Description: Development files for libini_config
  This package is part of the ding-libs, libraries that are required for the
  proper functioning of SSSD, the System Security Services Daemon.
 
-Package: libini-config2
+Package: libini-config3
 Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -135,3 +141,25 @@ Description: INI file parser for C
  .
  This package is part of the ding-libs, libraries that are required for the
  proper functioning of SSSD, the System Security Services Daemon.
+
+Package: libbasicobjects-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends},
+ libbasicobjects0 (= ${binary:Version}),
+Description: Basic object types for C -- development files
+ Library that add basic object types for C. Development files.
+ .
+ This package is part of the ding-libs, libraries that are required for the
+ proper functioning of SSSD, the System Security Services Daemon.
+
+Package: libbasicobjects0
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends},
+Multi-Arch: same
+Description: Basic object types for C
+ Library that add basic object types for C.
+ .
+ This package is part of the ding-libs, libraries that are required for the
+ proper functioning of SSSD, the System Security Services Daemon.
diff --git a/debian/libbasicobjects-dev.install b/debian/libbasicobjects-dev.install
new file mode 100644
index 0000000..76fb0b5
--- /dev/null
+++ b/debian/libbasicobjects-dev.install
@@ -0,0 +1,3 @@
+usr/include/simplebuffer.h
+usr/lib/*/libbasicobjects.so
+usr/lib/*/pkgconfig/basicobjects.pc
diff --git a/debian/libbasicobjects0.install b/debian/libbasicobjects0.install
new file mode 100644
index 0000000..76f0600
--- /dev/null
+++ b/debian/libbasicobjects0.install
@@ -0,0 +1 @@
+usr/lib/*/libbasicobjects.so.*
diff --git a/debian/libdhash-dev.docs b/debian/libdhash-dev.docs
index 4526933..3c939c5 100644
--- a/debian/libdhash-dev.docs
+++ b/debian/libdhash-dev.docs
@@ -1,2 +1 @@
-dhash/README.dhash
 dhash/examples/*
diff --git a/debian/libdhash-dev.install b/debian/libdhash-dev.install
index de81e80..0ea566e 100644
--- a/debian/libdhash-dev.install
+++ b/debian/libdhash-dev.install
@@ -1,3 +1,6 @@
 usr/include/dhash.h
 usr/lib/*/libdhash.so
 usr/lib/*/pkgconfig/dhash.pc
+usr/share/doc/ding-libs/README.dhash	usr/share/doc/libdhash-dev/
+usr/share/doc/ding-libs/examples/dhash_example.c	usr/share/doc/libdhash-dev/examples
+usr/share/doc/ding-libs/examples/dhash_test.c	usr/share/doc/libdhash-dev/examples
diff --git a/debian/libini-config-dev.docs b/debian/libini-config-dev.docs
new file mode 100644
index 0000000..68f96fd
--- /dev/null
+++ b/debian/libini-config-dev.docs
@@ -0,0 +1 @@
+ini/doc/html/*
diff --git a/debian/libini-config-dev.install b/debian/libini-config-dev.install
index 18f9b05..837eed8 100644
--- a/debian/libini-config-dev.install
+++ b/debian/libini-config-dev.install
@@ -1,3 +1,6 @@
+usr/include/ini_comment.h
 usr/include/ini_config.h
+usr/include/ini_configobj.h
+usr/include/ini_valueobj.h
 usr/lib/*/libini_config.so
 usr/lib/*/pkgconfig/ini_config.pc
diff --git a/debian/libini-config2.install b/debian/libini-config2.install
deleted file mode 100644
index c00194c..0000000
--- a/debian/libini-config2.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/libini_config.so.*
diff --git a/debian/libini-config3.install b/debian/libini-config3.install
new file mode 100644
index 0000000..c00194c
--- /dev/null
+++ b/debian/libini-config3.install
@@ -0,0 +1 @@
+usr/lib/*/libini_config.so.*
diff --git a/debian/libini_config-dev.docs b/debian/libini_config-dev.docs
deleted file mode 100644
index 68f96fd..0000000
--- a/debian/libini_config-dev.docs
+++ /dev/null
@@ -1 +0,0 @@
-ini/doc/html/*
diff --git a/debian/libpath-utils-dev.docs b/debian/libpath-utils-dev.docs
new file mode 100644
index 0000000..cfba7f5
--- /dev/null
+++ b/debian/libpath-utils-dev.docs
@@ -0,0 +1 @@
+path_utils/doc/html/*
diff --git a/debian/libpath-utils-dev.install b/debian/libpath-utils-dev.install
index f154539..bdac008 100644
--- a/debian/libpath-utils-dev.install
+++ b/debian/libpath-utils-dev.install
@@ -1,3 +1,4 @@
 usr/include/path_utils.h
 usr/lib/*/libpath_utils.so
 usr/lib/*/pkgconfig/path_utils.pc
+usr/share/doc/ding-libs/README.path_utils usr/share/doc/libpath-utils-dev/
diff --git a/debian/libpath_utils-dev.docs b/debian/libpath_utils-dev.docs
deleted file mode 100644
index 63901d2..0000000
--- a/debian/libpath_utils-dev.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-path_utils/README.path_utils
-path_utils/doc/html/*
diff --git a/debian/libref-array-dev.docs b/debian/libref-array-dev.docs
new file mode 100644
index 0000000..778c9d8
--- /dev/null
+++ b/debian/libref-array-dev.docs
@@ -0,0 +1 @@
+refarray/doc/html/*
diff --git a/debian/libref-array-dev.install b/debian/libref-array-dev.install
index 048d346..c1639d1 100644
--- a/debian/libref-array-dev.install
+++ b/debian/libref-array-dev.install
@@ -1,3 +1,4 @@
 usr/include/ref_array.h
 usr/lib/*/libref_array.so
 usr/lib/*/pkgconfig/ref_array.pc
+usr/share/doc/ding-libs/README.ref_array usr/share/doc/libref-array-dev/
diff --git a/debian/libref_array-dev.docs b/debian/libref_array-dev.docs
deleted file mode 100644
index 2f8b70f..0000000
--- a/debian/libref_array-dev.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-refarray/README.ref_array
-refarray/doc/html/*
diff --git a/debian/rules b/debian/rules
index 2f58c96..39dce2d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,5 +7,12 @@
 %:
 	dh $@ 
 
+override_dh_auto_configure:
+	dh_auto_configure -- \
+	--disable-static
+
 override_dh_install:
+	# remove files we don't want to install
+	find $(CURDIR)/debian/tmp/ -name '*.la' -exec rm '{}' ';'
+
 	dh_install --fail-missing

commit 84f21719b5cfb9c9a90b36c6c0aadcd5ed6a9f3a
Author: Timo Aaltonen <tjaalton at ubuntu.com>
Date:   Mon Apr 29 15:21:52 2013 +0300

    rules: Use --fail-missing for dh_install.

diff --git a/debian/changelog b/debian/changelog
index 3ff5de1..9fa5137 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 ding-libs (0.3.0.1-1) UNRELEASED; urgency=low
 
   * New upstream release.
+  * rules: Use --fail-missing for dh_install.
 
  -- Timo Aaltonen <tjaalton at ubuntu.com>  Mon, 29 Apr 2013 15:14:29 +0300
 
diff --git a/debian/rules b/debian/rules
index 79fd842..2f58c96 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,3 +6,6 @@
 
 %:
 	dh $@ 
+
+override_dh_install:
+	dh_install --fail-missing

commit c2d3e7bf86e3329577c81cf9fbcadf9ab19b84e2
Author: Timo Aaltonen <tjaalton at ubuntu.com>
Date:   Mon Apr 29 15:15:08 2013 +0300

    update the changelog

diff --git a/debian/changelog b/debian/changelog
index fa0cc05..3ff5de1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ding-libs (0.3.0.1-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Timo Aaltonen <tjaalton at ubuntu.com>  Mon, 29 Apr 2013 15:14:29 +0300
+
 ding-libs (0.1.3-2) unstable; urgency=low
 
   * Add missing Depends on libcollection-dev for libini-config-dev.

commit 69bcbaba75172b2bcb9292237092e206147dce8d
Author: Ondrej Kos <okos at redhat.com>
Date:   Fri Mar 29 10:22:11 2013 +0100

    Bump version for 0.3.0.1 release

diff --git a/version.m4 b/version.m4
index 02af987..76b8a0d 100644
--- a/version.m4
+++ b/version.m4
@@ -1,5 +1,5 @@
 # Primary version number
-m4_define([VERSION_NUMBER], [0.3.0])
+m4_define([VERSION_NUMBER], [0.3.0.1])
 
 # If the PRERELEASE_VERSION_NUMBER is set, we'll append
 # it to the release tag when creating an RPM or SRPM
@@ -15,4 +15,4 @@ m4_define([DHASH_VERSION_NUMBER], [0.4.3])
 m4_define([COLLECTION_VERSION_NUMBER], [0.6.2])
 m4_define([REF_ARRAY_VERSION_NUMBER], [0.1.3])
 m4_define([BASICOBJECTS_VERSION_NUMBER], [0.1.0])
-m4_define([INI_CONFIG_VERSION_NUMBER], [1.0.0])
+m4_define([INI_CONFIG_VERSION_NUMBER], [1.0.0.1])

commit ff863970210e07383b6ffd9e5000b5d07d3a359b
Author: Jakub Hrozek <jhrozek at redhat.com>
Date:   Thu Mar 28 15:09:29 2013 -0400

    Remove spurious cast

diff --git a/ini/ini_get_valueobj.c b/ini/ini_get_valueobj.c
index a7efe95..dad9932 100644
--- a/ini/ini_get_valueobj.c
+++ b/ini/ini_get_valueobj.c
@@ -224,7 +224,7 @@ int ini_get_config_valueobj(const char *section,
             return EOK;
         }
 
-        if ((hash == (unsigned long int)col_get_item_hash(item)) &&
+        if ((hash == col_get_item_hash(item)) &&
             (strncasecmp(col_get_item_property(item, &len), name, name_len) == 0) &&
             (len == name_len)) {
                 TRACE_INFO_STRING("Item is found", name);

commit 6ae982f110aa4c0d1e842b61d62fd3015973c8ee
Author: Ondrej Kos <okos at redhat.com>
Date:   Thu Mar 28 17:56:34 2013 +0100

    Bump version for 0.3.0 release

diff --git a/version.m4 b/version.m4
index 1f5f8f4..02af987 100644
--- a/version.m4
+++ b/version.m4
@@ -1,5 +1,5 @@
 # Primary version number
-m4_define([VERSION_NUMBER], [0.2.91])
+m4_define([VERSION_NUMBER], [0.3.0])
 
 # If the PRERELEASE_VERSION_NUMBER is set, we'll append
 # it to the release tag when creating an RPM or SRPM
@@ -15,4 +15,4 @@ m4_define([DHASH_VERSION_NUMBER], [0.4.3])
 m4_define([COLLECTION_VERSION_NUMBER], [0.6.2])
 m4_define([REF_ARRAY_VERSION_NUMBER], [0.1.3])
 m4_define([BASICOBJECTS_VERSION_NUMBER], [0.1.0])
-m4_define([INI_CONFIG_VERSION_NUMBER], [0.7.0])
+m4_define([INI_CONFIG_VERSION_NUMBER], [1.0.0])

commit 3889914c2c915eb28e4bb92a7e388a33d1b0af97
Author: Jakub Hrozek <jhrozek at redhat.com>
Date:   Thu Mar 28 16:31:03 2013 +0100

    Add a release script

diff --git a/scripts/release.sh b/scripts/release.sh
new file mode 100755
index 0000000..4730cda
--- /dev/null
+++ b/scripts/release.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+function config()
+{
+    autoreconf -i -f || return $?
+    ./configure
+}
+
+SAVED_PWD=$PWD
+version=`grep '\[VERSION_NUMBER], \[.*\]' version.m4 |grep '[0-9]\+\.[0-9]\+\.[0-9]\+' -o`
+tag=$(echo ${version} | tr "." "_")
+
+trap "cd $SAVED_PWD; rm -rf ding-libs-${version} ding-libs-${version}.tar" EXIT
+
+git archive --format=tar --prefix=ding-libs-${version}/ ding_libs-${tag} > ding-libs-${version}.tar
+if [ $? -ne 0 ]; then
+    echo "Cannot perform git-archive, check if tag ding_libs-$tag is present in git tree"
+    exit 1
+fi
+tar xf ding-libs-${version}.tar
+
+pushd ding-libs-${version}
+config || exit 1
+make dist-gzip || exit 1  # also builds docs
+popd
+
+mv ding-libs-${version}/ding-libs-${version}.tar.gz .
+gpg --detach-sign --armor ding-libs-${version}.tar.gz
+

commit 826b5d57dfb6ca529a8c857a515ad3ab115dab87
Author: Jakub Hrozek <jhrozek at redhat.com>
Date:   Mon Mar 25 10:56:23 2013 +0100

    Run autoreconf before configure in the specfile

diff --git a/contrib/ding-libs.spec.in b/contrib/ding-libs.spec.in
index 03a4ee7..070bb0d 100644
--- a/contrib/ding-libs.spec.in
+++ b/contrib/ding-libs.spec.in
@@ -320,6 +320,7 @@ structure
 %setup -q
 
 %build
+autoreconf -ivf
 %configure \
     --disable-static
 

commit 6d109eb648640f4dc10599c3f262f0ca4b028315
Author: Jakub Hrozek <jhrozek at redhat.com>
Date:   Mon Mar 25 11:03:19 2013 +0100

    Include AM_PROG_AR in configure.ac to get rid of warnings

diff --git a/configure.ac b/configure.ac
index 902ed86..021cb34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,9 @@ AC_CONFIG_SRCDIR([README])
 AC_CONFIG_AUX_DIR([build])
 AC_GNU_SOURCE
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
-AC_PROG_CC
+AM_PROG_CC_C_O
+m4_pattern_allow([AM_PROG_AR])
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_CONFIG_MACRO_DIR([m4])
 AC_PROG_INSTALL

commit 3aaeadef1f5a867e8fe5258921ad0e97cc6ab3c0
Author: Günther Deschner <gdeschner at redhat.com>
Date:   Wed Oct 24 12:48:27 2012 +0000

    ini_comment.h needs to be installed as well for the new ini interface.
    
    Guenther

diff --git a/Makefile.am b/Makefile.am
index 4a50c84..3045ac5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -213,7 +213,7 @@ endif
 
 lib_LTLIBRARIES += libini_config.la
 dist_pkgconfig_DATA += ini/ini_config.pc
-dist_include_HEADERS += ini/ini_config.h ini/ini_configobj.h ini/ini_valueobj.h
+dist_include_HEADERS += ini/ini_config.h ini/ini_configobj.h ini/ini_valueobj.h ini/ini_comment.h
 
 libini_config_la_SOURCES = \
     ini/ini_config.c \
diff --git a/contrib/ding-libs.spec.in b/contrib/ding-libs.spec.in
index 85d3663..03a4ee7 100644
--- a/contrib/ding-libs.spec.in
+++ b/contrib/ding-libs.spec.in
@@ -306,6 +306,7 @@ structure
 %{_includedir}/ini_config.h
 %{_includedir}/ini_configobj.h
 %{_includedir}/ini_valueobj.h
+%{_includedir}/ini_comment.h
 %{_libdir}/libini_config.so
 %{_libdir}/pkgconfig/ini_config.pc
 %doc ini/doc/html/

commit 44174288111e9715ccbb96e8a8283e99a721ba7b
Author: Dmitri Pal <dpal at redhat.com>
Date:   Sat Jan 26 20:07:48 2013 -0500

    Expose collected stat data
    
    Added a new top level interface funtion
    and a unit test for it.

diff --git a/ini/ini_configobj.h b/ini/ini_configobj.h
index 16f6499..ac85ba7 100644
--- a/ini/ini_configobj.h
+++ b/ini/ini_configobj.h
@@ -587,6 +587,20 @@ void ini_config_print_errors(FILE *file, char **error_list);
  */
 const char *ini_config_get_filename(struct ini_cfgfile *file_ctx);
 
+/**
+ * @brief Get pointer to collected stat data
+ *
+ * Returns the pointer to the internal stat structure.
+ * If stat data was not collected when the file was open
+ * function would return NULL.
+ *
+ * @param[in]  file_ctx         Configuration file object.
+ *
+ * @return Pointer to the stat structure.
+ */
+const struct stat *ini_config_get_stat(struct ini_cfgfile *file_ctx);
+
+
 
 /**
  * @brief Print file context
diff --git a/ini/ini_fileobj.c b/ini/ini_fileobj.c
index 7d2011a..7ac9dc6 100644
--- a/ini/ini_fileobj.c
+++ b/ini/ini_fileobj.c
@@ -215,6 +215,20 @@ const char *ini_config_get_filename(struct ini_cfgfile *file_ctx)
     return ret;
 }
 
+/* Get pointer to stat structure */
+const struct stat *ini_config_get_stat(struct ini_cfgfile *file_ctx)
+{
+    const struct stat *ret;
+    TRACE_FLOW_ENTRY();
+
+    if (file_ctx->stats_read) ret = &(file_ctx->file_stats);
+    else ret = NULL;
+
+    TRACE_FLOW_EXIT();
+    return ret;
+}
+
+
 /* Check access */
 int ini_config_access_check(struct ini_cfgfile *file_ctx,
                             uint32_t flags,
diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c
index c5e9166..32c59e7 100644
--- a/ini/ini_parse_ut.c
+++ b/ini/ini_parse_ut.c
@@ -1057,6 +1057,7 @@ int startup_test(void)
     char command[PATH_MAX * 3];
     char *srcdir = NULL;
     char *builddir;
+    const struct stat *file_stat;
 
     INIOUT(printf("<==== Startup test ====>\n"));
 
@@ -1095,6 +1096,12 @@ int startup_test(void)
         return error;
     }
 
+    file_stat = ini_config_get_stat(file_ctx);
+    if (file_stat) {
+        printf("Expected NULL got not NULL!\n");
+        return EINVAL;
+    }
+
     /* We will check just permissions here. */
     error = ini_config_access_check(file_ctx,
                                 INI_ACCESS_CHECK_MODE, /* add uid & gui flags
@@ -1125,6 +1132,16 @@ int startup_test(void)
         return error;
     }
 
+    /* Get stats */
+    file_stat = ini_config_get_stat(file_ctx);
+    if (!file_stat) {
+        printf("Expected not NULL got NULL!\n");
+        return EINVAL;
+    }
+
+    INIOUT(printf("File was modified at: %d seconds since Jan 1 1970.\n",
+                  (int)(file_stat->st_mtime)));
+
     /* We will check just permissions here. */
     error = ini_config_access_check(file_ctx,
                                 INI_ACCESS_CHECK_MODE, /* add uid & gui flags

commit 059519fb2a8d056eba5f61cde98ed8b5292195d4
Author: Dmitri Pal <dpal at redhat.com>
Date:   Sat Jan 26 16:47:56 2013 -0500

    Check is the stats we collected
    
    This patch corrects a problem related to stats being accessed
    and evaluated without being initialized.

diff --git a/ini/ini_config_priv.h b/ini/ini_config_priv.h
index 31cee84..89ad8a9 100644
--- a/ini/ini_config_priv.h
+++ b/ini/ini_config_priv.h
@@ -69,6 +69,8 @@ struct ini_cfgfile {
     /**********************/
     /* File stats */
     struct stat file_stats;
+    /* Were stats read ? */
+    int stats_read;
 };
 
 /* Parsing error */
diff --git a/ini/ini_fileobj.c b/ini/ini_fileobj.c
index 677383c..7d2011a 100644
--- a/ini/ini_fileobj.c
+++ b/ini/ini_fileobj.c
@@ -76,6 +76,8 @@ static int common_file_init(struct ini_cfgfile *file_ctx)
         return error;
     }
 
+    file_ctx->stats_read = 0;
+
     /* Collect stats */
     if (file_ctx->metadata_flags & INI_META_STATS) {
         errno = 0;
@@ -85,6 +87,7 @@ static int common_file_init(struct ini_cfgfile *file_ctx)
             TRACE_ERROR_NUMBER("Failed to get file stats.", error);
             return error;
         }
+        file_ctx->stats_read = 1;
     }
     else memset(&(file_ctx->file_stats), 0, sizeof(struct stat));
 
@@ -231,7 +234,11 @@ int ini_config_access_check(struct ini_cfgfile *file_ctx,
     if ((file_ctx == NULL) || (flags == 0)) {
         TRACE_ERROR_NUMBER("Invalid parameter.", EINVAL);
         return EINVAL;
+    }
 
+    if (file_ctx->stats_read == 0) {
+        TRACE_ERROR_NUMBER("Stats were not collected.", EINVAL);
+        return EINVAL;
     }
 
     /* Check mode */
@@ -304,6 +311,12 @@ int ini_config_changed(struct ini_cfgfile *file_ctx1,
         return EINVAL;
     }
 
+    if ((file_ctx1->stats_read == 0) ||
+        (file_ctx2->stats_read == 0)) {
+        TRACE_ERROR_NUMBER("Stats were not collected.", EINVAL);
+        return EINVAL;
+    }
+
     *changed = 0;
 
     /* Unfortunately the time is not granular enough
diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c
index 002fdd5..c5e9166 100644
--- a/ini/ini_parse_ut.c
+++ b/ini/ini_parse_ut.c
@@ -1085,6 +1085,36 @@ int startup_test(void)
         return error;
     }
 
+    /* Open config file not collecting stats */
+    error = ini_config_file_open(outfile,
+                                 0,
+                                 &file_ctx);
+    if (error) {
+        printf("Failed to open file %s for reading. Error %d.\n",
+               outfile, error);
+        return error;
+    }
+
+    /* We will check just permissions here. */
+    error = ini_config_access_check(file_ctx,
+                                INI_ACCESS_CHECK_MODE, /* add uid & gui flags
+                                                        * in real case
+                                                        */
+                                0, /* <- will be real uid in real case */
+                                0, /* <- will be real gid in real case */
+                                0440, /* Checking for r--r----- */
+                                0);
+    /* This check is expected to fail since
+     * we did not collect stats
+     */
+    ini_config_file_destroy(file_ctx);
+
+    if (!error) {
+        printf("Expected error got success!\n");
+        return EACCES;
+    }
+
+
     /* Open config file */
     error = ini_config_file_open(outfile,
                                  INI_META_STATS,

commit 66e30c2f3862093505a8497744207d2812c95be3
Author: Dmitri Pal <dpal at redhat.com>
Date:   Tue Dec 25 09:31:07 2012 -0500

    Unit test for parsing flags.
    
    Added unit test.

diff --git a/Makefile.am b/Makefile.am
index 2b30cdc..4a50c84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -258,6 +258,7 @@ dist_noinst_DATA += \
     ini/ini.d/sexpect.conf \
     ini/ini.d/first.conf \
     ini/ini.d/second.conf \
+    ini/ini.d/space.conf \
     ini/ini.d/mergecheck.conf
 
 check_PROGRAMS += \
diff --git a/ini/ini.d/space.conf b/ini/ini.d/space.conf
new file mode 100644
index 0000000..1ac58c3
--- /dev/null
+++ b/ini/ini.d/space.conf
@@ -0,0 +1,5 @@
+    spaces = value
+	tab = value
+	 	 	 tab_and_space = value
+ 	 	 	 space_and_tab = value
+
diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c
index e31b356..002fdd5 100644
--- a/ini/ini_parse_ut.c
+++ b/ini/ini_parse_ut.c
@@ -2520,6 +2520,88 @@ int get_test(void)
     return EOK;
 }
 
+int space_test(void)
+{
+
+    int error;
+    struct ini_cfgfile *file_ctx = NULL;
+    struct ini_cfgobj *ini_config = NULL;
+    char **error_list = NULL;
+    char infile[PATH_MAX];
+    char *srcdir = NULL;
+    unsigned errnum;
+    int i;
+    uint32_t flags[] = { INI_PARSE_NOWRAP,
+                         INI_PARSE_NOWRAP |
+                         INI_PARSE_NOSPACE,
+                         INI_PARSE_NOWRAP |
+                         INI_PARSE_NOTAB,
+                         INI_PARSE_NOWRAP |
+                         INI_PARSE_NOSPACE |
+                         INI_PARSE_NOTAB };
+
+    INIOUT(printf("\n\n<==== SPACE TEST START =====>\n"));
+
+    srcdir = getenv("srcdir");
+    snprintf(infile, PATH_MAX, "%s/ini/ini.d/space.conf",
+             (srcdir == NULL) ? "." : srcdir);
+
+
+    for (i = 0; i < 4; i++ ) {
+
+        INIOUT(printf("Reading file %s\n", infile));
+        error = ini_config_file_open(infile,
+                                        0,
+                                        &file_ctx);
+        if (error) {
+            printf("Failed to open file for reading. Error %d.\n",  error);
+            return error;
+        }
+
+        INIOUT(printf("Creating configuration object\n"));
+        error = ini_config_create(&ini_config);
+        if (error) {
+            printf("Failed to create object. Error %d.\n", error);
+            ini_config_file_destroy(file_ctx);
+            return error;
+        }
+        INIOUT(printf("Parsing\n"));
+        error = ini_config_parse(file_ctx,
+                                 INI_STOP_ON_NONE,
+                                 0,
+                                 flags[i],
+                                 ini_config);
+        if (error) {
+            INIOUT(printf("Failed to parse configuration. Error %d.\n", error));
+
+            errnum = ini_config_error_count(ini_config);
+            if (errnum) {
+                INIOUT(printf("Errors detected while parsing: %s\n",
+                       ini_config_get_filename(file_ctx)));
+                ini_config_get_errors(ini_config, &error_list);
+                INIOUT(ini_config_print_errors(stdout, error_list));
+                ini_config_free_errors(error_list);
+            }
+            if (((i == 0) && (errnum != 0)) ||
+                ((i == 1) && (errnum != 3)) ||
+                ((i == 2) && (errnum != 3)) ||
+                ((i == 3) && (errnum != 4))) {
+                printf("Failed to open file for reading. Error %d.\n",  error);
+                ini_config_file_destroy(file_ctx);
+                ini_config_destroy(ini_config);
+                return -1;
+            }
+            /* We do not return here intentionally */
+        }
+
+        INIOUT(col_debug_collection(ini_config->cfg, COL_TRAVERSE_DEFAULT));
+        ini_config_destroy(ini_config);
+        ini_config_file_destroy(file_ctx);
+    }
+
+    INIOUT(printf("\n<==== SPACE TEST END =====>\n\n"));
+    return EOK;
+}
 
 /* Main function of the unit test */
 int main(int argc, char *argv[])
@@ -2533,6 +2615,7 @@ int main(int argc, char *argv[])
                         startup_test,
                         reload_test,
                         get_test,
+                        space_test,
                         NULL };
     test_fn t;
     int i = 0;

commit 6823d7104cca0f8ac22ed9432ee8a2f1a0d9124a
Author: Dmitri Pal <dpal at redhat.com>
Date:   Mon Dec 24 17:45:00 2012 -0500

    More interface refactoring
    
    I also realized that error list processing should not be
    bound to the file object.
    This patch corrects that by moving the error_list and
    corresponding count from file object to the config object.
    Things updated by the patch:
    1. The internal variables are moved from file obj to config obj.
    2. The external header is updated to reflect the change
    3. Functions are moved from file obj module to config obj module.
    4. Parser code is updated because error validation was in
       the wrong place
    5. Unit test is adjusted to get error list from the right object.
    
    I had to adjust the copy function for the config object.
    Copy function does not copy over the error list.

diff --git a/ini/ini_config_priv.h b/ini/ini_config_priv.h
index ee6a4d7..31cee84 100644
--- a/ini/ini_config_priv.h
+++ b/ini/ini_config_priv.h
@@ -42,6 +42,10 @@ struct ini_cfgobj {
     int section_len;
     int name_len;
     struct collection_iterator *iterator;
+    /* Collection of errors detected during parsing */
+    struct collection_item *error_list;
+    /* Count of error lines */
+    unsigned count;
 



More information about the Pkg-sssd-devel mailing list