Skip to content
Commits on Source (2)
......@@ -4,6 +4,9 @@ Libvirt Message Translation
Libvirt translatable messages are maintained using the GNU Gettext tools and
file formats, in combination with the Zanata web service.
python-zanata-client is required in order to use make to pull/push translations
from/to Zanata server.
Source repository
=================
......
......@@ -19,6 +19,7 @@ Daniel Veillard <veillard@redhat.com>
Doug Goldstein <cardoe@gentoo.org>
Eric Blake <eblake@redhat.com>
Erik Skultety <eskultet@redhat.com>
Fabiano Fidêncio <fidencio@redhat.com>
Gao Feng <gaofeng@cn.fujitsu.com>
Guido Günther <agx@sigxcpu.org>
Ján Tomko <jtomko@redhat.com>
......@@ -111,6 +112,8 @@ Amy Fong <amy.fong@windriver.com>
Amy Griffis <amy.griffis@hp.com>
Anatole Denis <natolumin@gmail.com>
Andres Lagar-Cavilla <andres@lagarcavilla.org>
Andrew Miloradovsky <andrew@interpretmath.pw>
Ani Sinha <ani.sinha@nutanix.com>
Anirban Chakraborty <abchak@juniper.net>
Ansis Atteka <aatteka@nicira.com>
Anthony PERARD <anthony.perard@citrix.com>
......@@ -146,6 +149,7 @@ Brian Candler <b.candler@pobox.com>
Brijesh Singh <brijesh.singh@amd.com>
Bryan Kearney <bkearney@redhat.com>
Cao jin <caoj.fnst@cn.fujitsu.com>
Carlos Santos <casantos@redhat.com>
Casey Callendrello <cdc@redhat.com>
Cedric Bosdonnat <cbosdonnat@suse.com>
Chang Liu <lingjiao.lc@taobao.com>
......@@ -156,6 +160,7 @@ Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Chen Hanxiao <chenhanxiao@gmail.com>
Cheng Lin <cheng.lin130@zte.com.cn>
Chris Coulson <chris.coulson@canonical.com>
Chris J Arges <chris.j.arges@canonical.com>
Chris St. Pierre <chris.a.st.pierre@gmail.com>
Chris Venteicher <cventeic@redhat.com>
......@@ -173,6 +178,7 @@ Clark Laughlin <clark.laughlin@linaro.org>
Claudio André <claudioandre.br@gmail.com>
Clementine Hayat <clem@lse.epita.fr>
Collin L. Walling <walling@linux.vnet.ibm.com>
Collin Walling <walling@linux.ibm.com>
Conrad Meyer <cse.cem@gmail.com>
Corey S. McQuay <csmcquay@linux.vnet.ibm.com>
Cristian Klein <cristiklein@gmail.com>
......@@ -212,6 +218,7 @@ Dipankar Sarma <dipankar@in.ibm.com>
Dirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
Dmitry Andreev <dandreev@virtuozzo.com>
Dmitry Mishin <dim@virtuozzo.com>
Dominick Grift <dac.override@gmail.com>
Dominik Perpeet <dperpeet@redhat.com>
Don Dugger <n0ano@n0ano.com>
Doug Goldstein <cardoe@cardoe.com>
......@@ -229,12 +236,12 @@ Eduardo Otubo <otubo@linux.vnet.ibm.com>
Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>
Eli Qiao <liyong.qiao@intel.com>
Eli Qiao <taget@linux.vnet.ibm.com>
Eric Farman <farman@linux.ibm.com>
Eric Farman <farman@linux.vnet.ibm.com>
Eric W. Biederman <ebiederm@xmission.com>
Ersek Laszlo <lacos@caesar.elte.hu>
Eugen Feller <eugen.feller@inria.fr>
Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Fabiano Fidêncio <fidencio@redhat.com>
Farhan Ali <alifm@linux.ibm.com>
Farhan Ali <alifm@linux.vnet.ibm.com>
Federico Simoncelli <fsimonce@redhat.com>
......@@ -263,6 +270,7 @@ Gerd v. Egidy <gerd@egidy.de>
Gerhard Stenzel <gerhard.stenzel@de.ibm.com>
Giuseppe Scrivano <gscrivan@redhat.com>
Gordon Messmer <gordon@dragonsdawn.net>
Gregor Kopka <gregor@kopka.net>
Guan Qiang <hzguanqiang@corp.netease.com>
Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Han Cheng <hanc.fnst@cn.fujitsu.com>
......@@ -291,6 +299,7 @@ Ilias Stamatis <stamatis.iliass@gmail.com>
Ilja Livenson <ilja.livenson@gmail.com>
Ishmanpreet Kaur Khera <khera.ishman@gmail.com>
Ivan Baldo <ibaldo@adinet.com.uy>
Ivan Kardykov <kardykov@tabit.pro>
J.B. Joret <jb@linux.vnet.ibm.com>
James Chapman <james.p.chapman@intel.com>
James Cowgill <james410@cowgill.org.uk>
......@@ -312,7 +321,9 @@ Jean-Marc Liger <jean-marc.liger@parisdescartes.fr>
Jeremy Fitzhardinge <jeremy@goop.org>
Jesse Cook <code.crashenx@gmail.com>
Jesse J. Cook <jesse.j.cook@member.fsf.org>
Jiang Kun <jiang.kun2@zte.com.cn>
Jianwei Hu <jiahu@redhat.com>
Jidong Xia <xiajidong@cmss.chinamobile.com>
Jie Wang <wangjie88@huawei.com>
JieWang <wangjie88@huawei.com>
Jim Paris <jim@jtan.com>
......@@ -351,6 +362,7 @@ Kyle DeFrancia <kdef@linux.vnet.ibm.com>
Kyle Mestery <kmestery@cisco.com>
Ladi Prosek <lprosek@redhat.com>
Lai Jiangshan <laijs@cn.fujitsu.com>
LanceLiu <liu.lance.89@gmail.com>
Laszlo Ersek <lersek@redhat.com>
Laurent Bigonville <bigon@bigon.be>
Laurent Léonard <laurent@open-minds.org>
......@@ -373,7 +385,9 @@ Lénaïc Huard <lenaic@lhuard.fr.eu.org>
MATSUDA Daiki <matsudadik@intellilink.co.jp>
MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Maciej Wolny <maciej.wolny@codethink.co.uk>
Malina Salina <malina.salina@protonmail.com>
Manuel VIVES <manuel.vives@diateam.net>
Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Marc Hartmayer <mhartmay@linux.ibm.com>
Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Marc-André Lureau <marcandre.lureau@redhat.com>
......@@ -402,6 +416,7 @@ Maxim Perevedentsev <mperevedentsev@virtuozzo.com>
Maxime Leroy <maxime.leroy@6wind.com>
Maximilian Wilhelm <max@rfc2324.org>
Maxiwell S. Garcia <maxiwell@linux.ibm.com>
Maya Rashish <coypu@sdf.org>
Mehdi Abaakouk <sileht@redhat.com>
Michael Avdienko <whitearchey@gmail.com>
Michael Chapman <mike@very.puzzling.org>
......@@ -415,6 +430,7 @@ Michal Novotny <minovotn@redhat.com>
Michał Łomnicki <michal.lomnicki@gmail.com>
Michel Normand <normand@linux.vnet.ibm.com>
Michele Paolino <m.paolino@virtualopensystems.com>
Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
Mike Latimer <mlatimer@suse.com>
Mike Perez <thingee@gmail.com>
Mikhail Feoktistov <mfeoktistov@parallels.com>
......@@ -456,6 +472,7 @@ Paul Eggert <eggert@cs.ucla.edu>
Pavel Boldin <pboldin@mirantis.com>
Pavel Fedin <p.fedin@samsung.com>
Pavel Glushchak <pglushchak@virtuozzo.com>
Pavel Mores <pmores@redhat.com>
Pavel Raiskup <praiskup@redhat.com>
Pavel Timofeev <timp87@gmail.com>
Paweł Krześniak <pawel.krzesniak@gmail.com>
......@@ -514,6 +531,7 @@ Scott Garfinkle <scottgar@linux.vnet.ibm.com>
Scott Garfinkle <seg@us.ibm.com>
Scott Moser <smoser@ubuntu.com>
Scott Sullivan <ssullivan@liquidweb.com>
Sebastian Mitterle <smitterl@redhat.com>
Sebastian Wiedenroth <wiedi@frubar.net>
Serge E. Hallyn <serge.hallyn@canonical.com>
Serge Hallyn <serge.hallyn@ubuntu.com>
......@@ -620,6 +638,7 @@ Xian Han Yu <xhyubj@linux.vnet.ibm.com>
Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
Xing Lin <xinglin@cs.utah.edu>
Xu He Jie <xuhj@linux.vnet.ibm.com>
Xu Yandong <xuyandong2@huawei.com>
Xuesong Zhang <xuzhang@redhat.com>
Yan Fu <yafu@redhat.com>
Yanbing Du <ydu@redhat.com>
......@@ -629,6 +648,7 @@ Yanqiu Zhang <yanqzhan@redhat.com>
Yi Li <yili@winhong.com>
Yi Min Zhao <zyimin@linux.ibm.com>
Yi Wang <wang.yi59@zte.com.cn>
Yingle Hou <houyingle@hygon.cn>
Yogesh Tillu <tillu.yogesh@gmail.com>
Yohan BELLEGUIC <yohan.belleguic@diateam.net>
Yudai Yamagish <yummy@sfc.wide.ad.jp>
......@@ -654,8 +674,10 @@ Zhou yimin <zhouyimin@huawei.com>
Zhuang Yanying <ann.zhuangyanying@huawei.com>
caoxinhua <caoxinhua@huawei.com>
dann frazier <dann.frazier@canonical.com>
eater <=@eater.me>
gaohaifeng <gaohaifeng.gao@huawei.com>
hejia hejia <jiakernel@gmail.com>
hexin <hexin15@baidu.com>
ik.nitk <ik.nitk@gmail.com>
intrigeri <intrigeri@boum.org>
intrigeri <intrigeri@debian.org>
......
......@@ -19,6 +19,7 @@ Daniel Veillard <veillard@redhat.com>
Doug Goldstein <cardoe@gentoo.org>
Eric Blake <eblake@redhat.com>
Erik Skultety <eskultet@redhat.com>
Fabiano Fidêncio <fidencio@redhat.com>
Gao Feng <gaofeng@cn.fujitsu.com>
Guido Günther <agx@sigxcpu.org>
Ján Tomko <jtomko@redhat.com>
......
......@@ -20,6 +20,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
_build-aux ?= build-aux
_autoreconf ?= autoreconf -v
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
_gl-Makefile := $(wildcard [M]akefile)
......@@ -32,57 +35,7 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
ALL_RECURSIVE_TARGETS =
include Makefile
# Some projects override e.g., _autoreconf here.
-include $(srcdir)/cfg.mk
# Allow cfg.mk to override these.
_build-aux ?= build-aux
_autoreconf ?= autoreconf -v
include $(srcdir)/maint.mk
# Ensure that $(VERSION) is up to date for dist-related targets, but not
# for others: rerunning autoreconf and recompiling everything isn't cheap.
_have-git-version-gen := \
$(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
_is-dist-target ?= $(filter-out %clean, \
$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
_is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
ifneq (,$(_is-dist-target)$(_is-install-target))
_curr-ver := $(shell cd $(srcdir) \
&& $(_build-aux)/git-version-gen \
.tarball-version \
$(git-version-gen-tag-sed-script))
ifneq ($(_curr-ver),$(VERSION))
ifeq ($(_curr-ver),UNKNOWN)
$(info WARNING: unable to verify if $(VERSION) is the correct version)
else
ifneq (,$(_is-install-target))
# GNU Coding Standards state that 'make install' should not cause
# recompilation after 'make all'. But as long as changing the version
# string alters config.h, the cost of having 'make all' always have an
# up-to-date version is prohibitive. So, as a compromise, we merely
# warn when installing a version string that is out of date; the user
# should run 'autoreconf' (or something like 'make distcheck') to
# fix the version, 'make all' to propagate it, then 'make install'.
$(info WARNING: version string $(VERSION) is out of date;)
$(info run '$(MAKE) _version' to fix it)
else
$(info INFO: running autoreconf for new version string: $(_curr-ver))
GNUmakefile: _version
touch GNUmakefile
endif
endif
endif
endif
endif
.PHONY: _version
_version:
cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
$(MAKE) $(AM_MAKEFLAGS) Makefile
include $(srcdir)/$(_build-aux)/syntax-check.mk
else
......@@ -90,13 +43,7 @@ else
srcdir = .
# The package can override .DEFAULT_GOAL to run actions like autoreconf.
-include ./cfg.mk
# Allow cfg.mk to override these.
_build-aux ?= build-aux
_autoreconf ?= autoreconf -v
include ./maint.mk
include $(srcdir)/$(_build-aux)/syntax-check.mk
ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
$(MAKECMDGOALS): abort-due-to-no-makefile
......
......@@ -16,15 +16,19 @@
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
LCOV = lcov
GENHTML = genhtml
# when building from tarball -Werror isn't auto enabled
# so force it explicitly
DISTCHECK_CONFIGURE_FLAGS = --enable-werror
SUBDIRS = . gnulib/lib include/libvirt src tools docs gnulib/tests \
tests po examples
XZ_OPT ?= -v -T0
export XZ_OPT
# have gnulib 'make coverage' output to 'cov' dir
COVERAGE_OUT = "cov"
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
......@@ -35,22 +39,44 @@ EXTRA_DIST = \
libvirt-qemu.pc.in \
libvirt-lxc.pc.in \
libvirt-admin.pc.in \
Makefile.ci \
Makefile.nonreentrant \
autogen.sh \
cfg.mk \
GNUmakefile \
run.in \
README.md \
AUTHORS.in \
build-aux/augeas-gentest.pl \
scripts/apibuild.py \
scripts/augeas-gentest.py \
build-aux/check-spacing.pl \
build-aux/gitlog-to-changelog \
build-aux/header-ifdef.pl \
build-aux/minimize-po.pl \
build-aux/mock-noinline.pl \
build-aux/prohibit-duplicate-header.pl \
scripts/check-aclperms.py \
scripts/check-aclrules.py \
scripts/check-drivername.py \
scripts/check-driverimpls.py \
scripts/check-file-access.py \
scripts/check-remote-protocol.py \
scripts/check-symfile.py \
scripts/check-symsorting.py \
scripts/dtrace2systemtap.py \
scripts/esx_vi_generator.py \
scripts/genaclperms.py \
scripts/genpolkit.py \
scripts/gensystemtap.py \
scripts/group-qemu-caps.py \
scripts/header-ifdef.py \
scripts/hvsupport.py \
scripts/hyperv_wmi_generator.py \
scripts/minimize-po.py \
scripts/mock-noinline.py \
scripts/prohibit-duplicate-header.py \
scripts/reformat-news.py \
scripts/test-wrap-argv.py \
build-aux/syntax-check.mk \
build-aux/useless-if-before-free \
build-aux/vc-list-files \
ci/Makefile \
ci/build.sh \
ci/list-images.sh \
ci/prepare.sh \
$(NULL)
pkgconfigdir = $(libdir)/pkgconfig
......@@ -59,7 +85,7 @@ pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc libvirt-admin.pc
NEWS: \
$(srcdir)/docs/news.xml \
$(srcdir)/docs/news-ascii.xsl \
$(srcdir)/docs/reformat-news.py
$(top_srcdir)/scripts/reformat-news.py
$(AM_V_GEN) \
if [ -x $(XSLTPROC) ]; then \
$(XSLTPROC) --nonet \
......@@ -67,14 +93,14 @@ NEWS: \
$(srcdir)/docs/news.xml \
>$@-tmp \
|| { rm -f $@-tmp; exit 1; }; \
$(PYTHON) $(srcdir)/docs/reformat-news.py $@-tmp >$@ \
$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/reformat-news.py $@-tmp >$@ \
|| { rm -f $@-tmp; exit 1; }; \
rm -f $@-tmp; \
fi
EXTRA_DIST += \
$(srcdir)/docs/news.xml \
$(srcdir)/docs/news-ascii.xsl \
$(srcdir)/docs/reformat-news.py
$(NULL)
rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.xz)
......@@ -87,8 +113,26 @@ check-local: all tests
check-access: all
@($(MAKE) $(AM_MAKEFLAGS) -C tests check-access)
cov: clean-cov
$(MKDIR_P) $(top_builddir)/coverage
$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \
-d $(top_builddir)/src \
-d $(top_builddir)/tests
$(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \
-o $(top_builddir)/coverage/libvirt.info
rm $(top_builddir)/coverage/libvirt.info.tmp
$(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \
--legend $(top_builddir)/coverage/libvirt.info
clean-cov:
rm -rf $(top_builddir)/coverage
MAINTAINERCLEANFILES = .git-module-status
distclean-local: clean-GNUmakefile
clean-GNUmakefile:
test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS
......@@ -109,4 +153,4 @@ gen-AUTHORS:
fi
ci-%:
$(MAKE) -f Makefile.ci $@
$(MAKE) -C $(srcdir)/ci/ $@
This diff is collapsed.
libvirt releases
================
# v6.0.0 (unreleased)
* New features
- docs: the python docutils toolset is now required
The use of rst2html has been introduced for the website build process
since docs are now being written in the RST as an alternative to HTML.
- new PCI hostdev address type: unassigned
A new PCI hostdev address type 'unassigned' is introduced. An
unassigned PCI hostdev behaves like any regular PCI hostdev inside
Libvirt, but it is not usable by the guest. This gives the user a new
option to manage the binding of PCI devices via Libvirt, declaring PCI
hostdevs in the domain XML but allowing just a subset of them to be
assigned to the guest.
* Improvements
- qemu: xz save image compression is faster
When using the xz format to compressed virtual machine saved state
images, the "-3" compression level preset is now used. This results in
slightly larger files, but with a massively reduced time to compress.
The xz format offers the best compression level for saved state images,
albeit still with the slowest running time. For the fastest possible
running time, at cost of the larest compressed size, lzop should be
used.
* Bug fixes
* Removed features
- support for python2 is removed
Libvirt is no longer able to be built using the Python 2 binary. Python
3 must be used instead.
- 'phyp' Power Hypervisor driver removed
The 'phyp' Power Hypervisor driver has not seen active development
since 2011 and does not seem to have any real world usage. It has now
been removed.
# v5.10.0 (2019-12-02)
* New features
- qemu: Introduce support for ARM CPU features
The only features supported at the moment are SVE vector lengths, which
were introduced in QEMU 4.2.0.
- qemu: Support boot display for GPU mediated devices
Until now, GPU mediated devices generally did not show any output until
the guest OS had initialized the vGPU. By specifying the ramfb
attribute, QEMU can be configured to use ramfb as a boot display for
the device: this allows for display of firmware messages, boot loader
menu, and other output before the guest OS has initialized the vGPU.
- Add API to change the response timeout for guest agent commands
By default, when a command is sent to the guest agent, libvirt waits
forever for a response from the guest agent. If the guest is
unresponsive for any reason, this can block the calling thread
indefinitely. By setting a custom timeout using
virDomainAgentSetResponseTimeout(), API users can change this behavior.
* Improvements
- Devices CGroup v2 support
Libvirt supported all controllers of CGroup v2 but the devices
controller which is implemented in this release.
- Cold plug of sound device
The QEMU driver now can handle cold plug of <sound/> devices.
- Probe for default CPU types
With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
a particular machine type and store it in the domain XML. This way the
chosen CPU model is more visible to users and libvirt will make sure
the guest will see the exact same CPU after migration.
- Adaptation to qemu's blockdev
QEMU introduced a new way of specifying disks on the command line which
enables fine-grained control over the block stack. Libvirt has adapted
to this.
* Refactors
- More GLib integration
More patches were merged that replace our internal functions with GLib
ones. Also some effort was invested in replacing gnulib modules with
GLib functions.
- Rewrite of Perl scripts into Python
Libvirt used Perl scripts to check for coding style, generate some code
and things like that. To bring the number of languages used down, these
scripts were rewritten into Python.
- Provide init scripts for sub-deaemons
So far libvirt shipped systemd unit files for sub-daemons. With this
release, init scripts are available too. Package maintainers can choose
which one to install via --with-init-script configure option.
* Bug fixes
- Warn verbosely if using old loader:nvram pairs
Some distributions still use --with-loader-nvram or nvram variable in
qemu.conf. This is now discouraged in favour of FW descriptors.
However, instead of silently ignoring user's config, libvirt warns if
outdated config is detected.
- Drop pconfig from Icelake-Server CPU model
The pconfig feature was enabled in QEMU by accident in 3.1.0. All other
newer versions do not support it and it was removed from the
Icelake-Server CPU model in QEMU.
- Wait longer for device removal confirmation on PPC64
After sending device hot unplug request to QEMU, libvirt waits up to 5
seconds for qemu to confirm the device removal. On some architectures
(like PPC64) this can take longer time and libvirt now reflects that.
- Forcibly create nodes in domain's namespace
The QEMU driver starts a domain in a namepsace with private /dev and
creates only those nodes there which the domain is configured to have.
However, it may have happened that if a node changed its minor number
this change wasn't propagated to the namespace.
- Various AppArmor bugfixes
The AppArmor driver now knows how to handle <shmem/> devices and also
snapshotting more disks at once.
- Improved video model autoselection
If a graphics device was added to XML that had no video device, libvirt
automatically added a video device which was always of type 'cirrus' on
x86_64, even if the underlying qemu didn't support cirrus. Libvirt now
bases the decision on qemu's capabilities.
# v5.9.0 (2019-11-05)
* Packaging changes
- Start linking against GLib and using its features
Up until now, libvirt has been dealing with platform portability and
the lack of certain features in libc by using gnulib and implementing
its own functions and data structures respectively; going forward, it
will prefer the facilities offered by GLib instead.
- Stop distributing generated documentation
Most downstreams already patch the libvirt source to some extent, so
this change will probably not affect them.
- Rewrite several Perl scripts in Python
Phasing out Perl usage is part of the project strategy.
* New features
- qemu: Introduce a new video model of type 'ramfb'
Introduce a new video model type to the domain XML that supports the
ramfb standalone device in qemu.
- qemu: Implement the ccf-assist pSeries feature
Users can now decide whether ccf-assist (Count Cache Flush Assist)
support should be available to pSeries guests.
- Xen: Support specifying ACPI firmware path
The libxl driver now supports specifying an ACPI firmware path using
the acpi element.
- qemu: Support specifying resolution for video devices
* Removed features
- logging: Drop support for including stack traces
This feature was intended to aid debugging, but in practice it resulted
in logs that were too verbose to be useful and also resulted in a
significant performance penalty.
* Improvements
- qemu: Implement CPU comparison/baseline on s390x
This functionality has been historically limited to x86_64, but it's
now available on s390x too.
* Bug fixes
- lib: autostart objects exactly once
If libvirtd or any of the sub-daemons is started with socket activation
then objects might be autostarted more than once. For instance, if a
domain under qemu:///session URI is mark as autostarted and the session
daemon is started then the domain is started with it. If user shuts the
domain down and the session daemon is started again, the user's wish to
keep the domain shut off is ignored and the domain is autostarted
again. This is now fixed.
- qemu: Properly advertise bochs-display availability
Support for bochs-display was introduced in libvirt 5.6.0, but until
now the model was not listed in the domain capabilities.
- security: Don't remember labels for TPM devices
Due to the way they're implemented in the kernel, trying to remember
labels for TPM devices makes it impossible to use them.
- security: Properly rollback after failure in a stacked driver
When multiple security drivers are involved, failure in one of them
would result in only the corresponding changes being rolled back,
leaving the ones performed by drivers that had been activated earlier
in place. All changes are rolled back now.
- Fix build with musl libc
- Improve compatibility with non-bash shells
# v5.8.0 (2019-10-05)
* New features
- qemu: Support use of precreated tap/macvtap devices by unprivileged
libvirtd
It is now possible for an unprivileged libvirtd to make use of tap and
macvtap devices that were previously created by some other entity. This
is done by setting managed='no' along with the device name in the
target subelement of <interface type='ethernet'>.
- qemu: Support vhost-user-gpu
Support for running virtio GPUs in separate processes with vhost-user
backend. It requires QEMU newer than 4.1.
- Introduce virConnectSetIdentity API
When split daemons are in use, this API is used to forward uid, gid and
SELinux info from virproxyd to other driver daemons such as virtqemud.
* Improvements
- qemu: Support running SLIRP networking in a separate process
User can configure the slirp-helper path in qemu.conf. It will start a
slirp-helper process to provide SLIRP networking when the VM is started
with network interface "user". That will allow stricter security
policies for QEMU SLIRP network.
* Removed features
- Remove xenapi driver
The xenapi driver is removed since it has not received any significant
development since its initial contribution nine years ago and has no
known user base.
# v5.7.0 (2019-09-03)
* New features
- qemu: Support Direct Mode for Hyper-V Synthetic timers
The QEMU driver now supports Direct Mode for Hyper-V Synthetic timers
for Hyper-V guests.
- lib: Add virDomainGetGuestInfo()
This API is intended to aggregate several guest agent information
queries and is inspired by stats API virDomainListGetStats(). It is
anticipated that this information will be provided by a guest agent
running within the domain. It's exposed as virsh guestinfo.
- Experimental split of libvirtd into separate daemons
The big monolithic libvirtd daemon can now be replaced by smaller
per-driver daemons. The new split daemons are considered experimental
at this time and distributions are encouraged to continue using the
traditional libvirtd by default.
- qemu: Support kvm-hint-dedicated performance hint
With <hint-dedicated state='on'/> and <cpu mode='host-passthrough'/>,
it allows a guest to enable optimizations when running on dedicated
vCPUs. QEMU newer than 2.12.0 and kernel newer than 4.17 are required.
* Removed features
- Remove KVM assignment support
The KVM style of PCI device assignment was removed from the kernel in
version 4.12.0 after being deprecated since 4.2.0. Libvirt defaults to
VFIO for a long time. Remove support for KVM device assignment from
libvirt too.
- libxml: min required libxml is now 2.9.1
Support for building with libxml versions older than 2.9.1 has been
dropped.
* Improvements
- virsh: Support setting bandwidth in migrate subcommand
In addition to postcopy bandwidth, the virsh migrate subcommand now
supports specifying precopy bandwidth with the --bandwidth parameter.
- libxl: Implement domain metadata getter/setter
The libxl driver now supports virDomainGetMetadata() and
virDomainSetMetadata() APIs.
- test driver: Expand API coverage
Additional APIs have been implemented in the test driver.
- Report RNG device in domain capabilities XML
Libvirt now reports if RNG devices are supported by the underlying
hypervisor in the domain capabilities XML.
- Stop linking NSS plugins with libvirt.so
This reduces the amount of code and 3rd party libraries are that loaded
into all processes.
- Split the setuid virt-login-shell binary into two pieces
The setuid virt-login-shell binary is now a tiny shim that sanitizes
the process execution environment variables and arguments, before
launching the trusted virt-login-shell-helper binary.
- qemu: Allow migration with disk cache on
When QEMU supports flushing caches at the end of migration, we can
safely allow migration even if disk/driver/@cache is neither none nor
directsync.
* Bug fixes
- Various security label remembering fixes
In the previous release libvirt introduced remembering of original
owners and SELinux labels on files. However, the feature did not work
properly with snapshots, on migrations or on network filesystems. This
is now fixed.
- Allow greater PCI domain numbers
Libvirt used to require PCI domain number to be not greater than
0xFFFF. The code was changed to allow 32 bits long numbers.
- Various D-Bus fixes
When D-Bus is not available, libvirt was reporting random errors. These
are now gone.
- Prefer read-only opening of PCI config files
When enumerating PCI bus, libvirt opens config files under sysfs mount
and parses them to learn various aspects of the device (e.g. its
capabilities). Only in a very limited number of cases it is actually
writing into the file. However, it used to open the file also for
writing even if it was only reading from it.
- Fix AppArmor profile
Since the 5.6.0 release, libvirt uses procfs to learn the list of
opened file descriptors when spawning a command. However, our AppArmor
profile was not allowing such access.
- Don't block storage driver when starting or building a pool
Starting or building a storage pool can take a long time to finish.
During this time the storage driver was blocked and thus no other API
involving the storage driver could run. This is now fixed.
# v5.6.0 (2019-08-05)
* New features
......
......@@ -38,11 +38,13 @@ Installation
------------
Libvirt uses the GNU Autotools build system, so in general can be built
and installed with the usual commands. For example, to build in a manner
that is suitable for installing as root, use:
and installed with the usual commands, however, we mandate to have the
build directory different than the source directory. For example, to build
in a manner that is suitable for installing as root, use:
```
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ mkdir build && cd build
$ ../configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install
```
......@@ -50,7 +52,8 @@ $ sudo make install
While to build & install as an unprivileged user
```
$ ./configure --prefix=$HOME/usr
$ mkdir build && cd build
$ ../configure --prefix=$HOME/usr
$ make
$ make install
```
......
......@@ -38,11 +38,13 @@ Installation
------------
Libvirt uses the GNU Autotools build system, so in general can be built
and installed with the usual commands. For example, to build in a manner
that is suitable for installing as root, use:
and installed with the usual commands, however, we mandate to have the
build directory different than the source directory. For example, to build
in a manner that is suitable for installing as root, use:
```
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ mkdir build && cd build
$ ../configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install
```
......@@ -50,7 +52,8 @@ $ sudo make install
While to build & install as an unprivileged user
```
$ ./configure --prefix=$HOME/usr
$ mkdir build && cd build
$ ../configure --prefix=$HOME/usr
$ make
$ make install
```
......
......@@ -1478,25 +1478,14 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/00gnulib.m4])
m4_include([m4/__inline.m4])
m4_include([m4/absolute-header.m4])
m4_include([m4/alloca.m4])
m4_include([m4/arpa_inet_h.m4])
m4_include([m4/asm-underscore.m4])
m4_include([m4/autobuild.m4])
m4_include([m4/base64.m4])
m4_include([m4/btowc.m4])
m4_include([m4/builtin-expect.m4])
m4_include([m4/byteswap.m4])
m4_include([m4/calloc.m4])
m4_include([m4/canonicalize.m4])
m4_include([m4/chown.m4])
m4_include([m4/clock_time.m4])
m4_include([m4/close.m4])
m4_include([m4/codeset.m4])
m4_include([m4/configmake.m4])
m4_include([m4/count-leading-zeros.m4])
m4_include([m4/count-one-bits.m4])
m4_include([m4/ctype.m4])
m4_include([m4/dirname.m4])
m4_include([m4/double-slash-root.m4])
......@@ -1506,37 +1495,20 @@ m4_include([m4/eealloc.m4])
m4_include([m4/environ.m4])
m4_include([m4/errno_h.m4])
m4_include([m4/error.m4])
m4_include([m4/execinfo.m4])
m4_include([m4/exponentd.m4])
m4_include([m4/exponentf.m4])
m4_include([m4/exponentl.m4])
m4_include([m4/extensions.m4])
m4_include([m4/extern-inline.m4])
m4_include([m4/fatal-signal.m4])
m4_include([m4/fclose.m4])
m4_include([m4/fcntl-o.m4])
m4_include([m4/fcntl.m4])
m4_include([m4/fcntl_h.m4])
m4_include([m4/fdatasync.m4])
m4_include([m4/fdopen.m4])
m4_include([m4/fflush.m4])
m4_include([m4/ffs.m4])
m4_include([m4/ffsl.m4])
m4_include([m4/flexmember.m4])
m4_include([m4/float_h.m4])
m4_include([m4/fnmatch.m4])
m4_include([m4/fnmatch_h.m4])
m4_include([m4/fpieee.m4])
m4_include([m4/fpurge.m4])
m4_include([m4/freading.m4])
m4_include([m4/fseek.m4])
m4_include([m4/fseeko.m4])
m4_include([m4/fstat.m4])
m4_include([m4/fsync.m4])
m4_include([m4/ftell.m4])
m4_include([m4/ftello.m4])
m4_include([m4/ftruncate.m4])
m4_include([m4/func.m4])
m4_include([m4/getaddrinfo.m4])
m4_include([m4/getcwd.m4])
m4_include([m4/getdelim.m4])
......@@ -1544,23 +1516,18 @@ m4_include([m4/getdtablesize.m4])
m4_include([m4/getgroups.m4])
m4_include([m4/gethostname.m4])
m4_include([m4/getline.m4])
m4_include([m4/getopt.m4])
m4_include([m4/getpagesize.m4])
m4_include([m4/getpass.m4])
m4_include([m4/getprogname.m4])
m4_include([m4/gettimeofday.m4])
m4_include([m4/getugroups.m4])
m4_include([m4/glibc21.m4])
m4_include([m4/gnulib-common.m4])
m4_include([m4/gnulib-comp.m4])
m4_include([m4/grantpt.m4])
m4_include([m4/host-cpu-c-abi.m4])
m4_include([m4/hostent.m4])
m4_include([m4/include_next.m4])
m4_include([m4/inet_ntop.m4])
m4_include([m4/inet_pton.m4])
m4_include([m4/intl-thread-locale.m4])
m4_include([m4/intlmacosx.m4])
m4_include([m4/intmax_t.m4])
m4_include([m4/inttypes-pri.m4])
m4_include([m4/inttypes.m4])
......@@ -1568,30 +1535,15 @@ m4_include([m4/inttypes_h.m4])
m4_include([m4/ioctl.m4])
m4_include([m4/isatty.m4])
m4_include([m4/isblank.m4])
m4_include([m4/isnand.m4])
m4_include([m4/isnanf.m4])
m4_include([m4/isnanl.m4])
m4_include([m4/langinfo_h.m4])
m4_include([m4/largefile.m4])
m4_include([m4/lcmessage.m4])
m4_include([m4/ldexp.m4])
m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
m4_include([m4/libtool.m4])
m4_include([m4/libunistring-base.m4])
m4_include([m4/limits-h.m4])
m4_include([m4/localcharset.m4])
m4_include([m4/locale-fr.m4])
m4_include([m4/locale-ja.m4])
m4_include([m4/locale-tr.m4])
m4_include([m4/locale-zh.m4])
m4_include([m4/locale_h.m4])
m4_include([m4/localeconv.m4])
m4_include([m4/localename.m4])
m4_include([m4/localtime-buffer.m4])
m4_include([m4/lock.m4])
m4_include([m4/longlong.m4])
m4_include([m4/lseek.m4])
m4_include([m4/lstat.m4])
m4_include([m4/ltoptions.m4])
......@@ -1601,19 +1553,8 @@ m4_include([m4/lt~obsolete.m4])
m4_include([m4/malloc.m4])
m4_include([m4/malloca.m4])
m4_include([m4/manywarnings.m4])
m4_include([m4/math_h.m4])
m4_include([m4/mbrtowc.m4])
m4_include([m4/mbsinit.m4])
m4_include([m4/mbsrtowcs.m4])
m4_include([m4/mbstate_t.m4])
m4_include([m4/mbtowc.m4])
m4_include([m4/memchr.m4])
m4_include([m4/mgetgroups.m4])
m4_include([m4/mkdir.m4])
m4_include([m4/mkdtemp.m4])
m4_include([m4/mkostemp.m4])
m4_include([m4/mkostemps.m4])
m4_include([m4/mktime.m4])
m4_include([m4/mmap-anon.m4])
m4_include([m4/mode_t.m4])
m4_include([m4/msvc-inval.m4])
......@@ -1623,11 +1564,10 @@ m4_include([m4/nanosleep.m4])
m4_include([m4/net_if_h.m4])
m4_include([m4/netdb_h.m4])
m4_include([m4/netinet_in_h.m4])
m4_include([m4/nl_langinfo.m4])
m4_include([m4/nocrash.m4])
m4_include([m4/nonblocking.m4])
m4_include([m4/off_t.m4])
m4_include([m4/open-cloexec.m4])
m4_include([m4/open-slash.m4])
m4_include([m4/open.m4])
m4_include([m4/passfd.m4])
m4_include([m4/pathmax.m4])
......@@ -1635,14 +1575,14 @@ m4_include([m4/perror.m4])
m4_include([m4/physmem.m4])
m4_include([m4/pipe.m4])
m4_include([m4/pipe2.m4])
m4_include([m4/po.m4])
m4_include([m4/poll.m4])
m4_include([m4/poll_h.m4])
m4_include([m4/posix-shell.m4])
m4_include([m4/posix_openpt.m4])
m4_include([m4/posix_spawn.m4])
m4_include([m4/printf.m4])
m4_include([m4/pthread.m4])
m4_include([m4/pthread-thread.m4])
m4_include([m4/pthread_h.m4])
m4_include([m4/pthread_rwlock_rdlock.m4])
m4_include([m4/pthread_sigmask.m4])
m4_include([m4/ptsname.m4])
......@@ -1653,21 +1593,16 @@ m4_include([m4/putenv.m4])
m4_include([m4/raise.m4])
m4_include([m4/rawmemchr.m4])
m4_include([m4/read.m4])
m4_include([m4/readlink.m4])
m4_include([m4/realloc.m4])
m4_include([m4/regex.m4])
m4_include([m4/sched_h.m4])
m4_include([m4/secure_getenv.m4])
m4_include([m4/select.m4])
m4_include([m4/servent.m4])
m4_include([m4/setenv.m4])
m4_include([m4/setlocale.m4])
m4_include([m4/sh-filename.m4])
m4_include([m4/sig_atomic_t.m4])
m4_include([m4/sigaction.m4])
m4_include([m4/signal_h.m4])
m4_include([m4/signalblocking.m4])
m4_include([m4/signbit.m4])
m4_include([m4/sigpipe.m4])
m4_include([m4/size_max.m4])
m4_include([m4/sleep.m4])
......@@ -1681,25 +1616,17 @@ m4_include([m4/ssize_t.m4])
m4_include([m4/stat-time.m4])
m4_include([m4/stat.m4])
m4_include([m4/stdalign.m4])
m4_include([m4/stdarg.m4])
m4_include([m4/stdbool.m4])
m4_include([m4/stddef_h.m4])
m4_include([m4/stdint.m4])
m4_include([m4/stdint_h.m4])
m4_include([m4/stdio_h.m4])
m4_include([m4/stdlib_h.m4])
m4_include([m4/stpcpy.m4])
m4_include([m4/strcase.m4])
m4_include([m4/strchrnul.m4])
m4_include([m4/strdup.m4])
m4_include([m4/strerror.m4])
m4_include([m4/strerror_r.m4])
m4_include([m4/string_h.m4])
m4_include([m4/strings_h.m4])
m4_include([m4/strndup.m4])
m4_include([m4/strnlen.m4])
m4_include([m4/strptime.m4])
m4_include([m4/strsep.m4])
m4_include([m4/strtok_r.m4])
m4_include([m4/symlink.m4])
m4_include([m4/sys_ioctl_h.m4])
......@@ -1711,14 +1638,10 @@ m4_include([m4/sys_types_h.m4])
m4_include([m4/sys_uio_h.m4])
m4_include([m4/sys_utsname_h.m4])
m4_include([m4/sys_wait_h.m4])
m4_include([m4/tempname.m4])
m4_include([m4/termios_h.m4])
m4_include([m4/thread.m4])
m4_include([m4/threadlib.m4])
m4_include([m4/time_h.m4])
m4_include([m4/time_r.m4])
m4_include([m4/timegm.m4])
m4_include([m4/tm_gmtoff.m4])
m4_include([m4/ttyname_r.m4])
m4_include([m4/uname.m4])
m4_include([m4/ungetc.m4])
......@@ -1726,7 +1649,6 @@ m4_include([m4/unistd_h.m4])
m4_include([m4/unlockpt.m4])
m4_include([m4/usleep.m4])
m4_include([m4/vasnprintf.m4])
m4_include([m4/vasprintf.m4])
m4_include([m4/virt-acl.m4])
m4_include([m4/virt-apparmor.m4])
m4_include([m4/virt-arg.m4])
......@@ -1755,19 +1677,18 @@ m4_include([m4/virt-driver-lxc.m4])
m4_include([m4/virt-driver-modules.m4])
m4_include([m4/virt-driver-network.m4])
m4_include([m4/virt-driver-openvz.m4])
m4_include([m4/virt-driver-phyp.m4])
m4_include([m4/virt-driver-qemu.m4])
m4_include([m4/virt-driver-remote.m4])
m4_include([m4/virt-driver-test.m4])
m4_include([m4/virt-driver-vbox.m4])
m4_include([m4/virt-driver-vmware.m4])
m4_include([m4/virt-driver-vz.m4])
m4_include([m4/virt-driver-xenapi.m4])
m4_include([m4/virt-dtrace.m4])
m4_include([m4/virt-external-programs.m4])
m4_include([m4/virt-firewalld-zone.m4])
m4_include([m4/virt-firewalld.m4])
m4_include([m4/virt-fuse.m4])
m4_include([m4/virt-glib.m4])
m4_include([m4/virt-gluster.m4])
m4_include([m4/virt-gnutls.m4])
m4_include([m4/virt-hal.m4])
......@@ -1836,9 +1757,6 @@ m4_include([m4/waitpid.m4])
m4_include([m4/warnings.m4])
m4_include([m4/wchar_h.m4])
m4_include([m4/wchar_t.m4])
m4_include([m4/wcrtomb.m4])
m4_include([m4/wctob.m4])
m4_include([m4/wctomb.m4])
m4_include([m4/wctype_h.m4])
m4_include([m4/wcwidth.m4])
m4_include([m4/wint_t.m4])
......
#! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <<EOF
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
Members may be specified in a file named with @FILE.
EOF
exit $?
;;
-v | --v*)
echo "$me, version $scriptversion"
exit $?
;;
esac
if test $# -lt 3; then
func_error "you must specify a program, an action and an archive"
fi
AR=$1
shift
while :
do
if test $# -lt 2; then
func_error "you must specify a program, an action and an archive"
fi
case $1 in
-lib | -LIB \
| -ltcg | -LTCG \
| -machine* | -MACHINE* \
| -subsystem* | -SUBSYSTEM* \
| -verbose | -VERBOSE \
| -wx* | -WX* )
AR="$AR $1"
shift
;;
*)
action=$1
shift
break
;;
esac
done
orig_archive=$1
shift
func_file_conv "$orig_archive"
archive=$file
# strip leading dash in $action
action=${action#-}
delete=
extract=
list=
quick=
replace=
index=
create=
while test -n "$action"
do
case $action in
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
q*) quick=yes ;;
r*) replace=yes ;;
s*) index=yes ;;
S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
*)
func_error "unknown action specified"
;;
esac
action=${action#?}
done
case $delete$extract$list$quick$replace,$index in
yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
;;
*)
func_error "no action specified"
;;
esac
if test -n "$delete"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
for member
do
case $1 in
@*)
func_at_file "${1#@}" -REMOVE "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
;;
esac
done
elif test -n "$extract"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
if test $# -gt 0; then
for member
do
case $1 in
@*)
func_at_file "${1#@}" -EXTRACT "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
;;
esac
done
else
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
do
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
done
fi
elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
fi
orig_archive=
else
orig_archive=$archive
fi
for member
do
case $1 in
@*)
func_file_conv "${1#@}"
set x "$@" "@$file"
;;
*)
func_file_conv "$1"
set x "$@" "$file"
;;
esac
shift
shift
done
if test -n "$orig_archive"; then
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
else
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
fi
elif test -n "$list"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
$AR -NOLOGO -LIST "$archive" || exit $?
fi
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2019 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
xl* | bgxl* | bgf* | mpixl*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
wl=
;;
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,'
;;
esac
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
haiku*)
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;;
freebsd* | dragonfly*)
library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'
;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
*nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
& eval 'exec perl -wS "$0" $argv:q'
if 0;
# Convert git log output to ChangeLog format.
my $VERSION = '2018-03-07 03:47'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2019 Free Software Foundation, 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering
use strict;
use warnings;
use Getopt::Long;
use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||;
# use File::Coda; # https://meyering.net/code/Coda/
END {
defined fileno STDOUT or return;
close STDOUT and return;
warn "$ME: failed to close standard output: $!\n";
$? ||= 1;
}
sub usage ($)
{
my ($exit_code) = @_;
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0)
{
print $STREAM "Try '$ME --help' for more information.\n";
}
else
{
print $STREAM <<EOF;
Usage: $ME [OPTIONS] [ARGS]
Convert git log output to ChangeLog format. If present, any ARGS
are passed to "git log". To avoid ARGS being parsed as options to
$ME, they may be preceded by '--'.
OPTIONS:
--amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
makes a change to SHA1's commit log text or metadata.
--append-dot append a dot to the first line of each commit message if
there is no other punctuation or blank at the end.
--no-cluster never cluster commit messages under the same date/author
header; the default is to cluster adjacent commit messages
if their headers are the same and neither commit message
contains multiple paragraphs.
--srcdir=DIR the root of the source tree, from which the .git/
directory can be derived.
--since=DATE convert only the logs since DATE;
the default is to convert all log entries.
--until=DATE convert only the logs older than DATE.
--ignore-matching=PAT ignore commit messages whose first lines match PAT.
--ignore-line=PAT ignore lines of commit messages that match PAT.
--format=FMT set format string for commit subject and body;
see 'man git-log' for the list of format metacharacters;
the default is '%s%n%b%n'
--strip-tab remove one additional leading TAB from commit message lines.
--strip-cherry-pick remove data inserted by "git cherry-pick";
this includes the "cherry picked from commit ..." line,
and the possible final "Conflicts:" paragraph.
--help display this help and exit
--version output version information and exit
EXAMPLE:
$ME --since=2008-01-01 > ChangeLog
$ME -- -n 5 foo > last-5-commits-to-branch-foo
SPECIAL SYNTAX:
The following types of strings are interpreted specially when they appear
at the beginning of a log message line. They are not copied to the output.
Copyright-paperwork-exempt: Yes
Append the "(tiny change)" notation to the usual "date name email"
ChangeLog header to mark a change that does not require a copyright
assignment.
Co-authored-by: Joe User <user\@example.com>
List the specified name and email address on a second
ChangeLog header, denoting a co-author.
Signed-off-by: Joe User <user\@example.com>
These lines are simply elided.
In a FILE specified via --amend, comment lines (starting with "#") are ignored.
FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
a line) referring to a commit in the current project, and CODE refers to one
or more consecutive lines of Perl code. Pairs must be separated by one or
more blank line.
Here is sample input for use with --amend=FILE, from coreutils:
3a169f4c5d9159283548178668d2fae6fced3030
# fix typo in title:
s/all tile types/all file types/
1379ed974f1fa39b12e2ffab18b3f7a607082202
# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
# Change the author to be Paul. Note the escaped "@":
s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
EOF
}
exit $exit_code;
}
# If the string $S is a well-behaved file name, simply return it.
# If it contains white space, quotes, etc., quote it, and return the new string.
sub shell_quote($)
{
my ($s) = @_;
if ($s =~ m![^\w+/.,-]!)
{
# Convert each single quote to '\''
$s =~ s/\'/\'\\\'\'/g;
# Then single quote the string.
$s = "'$s'";
}
return $s;
}
sub quoted_cmd(@)
{
return join (' ', map {shell_quote $_} @_);
}
# Parse file F.
# Comment lines (starting with "#") are ignored.
# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
# (alone on a line) referring to a commit in the current project, and
# CODE refers to one or more consecutive lines of Perl code.
# Pairs must be separated by one or more blank line.
sub parse_amend_file($)
{
my ($f) = @_;
open F, '<', $f
or die "$ME: $f: failed to open for reading: $!\n";
my $fail;
my $h = {};
my $in_code = 0;
my $sha;
while (defined (my $line = <F>))
{
$line =~ /^\#/
and next;
chomp $line;
$line eq ''
and $in_code = 0, next;
if (!$in_code)
{
$line =~ /^([0-9a-fA-F]{40})$/
or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
$fail = 1, next;
$sha = lc $1;
$in_code = 1;
exists $h->{$sha}
and (warn "$ME: $f:$.: duplicate SHA1\n"),
$fail = 1, next;
}
else
{
$h->{$sha} ||= '';
$h->{$sha} .= "$line\n";
}
}
close F;
$fail
and exit 1;
return $h;
}
# git_dir_option $SRCDIR
#
# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR
# is undef). Return as a list (0 or 1 element).
sub git_dir_option($)
{
my ($srcdir) = @_;
my @res = ();
if (defined $srcdir)
{
my $qdir = shell_quote $srcdir;
my $cmd = "cd $qdir && git rev-parse --show-toplevel";
my $qcmd = shell_quote $cmd;
my $git_dir = qx($cmd);
defined $git_dir
or die "$ME: cannot run $qcmd: $!\n";
$? == 0
or die "$ME: $qcmd had unexpected exit code or signal ($?)\n";
chomp $git_dir;
push @res, "--git-dir=$git_dir/.git";
}
@res;
}
{
my $since_date;
my $until_date;
my $format_string = '%s%n%b%n';
my $amend_file;
my $append_dot = 0;
my $cluster = 1;
my $ignore_matching;
my $ignore_line;
my $strip_tab = 0;
my $strip_cherry_pick = 0;
my $srcdir;
GetOptions
(
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
'since=s' => \$since_date,
'until=s' => \$until_date,
'format=s' => \$format_string,
'amend=s' => \$amend_file,
'append-dot' => \$append_dot,
'cluster!' => \$cluster,
'ignore-matching=s' => \$ignore_matching,
'ignore-line=s' => \$ignore_line,
'strip-tab' => \$strip_tab,
'strip-cherry-pick' => \$strip_cherry_pick,
'srcdir=s' => \$srcdir,
) or usage 1;
defined $since_date
and unshift @ARGV, "--since=$since_date";
defined $until_date
and unshift @ARGV, "--until=$until_date";
# This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
# that makes a correction in the log or attribution of that commit.
my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
my @cmd = ('git',
git_dir_option $srcdir,
qw(log --log-size),
'--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV);
open PIPE, '-|', @cmd
or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
. "(Is your Git too old? Version 1.5.1 or later is required.)\n");
my $prev_multi_paragraph;
my $prev_date_line = '';
my @prev_coauthors = ();
my @skipshas = ();
while (1)
{
defined (my $in = <PIPE>)
or last;
$in =~ /^log size (\d+)$/
or die "$ME:$.: Invalid line (expected log size):\n$in";
my $log_nbytes = $1;
my $log;
my $n_read = read PIPE, $log, $log_nbytes;
$n_read == $log_nbytes
or die "$ME:$.: unexpected EOF\n";
# Extract leading hash.
my ($sha, $rest) = split ':', $log, 2;
defined $sha
or die "$ME:$.: malformed log entry\n";
$sha =~ /^[0-9a-fA-F]{40}$/
or die "$ME:$.: invalid SHA1: $sha\n";
my $skipflag = 0;
if (@skipshas)
{
foreach(@skipshas)
{
if ($sha =~ /^$_/)
{
$skipflag = $_;
last;
}
}
}
# If this commit's log requires any transformation, do it now.
my $code = $amend_code->{$sha};
if (defined $code)
{
eval 'use Safe';
my $s = new Safe;
# Put the unpreprocessed entry into "$_".
$_ = $rest;
# Let $code operate on it, safely.
my $r = $s->reval("$code")
or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
# Note that we've used this entry.
delete $amend_code->{$sha};
# Update $rest upon success.
$rest = $_;
}
# Remove lines inserted by "git cherry-pick".
if ($strip_cherry_pick)
{
$rest =~ s/^\s*Conflicts:\n.*//sm;
$rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
}
my @line = split /[ \t]*\n/, $rest;
my $author_line = shift @line;
defined $author_line
or die "$ME:$.: unexpected EOF\n";
$author_line =~ /^(\d+) (.*>)$/
or die "$ME:$.: Invalid line "
. "(expected date/author/email):\n$author_line\n";
# Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
# `(tiny change)' annotation.
my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
? ' (tiny change)' : '');
my $date_line = sprintf "%s %s$tiny\n",
strftime ("%Y-%m-%d", localtime ($1)), $2;
my @coauthors = grep /^Co-authored-by:.*$/, @line;
# Omit meta-data lines we've already interpreted.
@line = grep !/^(?:Signed-off-by:[ ].*>$
|Co-authored-by:[ ]
|Copyright-paperwork-exempt:[ ]
|Tiny-change:[ ]
)/x, @line;
# Remove leading and trailing blank lines.
if (@line)
{
while ($line[0] =~ /^\s*$/) { shift @line; }
while ($line[$#line] =~ /^\s*$/) { pop @line; }
}
# Handle Emacs gitmerge.el "skipped" commits.
# Yes, this should be controlled by an option. So sue me.
if ( grep /^(; )?Merge from /, @line )
{
my $found = 0;
foreach (@line)
{
if (grep /^The following commit.*skipped:$/, $_)
{
$found = 1;
## Reset at each merge to reduce chance of false matches.
@skipshas = ();
next;
}
if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
{
push ( @skipshas, $1 );
}
}
}
# Ignore commits that match the --ignore-matching pattern, if specified.
if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/)
{
$skipflag = 1;
}
elsif ($skipflag)
{
## Perhaps only warn if a pattern matches more than once?
warn "$ME: warning: skipping $sha due to $skipflag\n";
}
if (! $skipflag)
{
if (defined $ignore_line && @line)
{
@line = grep ! /$ignore_line/, @line;
while ($line[$#line] =~ /^\s*$/) { pop @line; }
}
# Record whether there are two or more paragraphs.
my $multi_paragraph = grep /^\s*$/, @line;
# Format 'Co-authored-by: A U Thor <email@example.com>' lines in
# standard multi-author ChangeLog format.
for (@coauthors)
{
s/^Co-authored-by:\s*/\t /;
s/\s*</ </;
/<.*?@.*\..*>/
or warn "$ME: warning: missing email address for "
. substr ($_, 5) . "\n";
}
# If clustering of commit messages has been disabled, if this header
# would be different from the previous date/name/etc. header,
# or if this or the previous entry consists of two or more paragraphs,
# then print the header.
if ( ! $cluster
|| $date_line ne $prev_date_line
|| "@coauthors" ne "@prev_coauthors"
|| $multi_paragraph
|| $prev_multi_paragraph)
{
$prev_date_line eq ''
or print "\n";
print $date_line;
@coauthors
and print join ("\n", @coauthors), "\n";
}
$prev_date_line = $date_line;
@prev_coauthors = @coauthors;
$prev_multi_paragraph = $multi_paragraph;
# If there were any lines
if (@line == 0)
{
warn "$ME: warning: empty commit message:\n $date_line\n";
}
else
{
if ($append_dot)
{
# If the first line of the message has enough room, then
if (length $line[0] < 72)
{
# append a dot if there is no other punctuation or blank
# at the end.
$line[0] =~ /[[:punct:]\s]$/
or $line[0] .= '.';
}
}
# Remove one additional leading TAB from each line.
$strip_tab
and map { s/^\t// } @line;
# Prefix each non-empty line with a TAB.
@line = map { length $_ ? "\t$_" : '' } @line;
print "\n", join ("\n", @line), "\n";
}
}
defined ($in = <PIPE>)
or last;
$in ne "\n"
and die "$ME:$.: unexpected line:\n$in";
}
close PIPE
or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
# FIXME-someday: include $PROCESS_STATUS in the diagnostic
# Complain about any unused entry in the --amend=F specified file.
my $fail = 0;
foreach my $sha (keys %$amend_code)
{
warn "$ME:$amend_file: unused entry: $sha\n";
$fail = 1;
}
exit $fail;
}
# Local Variables:
# mode: perl
# indent-tabs-mode: nil
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "'; # UTC"
# End:
#!/usr/bin/perl
#
# Validate that header files follow a standard layout:
#
# /*
# ...copyright header...
# */
# <one blank line>
# #pragma once
# ....content....
#
#---
#
# For any file ending priv.h, before the #pragma once
# We will have a further section
#
# #ifndef SYMBOL_ALLOW
# # error ....
# #endif /* SYMBOL_ALLOW */
# <one blank line>
#
#---
#
# For public headers (files in include/), use the standard header guard instead of #pragma once:
# #ifndef SYMBOL
# # define SYMBOL
# ....content....
# #endif /* SYMBOL */
use strict;
use warnings;
my $STATE_COPYRIGHT_COMMENT = 0;
my $STATE_COPYRIGHT_BLANK = 1;
my $STATE_PRIV_START = 2;
my $STATE_PRIV_ERROR = 3;
my $STATE_PRIV_END = 4;
my $STATE_PRIV_BLANK = 5;
my $STATE_GUARD_START = 6;
my $STATE_GUARD_DEFINE = 7;
my $STATE_GUARD_END = 8;
my $STATE_EOF = 9;
my $STATE_PRAGMA = 10;
my $file = " ";
my $ret = 0;
my $ifdef = "";
my $ifdefpriv = "";
my $publicheader = 0;
my $state = $STATE_EOF;
my $mistake = 0;
sub mistake {
my $msg = shift;
warn $msg;
$mistake = 1;
$ret = 1;
}
while (<>) {
if (not $file eq $ARGV) {
if ($state == $STATE_COPYRIGHT_COMMENT) {
&mistake("$file: missing copyright comment");
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
&mistake("$file: missing blank line after copyright header");
} elsif ($state == $STATE_PRIV_START) {
&mistake("$file: missing '#ifndef $ifdefpriv'");
} elsif ($state == $STATE_PRIV_ERROR) {
&mistake("$file: missing '# error ...priv allow...'");
} elsif ($state == $STATE_PRIV_END) {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
} elsif ($state == $STATE_PRIV_BLANK) {
&mistake("$file: missing blank line after priv header check");
} elsif ($state == $STATE_GUARD_START) {
if ($publicheader) {
&mistake("$file: missing '#ifndef $ifdef'");
} else {
&mistake("$file: missing '#pragma once' header guard");
}
} elsif ($state == $STATE_GUARD_DEFINE) {
&mistake("$file: missing '# define $ifdef'");
} elsif ($state == $STATE_GUARD_END) {
&mistake("$file: missing '#endif /* $ifdef */'");
}
$ifdef = uc $ARGV;
$ifdef =~ s,.*/,,;
$ifdef =~ s,[^A-Z0-9],_,g;
$ifdef =~ s,__+,_,g;
unless ($ifdef =~ /^LIBVIRT_/ && $ARGV !~ /libvirt_internal.h/) {
$ifdef = "LIBVIRT_" . $ifdef;
}
$ifdefpriv = $ifdef . "_ALLOW";
$file = $ARGV;
$state = $STATE_COPYRIGHT_COMMENT;
$mistake = 0;
$publicheader = ($ARGV =~ /include\//);
}
if ($mistake ||
$ARGV =~ /config-post\.h$/ ||
$ARGV =~ /vbox_(CAPI|XPCOM)/) {
$state = $STATE_EOF;
next;
}
if ($state == $STATE_COPYRIGHT_COMMENT) {
if (m,\*/,) {
$state = $STATE_COPYRIGHT_BLANK;
}
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after copyright header");
}
if ($ARGV =~ /priv\.h$/) {
$state = $STATE_PRIV_START;
} else {
$state = $STATE_GUARD_START;
}
} elsif ($state == $STATE_PRIV_START) {
if (/^$/) {
&mistake("$file: too many blank lines after copyright header");
} elsif (/#ifndef $ifdefpriv$/) {
$state = $STATE_PRIV_ERROR;
} else {
&mistake("$file: missing '#ifndef $ifdefpriv'");
}
} elsif ($state == $STATE_PRIV_ERROR) {
if (/# error ".*"$/) {
$state = $STATE_PRIV_END;
} else {
&mistake("$file: missing '# error ...priv allow...'");
}
} elsif ($state == $STATE_PRIV_END) {
if (m,#endif /\* $ifdefpriv \*/,) {
$state = $STATE_PRIV_BLANK;
} else {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
}
} elsif ($state == $STATE_PRIV_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after priv guard");
}
$state = $STATE_GUARD_START;
} elsif ($state == $STATE_GUARD_START) {
if (/^$/) {
&mistake("$file: too many blank lines after copyright header");
}
if ($publicheader) {
if (/#ifndef $ifdef$/) {
$state = $STATE_GUARD_DEFINE;
} else {
&mistake("$file: missing '#ifndef $ifdef'");
}
} else {
if (/#pragma once/) {
$state = $STATE_PRAGMA;
} else {
&mistake("$file: missing '#pragma once' header guard");
}
}
} elsif ($state == $STATE_GUARD_DEFINE) {
if (/# define $ifdef$/) {
$state = $STATE_GUARD_END;
} else {
&mistake("$file: missing '# define $ifdef'");
}
} elsif ($state == $STATE_GUARD_END) {
if (m,#endif /\* $ifdef \*/$,) {
$state = $STATE_EOF;
}
} elsif ($state == $STATE_PRAGMA) {
next;
} elsif ($state == $STATE_EOF) {
die "$file: unexpected content after '#endif /* $ifdef */'";
} else {
die "$file: unexpected state $state";
}
}
exit $ret;
#!/usr/bin/perl
my @block;
my $msgstr = 0;
my $empty = 0;
my $unused = 0;
my $fuzzy = 0;
while (<>) {
if (/^$/) {
if (!$empty && !$unused && !$fuzzy) {
print @block;
}
@block = ();
$msgstr = 0;
$fuzzy = 0;
push @block, $_;
} else {
if (/^msgstr/) {
$msgstr = 1;
$empty = 1;
}
if (/^#.*fuzzy/) {
$fuzzy = 1;
}
if (/^#~ msgstr/) {
$unused = 1;
}
if ($msgstr && /".+"/) {
$empty = 0;
}
push @block, $_;
}
}
if (@block && !$empty && !$unused) {
print @block;
}
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2018-03-07.03; # UTC
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
#!/bin/sh
# Create a temporary directory, much like mktemp -d does.
# Copyright (C) 2007-2019 Free Software Foundation, 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering.
# Usage: mktempd /tmp phoey.XXXXXXXXXX
# First, try to use the mktemp program.
# Failing that, we'll roll our own mktemp-like function:
# - try to get random bytes from /dev/urandom
# - failing that, generate output from a combination of quickly-varying
# sources and gzip. Ignore non-varying gzip header, and extract
# "random" bits from there.
# - given those bits, map to file-name bytes using tr, and try to create
# the desired directory.
# - make only $MAX_TRIES attempts
ME=`basename "$0"`
die() { echo >&2 "$ME: $@"; exit 1; }
MAX_TRIES=4
rand_bytes()
{
n=$1
chars=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
dev_rand=/dev/urandom
if test -r "$dev_rand"; then
# Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194.
dd ibs=$n count=1 if="$dev_rand" 2>/dev/null \
| tr -c $chars 01234567$chars$chars$chars
return
fi
cmds='date; date +%N; free; who -a; w; ps auxww; ps -ef'
data=` (eval "$cmds") 2>&1 | gzip `
n_plus_50=`expr $n + 50`
# Ensure that $data has length at least 50+$n
while :; do
len=`echo "$data"|wc -c`
test $n_plus_50 -le $len && break;
data=` (echo "$data"; eval "$cmds") 2>&1 | gzip `
done
echo "$data" \
| dd bs=1 skip=50 count=$n 2>/dev/null \
| tr -c $chars 01234567$chars$chars$chars
}
mktempd()
{
case $# in
2);;
*) die "Usage: $ME DIR TEMPLATE";;
esac
destdir=$1
template=$2
# Disallow any trailing slash on specified destdir:
# it would subvert the post-mktemp "case"-based destdir test.
case $destdir in
/) ;;
*/) die "invalid destination dir: remove trailing slash(es)";;
esac
case $template in
*XXXX) ;;
*) die "invalid template: $template (must have a suffix of at least 4 X's)";;
esac
fail=0
# First, try to use mktemp.
d=`env -u TMPDIR mktemp -d -t -p "$destdir" "$template" 2>/dev/null` \
|| fail=1
# The resulting name must be in the specified directory.
case $d in "$destdir"*);; *) fail=1;; esac
# It must have created the directory.
test -d "$d" || fail=1
# It must have 0700 permissions. Handle sticky "S" bits.
perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
case $perms in drwx------*) ;; *) fail=1;; esac
test $fail = 0 && {
echo "$d"
return
}
# If we reach this point, we'll have to create a directory manually.
# Get a copy of the template without its suffix of X's.
base_template=`echo "$template"|sed 's/XX*$//'`
# Calculate how many X's we've just removed.
template_length=`echo "$template" | wc -c`
nx=`echo "$base_template" | wc -c`
nx=`expr $template_length - $nx`
err=
i=1
while :; do
X=`rand_bytes $nx`
candidate_dir="$destdir/$base_template$X"
err=`mkdir -m 0700 "$candidate_dir" 2>&1` \
&& { echo "$candidate_dir"; return; }
test $MAX_TRIES -le $i && break;
i=`expr $i + 1`
done
die "$err"
}
mktempd "$@"
#!/usr/bin/env perl
my %noninlined;
my %mocked;
# Functions in public header don't get the noinline annotation
# so whitelist them here
$noninlined{"virEventAddTimeout"} = 1;
# This one confuses the script as its defined in the mock file
# but is actually just a local helper
$noninlined{"virMockStatRedirect"} = 1;
foreach my $arg (@ARGV) {
if ($arg =~ /\.h$/) {
#print "Scan header $arg\n";
&scan_annotations($arg);
} elsif ($arg =~ /mock\.c$/) {
#print "Scan mock $arg\n";
&scan_overrides($arg);
}
}
my $warned = 0;
foreach my $func (keys %mocked) {
next if exists $noninlined{$func};
$warned++;
print STDERR "$func is mocked at $mocked{$func} but missing noinline annotation\n";
}
exit $warned ? 1 : 0;
sub scan_annotations {
my $file = shift;
open FH, $file or die "cannot read $file: $!";
my $func;
while (<FH>) {
if (/^\s*(\w+)\(/ || /^(?:\w+\*?\s+)+(?:\*\s*)?(\w+)\(/) {
my $name = $1;
if ($name !~ /ATTRIBUTE/) {
$func = $name;
}
} elsif (/^\s*$/) {
$func = undef;
}
if (/ATTRIBUTE_NOINLINE/) {
if (defined $func) {
$noninlined{$func} = 1;
}
}
}
close FH
}
sub scan_overrides {
my $file = shift;
open FH, $file or die "cannot read $file: $!";
my $func;
while (<FH>) {
if (/^(\w+)\(/ || /^\w+\s*(?:\*\s*)?(\w+)\(/) {
my $name = $1;
if ($name =~ /^vir/) {
$mocked{$name} = "$file:$.";
}
}
}
close FH
}
#!/usr/bin/env perl
use strict;
my $file = " ";
my $ret = 0;
my %includes = ( );
my $lineno = 0;
while (<>) {
if (not $file eq $ARGV) {
%includes = ( );
$file = $ARGV;
$lineno = 0;
}
$lineno++;
if (/^# *include *[<"]([^>"]*\.h)[">]/) {
$includes{$1}++;
if ($includes{$1} == 2) {
$ret = 1;
print STDERR "$ARGV:$lineno: $_";
print STDERR "Do not include a header more than once per file\n";
}
}
}
exit $ret;
This diff is collapsed.