~jamesodhunt/upstart/test-quiesce-cleanup

« back to all changes in this revision

Viewing changes to lib/run_abi_checker.sh.in

  • Committer: Scott James Remnant
  • Date: 2009-07-08 19:43:16 UTC
  • Revision ID: scott@netsplit.com-20090708194316-t6rw4e8auuza6qju
* conf/control-alt-delete.conf: Default job for Control-Alt-Delete
* conf/rc-sysinit.conf: Default job for system initialisation
* conf/rc.conf: A fully wacky instance job that runs the rc script
for runlevel changes
* conf/rcS.conf: And a job for single-user-mode, which calls back
to rc-sysinit
* conf/Makefile.am (dist_init_DATA): Install the default files
into the /etc/init directory
* configure.ac (AC_CONFIG_FILES): Create conf/Makefile
* Makefile.am (SUBDIRS): Recurse into the conf directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
#---------------------------------------------------------------------
3
 
# Script to run abi-compliance-checker to ensure ABI not broken.
4
 
#---------------------------------------------------------------------
5
 
# Copyright (C) 2013 Canonical Ltd.
6
 
#
7
 
# Author: James Hunt <james.hunt@canonical.com>
8
 
#
9
 
# This program is free software: you can redistribute it and/or modify
10
 
# it under the terms of the GNU General Public License as published by
11
 
# the Free Software Foundation, version 3 of the License.
12
 
#
13
 
# This program is distributed in the hope that it will be useful,
14
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
# GNU General Public License for more details.
17
 
#
18
 
# You should have received a copy of the GNU General Public License
19
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
#
21
 
#---------------------------------------------------------------------
22
 
 
23
 
die()
24
 
{
25
 
    msg="$*"
26
 
    echo "ERROR: $msg" >&2
27
 
    exit 1
28
 
}
29
 
 
30
 
build_dir="@abs_builddir@"
31
 
source_dir="@abs_srcdir@"
32
 
acc="@abi_compliance_checker@"
33
 
acc_descriptor="@abi_build_XML@"
34
 
libupstart_libtool="@libupstart@"
35
 
lib_prefix="${libupstart_libtool%.la}"
36
 
libupstart_lt_version="@libupstart_version@"
37
 
old_abi="@abi_official@"
38
 
 
39
 
# convert libtool(1) version to dotted form
40
 
dotted_version=$(echo "$libupstart_lt_version"|tr ':' '.')
41
 
 
42
 
libupstart_path="$build_dir/$libupstart_libtool"
43
 
 
44
 
echo "Checking ABI for $lib_prefix"
45
 
echo
46
 
 
47
 
for file in "$libupstart_path" "$old_abi"
48
 
do
49
 
    [ -f "$file" ] || die "file $file not found"
50
 
done
51
 
 
52
 
# Install the library to a temporary location since we need the
53
 
# full path to the shared library to pass to abi-compliance-checker.
54
 
install_dir=$(mktemp -d --tmpdir="$build_dir")
55
 
[ -z "$install_dir" ] && \
56
 
        die "failed to create temporary install directory"
57
 
 
58
 
libtool --mode=install install \
59
 
    "$libupstart_libtool" "$install_dir" >/dev/null 2>&1
60
 
 
61
 
abi_dump_dir=$(mktemp -d --tmpdir="$build_dir")
62
 
[ -z "$abi_dump_dir" ] && \
63
 
        die "failed to create temporary dump directory"
64
 
 
65
 
abi_dump_path="$abi_dump_dir/${lib_prefix}_${dotted_version}.abi.tar.gz"
66
 
 
67
 
installed_so="$install_dir/$(echo "$lib_prefix"|cut -d\. -f1).so"
68
 
 
69
 
[ -f "$installed_so" ] || die "cannot find $installed_so"
70
 
 
71
 
# generate a descriptor for the newly-built library version
72
 
"$acc" -library "$lib_prefix" -dump "$acc_descriptor" -dump-path "$abi_dump_path"
73
 
 
74
 
new_abi="$abi_dump_dir/${lib_prefix}_${dotted_version}.abi.tar.gz"
75
 
[ -f "$new_abi" ] || die "cannot find $new_abi"
76
 
 
77
 
# run the ABI checker
78
 
"$acc" -library "$lib_prefix" -old "$old_abi" -new "$new_abi"
79
 
 
80
 
# clean up
81
 
libtool --mode=uninstall \
82
 
    rm "$install_dir/$libupstart_libtool" >/dev/null 2>&1
83
 
 
84
 
rm -rf "$abi_dump_dir" "$build_dir/logs" "$install_dir"
85
 
 
86
 
# HTML report generated by $acc
87
 
rm -rf compat_reports/