diff options
| author | Johannes 'josch' Schauer <josch@mister-muffin.de> | 2016-08-03 08:32:55 (GMT) |
|---|---|---|
| committer | Johannes 'josch' Schauer <josch@mister-muffin.de> | 2016-08-03 08:32:55 (GMT) |
| commit | 8bc84e14f0bc5fda075925ba4abbc644c1c4f2ec (patch) | |
| tree | 5a788ee4214628bf345dfbe5e275a4a5e3a55e51 | |
| parent | 94bbdcadf2f8b6e723870b738ecd94aa8e1b705b (diff) | |
import upstream version 0.70.0
| -rw-r--r-- | ChangeLog | 411 | ||||
| -rw-r--r-- | Makefile.in | 56 | ||||
| -rw-r--r-- | NEWS | 56 | ||||
| -rw-r--r-- | VERSION | 6 | ||||
| -rw-r--r-- | aclocal.m4 | 53 | ||||
| -rw-r--r-- | bin/Makefile.in | 27 | ||||
| -rwxr-xr-x | bin/sbuild-createchroot | 94 | ||||
| -rw-r--r-- | configs/Makefile.in | 27 | ||||
| -rwxr-xr-x | configure | 46 | ||||
| -rw-r--r-- | db/Makefile.in | 27 | ||||
| -rw-r--r-- | etc/Makefile.in | 27 | ||||
| -rw-r--r-- | lib/Buildd/Conf.pm | 2 | ||||
| -rw-r--r-- | lib/Buildd/Makefile.in | 27 | ||||
| -rw-r--r-- | lib/Makefile.in | 27 | ||||
| -rw-r--r-- | lib/Sbuild.pm | 20 | ||||
| -rw-r--r-- | lib/Sbuild/Build.pm | 246 | ||||
| -rw-r--r-- | lib/Sbuild/Chroot.pm | 35 | ||||
| -rw-r--r-- | lib/Sbuild/ChrootSetup.pm | 35 | ||||
| -rw-r--r-- | lib/Sbuild/Conf.pm | 72 | ||||
| -rw-r--r-- | lib/Sbuild/Makefile.in | 27 | ||||
| -rw-r--r-- | lib/Sbuild/Options.pm | 34 | ||||
| -rw-r--r-- | lib/Sbuild/ResolverBase.pm | 470 | ||||
| -rw-r--r-- | man/Makefile.in | 27 | ||||
| -rw-r--r-- | man/sbuild-createchroot.8.in | 69 | ||||
| -rw-r--r-- | man/sbuild-setup.7.in | 2 | ||||
| -rw-r--r-- | man/sbuild.1.in | 130 | ||||
| -rwxr-xr-x | scripts/config.guess | 152 | ||||
| -rwxr-xr-x | scripts/config.sub | 48 | ||||
| -rwxr-xr-x | scripts/install-sh | 373 | ||||
| -rwxr-xr-x | scripts/missing | 2 | ||||
| -rwxr-xr-x | scripts/test-driver | 15 | ||||
| -rw-r--r-- | test/Makefile.in | 37 | ||||
| -rw-r--r-- | tools/Makefile.in | 27 |
33 files changed, 1986 insertions, 721 deletions
@@ -1,3 +1,414 @@ +commit 94572933e464a438f225a95bed81c206f0366fde +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Aug 3 10:10:47 2016 +0200 + + Bump version to 0.70.0 + +commit 9f4e1f2a5c0ba530feee0051899bc43bb03d74c3 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Aug 3 10:10:21 2016 +0200 + + bin/sbuild-createchroot: add code comment about /etc/sbuild/chroot + +commit 27e8d44c1015e4837b98e8692d9d70de4efec629 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Tue Aug 2 13:13:12 2016 +0200 + + Add feature to run autopkgtest after a successful build. + +commit a5b75efc129330502cd9ed801fab33cba71bc160 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Tue Aug 2 11:19:09 2016 +0200 + + lib/Sbuild/ResolverBase.pm: Allow extra repository keys to be passed in armored format + + - also supply a fallback on a Perl-only armored-to-dearmored key conversion if + the host doesn't have gpg installed + - this way, the user doesn't have to do the conversion themselves + +commit ac227aaf6940ba7a6a4c7349c6523da697e3d8bb +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Mon Aug 1 17:24:11 2016 +0200 + + lib/Sbuild/ResolverBase.pm: move adding keys to the apt repo into the setup function so that the keys are available during the update/upgrade/dist-upgrade steps + +commit 2e7b4d9cc19aef82e0cede5e3640b8d8bec1826f +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Mon Aug 1 16:43:05 2016 +0200 + + lib/Sbuild/ResolverBase.pm: Plainly copy EXTRA_REPOSITORY_KEYS into /etc/apt/trusted.gpg.d/ + + - avoids dependency on gnupg which might not be present in the chroot + +commit 635097de980ad1ee39ff4edb8fe2a78c25a5a092 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Mon Aug 1 16:19:44 2016 +0200 + + lib/Sbuild/ResolverBase.pm: export dummy repository key to /etc/apt/trusted.gpg.d manually instead of using "apt-key add" + + - programmatic usage of "apt-key add" is strongly discouraged as by the + man page of apt-key + - with newer gpg versions, apt-key will leave a gpg-agent process + running that sbuild cannot kill because for that it would need access + to the GNUPGHOME directory that apt-key uses, but that is immediately + destroyed. Thus, sbuild can never properly clean up the gpg-agent + process itself. + - move exporting of sbuild's archive key to the if block that imports + the keys to avoid duplication of the complex if conditional + +commit 3af61133793ea62a3f10075b3319ff522be81fda +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Mon Aug 1 14:42:30 2016 +0200 + + sbuild-createchroot: Do not install debfoster by default. + + - most users will want to use tarball or directory with overlay chroots and in + these cases, any additional cruft from build dependency installation is + automatically taken care of when the chroot is closed by just not storing + any changes + - if users still want debfoster, they can manually add it using the --include + switch + - by default, the created chroot should be as minimal as possible + +commit 5ebb63bce633f00b27e0addedf5a96ce2c7a7a09 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sun Jul 31 17:35:49 2016 +0200 + + lib/Sbuild/ResolverBase.pm: add comment about apt-key spawning gpg-agent + +commit f957dae1b80aad33795cb312da73266e1b48fe9b +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sun Jul 31 17:35:13 2016 +0200 + + lib/Sbuild/ResolverBase.pm: kill gpg-agent in all cases + +commit f2855baf9a5751b280756d302e7e2078854b1680 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sun Jul 31 07:52:27 2016 +0200 + + lib/Sbuild/ResolverBase.pm: Improve messages about how to turn off signing (closes: #831462) + +commit a0faab5bebed445f83c77978123fb7e913fef9cb +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sun Jul 31 07:35:03 2016 +0200 + + lib/Sbuild/ResolverBase.pm: don't run cleanup_apt_archive on error. This is the task of the caller. + +commit 39991d4755af4e72d9879de622745c286850012d +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jul 28 11:00:56 2016 +0200 + + Allow producing a .changes file for a source-only upload (closes: #812361) + + - add command line option --source-only-changes + - add configuration variable SOURCE_ONLY_CHANGES + +commit bcfbe4abc22b738ba31e860951dafbe82181a461 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jul 28 10:55:47 2016 +0200 + + lib/Sbuild/Build.pm: run debsign with --re-sign to avoid prompting the user + +commit 76e49e47deb771fee92ed845ecea59e78834cf16 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jul 28 10:08:47 2016 +0200 + + man/sbuild.1.in: fix help text for --keyid + +commit bb7512b328198362c38ed188464ec5cf605e1a62 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jul 28 10:04:58 2016 +0200 + + lib/Sbuild/Build.pm: Instead of testing for readability of .changes files, generate the expected name from the build options + + - this also makes get_changes_host() superfluous and now there is only + get_changes() + - this prevents the wrong .changes file name to be returned in cases + where either a source-only .changes has been generated by + dpkg-genchanges inside the chroot or where a .changes file from + earlier builds are left on the host + +commit 3992277ccbbfcad30b4495a23373c3a863d3f8f7 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Jul 27 12:28:02 2016 +0200 + + man/sbuild.1.in: clarify working directory for external commands + +commit e948c10e3edd4898101669b3d411ed867a595e67 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Jul 27 11:26:39 2016 +0200 + + lib/Sbuild/Build.pm: add comment about limitations of check_architectures() + +commit 5877d70eb6ddecf0118fa8f789cbc442710752ff +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Mon Jul 4 08:52:29 2016 +0200 + + lib/Sbuild/Build.pm: When printing the subsection, don't treat crossbuilds any special to save horizontal space on the line. + +commit 0e71b40ad45e64cb8553f198b18113114a30f098 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sat Jul 2 01:50:20 2016 +0200 + + lib/Sbuild/ResolverBase.pm: Move addition of extra repositories from the creation of the dummy build dependency repository to the initial setup (closes: #792037) + + The extra repositories have to be added very early. If they are added + too late, then they will only be considered to select build + dependencies. But we also want to consider the given extra repositories + during the initial chroot update/upgrade/distupgrade step. + +commit 246fb4ebe15476fc40dacd710a10480371e1385a +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sat Jul 2 01:00:52 2016 +0200 + + Make sure printed timestamps are in C locale, in UTC and in standard formats (closes: #813895) + + - lib/Sbuild.pm: add new function strftime_c which acts like strftime + but formats the timestamp in the C locale + - use UTC instead of local time + - use standard time formats like ISO 8601 or the timestamp format used + in debian/changelog and documented in Policy §4.4 + +commit 92c273c02836a5e0de1f0a614fd8839dcafd9479 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Sat Jul 2 00:57:48 2016 +0200 + + lib/Sbuild/ResolverBase.pm: format the Date field in the Release file correctly + + - make sure that the locale is C.UTF-8 when strftime is called + - express GMT timezone as +0000 as specified in + https://wiki.debian.org/RepositoryFormat#Date.2CValid-Until + or in Debian Policy §4.4 or in `date -R`. + +commit 3cb958df86686c2f8c6e83dae22b88aec0a24a95 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Fri Jul 1 16:56:15 2016 +0200 + + lib/Sbuild/Build.pm: refactor check_space() + + - move unrelated operations to build() + - let it return a value instead of just setting 'This Space' as a + side-effect + - add comments to the code + - remove usage of implicitly set variables like $_ and $1 and replace + them by explicitly set ones + - on error, immediately return instead of continuing operation + +commit 74ee2f09d238200accb700787a872e0248e72e26 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Fri Jul 1 16:42:13 2016 +0200 + + lib/Sbuild/Build.pm/check_space(): Add up correct size when looping over files (closes: #825359) + + Due to a possible copy&paste bug, the loop that is supposed to add up + the sizes of the generated build artifacts was instead repeatedly adding + up the size of the unpacked source package, leading to implausible + results as the unpacked source package can be an order of magnitude + bigger in size than each of the generated binary packages. The problem + was pronounced for source packages with many binary packages. + +commit 956fc29b2e297e20f1ab9a9ddb80ae8fa04c3370 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jun 30 21:18:28 2016 +0200 + + Use armored ASCII GPG key pairs instead of the GPG binary format and support GPG 2.x inside the chroot + + The GPG binary key format is not guaranteed to be compatible between + different versions of GPG. For example the 2.x format is incompatible + with the 1.x format and the other way round. Still, key pairs might be + generated with GPG 1.x outside the chroot and will be used with GPG 2.x + inside the chroot or the other way round. Thus, a solution is needed + which allows GPG 1.x key pairs to be used by GPG 2.x and the other way + round. One solution is the one implemented by this commit and was + proposed by Daniel Kahn Gillmor in #debian-gnupg (Thanks!!). Instead of + using the binary format, `sbuild-update --keygen` will now export the + key pair in armored ASCII format and GPG inside the chroot will import + the key pair. Since the armored ASCII key format is independent of the + GPG version generating or importing it, it doesn't matter which + combination of GPG is installed on the machine running `sbuild-update + --keygen` or inside the chroot. Thus, no limitations are created when + sbuild is to work on the same host with chroots containing different GPG + versions (for example of the 1.x and 2.x versions). + + To implement this new handling of GPG key pairs, the + SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED and + SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED configuration options are + introduced by this commit and they deprecate the + SBUILD_BUILD_DEPENDS_SECRET_KEY and SBUILD_BUILD_DEPENDS_PUBLIC_KEY + option pair. + + Sbuild will still be able to work with the old binary format for a + while. It will just not be able to handle chroots with an incompatible + GPG version until `sbuild-update --keygen` has been re-run on the host + to create the armored ASCII keys. + + Furthermore, this commit adds support for GPG 2.x inside the chroot. + Those GPG versions will start a gpg-agent process once gpg is run. If + that process is not cleaned up before the chroot is exited, then closing + the chroot might fail because gpg-agent will still have open file + descriptors and thus unmounting filesystems might fail. Thus, if the + gpgconf executable exists, `gpgconf --kill gpg-agent` will be executed + to clean up any remaining gpg-agent processes after operations involving + gpg. + +commit 3aa506b5cd2921c5c3349ddfdeff096f818815a8 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jun 30 21:17:39 2016 +0200 + + lib/Sbuild/Chroot.pm: add can_run() function to allow checking whether a program can be executed inside the chroot + +commit 0d997aefa37288e0b6bc984e326b00bbd59823dd +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jun 30 21:16:01 2016 +0200 + + lib/Sbuild/Chroot.pm: escape special shell characters in get_read_file_handle() and get_write_file_handle() + +commit ca66503b58ba8b46d98de4f25942670e010f4959 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Fri Jun 17 08:27:09 2016 +0200 + + lib/Sbuild/ResolverBase.pm: The generate_keys() function is not useful anymore. + + It used to instruct users of missing keypairs and how to generate and + where to put them. But now that signing of the internal repository is + optional, this function was only executed when the keypairs were known + to exist, making this function essentially a no-op. + +commit 49f73182c0bc987da0d2e96585fa12ab0b07c93d +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jun 16 13:33:44 2016 +0200 + + bin/sbuild-createchroot: Add --extra-repository option + + Add a repository to the list of apt sources. The repository specification is a + line suitable for an apt sources.list file. For instance, you might use + + --extra-repository="deb http://httpredir.debian.org/debian experimental main" + + to allow packages in the experimental distribution to fulfill + build-dependencies. Note that the build chroot must already trust the key of + this repository. This option is especially useful for creating variant chroots. + +commit 1f2183a0e3bbe8376a89cde8bb5344b3e5cf2529 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu Jun 16 12:23:26 2016 +0200 + + bin/sbuild-createchroot: add --alias option (closes: #800593) + + Add an alternative name that the chroot will be known by. This option can be + given multiple times to add more than one alias. Using an alias is useful for + chroots of distributions that are known by more than one name. For example + Debian unstable is also known as sid. Additionally, sbuild chooses the + distribution by the latest changelog entry which could list UNRELEASED for + packages that the maintainer is currently working on. For Debian it thus makes + sense to add UNRELEASED as an alias for a Debian unstable chroot. + +commit 41bd730d618f55f1c0376b9c9a74ca6436701e1a +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Jun 15 20:52:28 2016 +0200 + + bin/sbuild-createchroot: Move common parts of schroot config outside of if/else block + +commit cffbe9310692a8fc81c964a8fdefed72a3c34c42 +Author: Luca Capello <luca.capello@infomaniak.com> +Date: Fri Jun 10 13:05:51 2016 +0200 + + bin/sbuild-createchroot: add --no-deb-src (closes: #826847) + + This option will not add a deb-src line to the apt configuration of the + created chroot. This is useful in situation when it is known that sbuild + will never have to download the source package itself but is always + given an already downloaded dsc. In that case, this option will help to + save bandwidth and disk space because the source indices don't have to + be downloaded and later continually updated. + +commit 80ef1248c2046f53f2b7b75e314003c13e6300f4 +Author: Luca Capello <luca.capello@infomaniak.com> +Date: Fri Jun 10 16:52:21 2016 +0200 + + bin/sbuild-createchroot: add support for SUITE-VARIANT (closes: #826957) + + This is useful to create variants of a base suite like jessie-backports + which which would create a jessie chroot to which the backports archive + can be manually added after the base chroot was created using + sbuild-shell. This way, a normal jessie chroot and a jessie-backports + chroot can exist side-by-side. Besides this common use case, this syntax + can also be used to create chroots with any other type of customization. + It is a shortcut for creating a base chroot and then having to manually + copy it and edit the configuration files. + +commit 7697e9b03d8154ed10e063703178d190c39dfdc7 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed Jun 15 19:13:00 2016 +0200 + + Add an EXAMPLE section to the sbuild man page (closes: #824582) + +commit 22ea6272d95c4d64dc2322f6c8b79871cfeac0f1 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Tue Jun 7 12:15:21 2016 +0200 + + Do not write $HOME into default config and man pages (closes: #825991) + + This prevents private information (the $HOME path) leaking into the + created files and also fixes a reproducible builds issue (builds should + produce the same output independent of the user running the build). + +commit 1ed5ba221c9cfa93ce17edefa7cd21dddb6cfc75 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed May 18 20:21:25 2016 +0200 + + lib/Sbuild.pm: Fix execution of man. + + The moment you thought you understood something about perl this + happens... Why does the qw() version not work?? + +commit 3e36e426f7b728680c73d54983c6ed447227d792 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Fri May 13 12:50:12 2016 +0200 + + lib/Sbuild/ResolverBase.pm: Fix typo in APT::Get::AllowUnauthenticated config setting (closes: #824165) + +commit 7bbea614d4c9f9723fba59e56a2d546cbcc3be49 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu May 12 07:53:03 2016 +0200 + + man/sbuild.1.in: Fix to errors from man due to macro typos + +commit 5f2a796aa7ef1289b9afb632b76436d12656da78 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Thu May 12 07:45:31 2016 +0200 + + man/sbuild.1.in: fix spelling depenencies -> dependencies + +commit 6bd64951db86bc45f0ca5c7e843d6de9d97b8598 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed May 11 07:14:31 2016 +0200 + + lib/Sbuild/ResolverBase.pm: get_foreign_architectures(): fix uninitialized value problem in loop (closes: #823993) + +commit d3d2663b51fdd627155cee3b0fe8555ac81ddaf4 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Wed May 11 06:45:53 2016 +0200 + + bin/sbuild-createchroot: fix chown/chmod error checks (closes: #823897) + +commit d1afdcad494982a5401a0de5a3de8ee3174d8dc3 +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Tue May 10 07:57:17 2016 +0200 + + lib/Sbuild/Build.pm: If dpkg-buildpackage dies, make sure to leave this information on stderr. + +commit dd66734ba7f24f41d72d5f465dd6fff02598087e +Author: Johannes 'josch' Schauer <josch@mister-muffin.de> +Date: Tue May 10 07:36:38 2016 +0200 + + lib/Sbuild/ResolverBase.pm: do not produce non-error output in architecture setup + + sbuild-update setups up the resolver but not the logger. Hence, all + messages from the resolver will plainly go to stderr. This should not + happen as stderr for sbuild-update should be empty unless there really + is an error. We thus demote the messages to debug level. (closes: #823788) + commit d4c3cc43b4d8d169f4fec6dac560a63c9c8f6640 Author: Johannes 'josch' Schauer <josch@mister-muffin.de> Date: Sun May 8 11:01:42 2016 +0200 diff --git a/Makefile.in b/Makefile.in index af83bf5..7e5c609 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -56,7 +56,17 @@ # ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -119,19 +129,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk INSTALL NEWS README \ - AUTHORS ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in COPYING TODO scripts/config.guess \ - scripts/config.sub scripts/install-sh scripts/missing \ - $(top_srcdir)/scripts/config.guess \ - $(top_srcdir)/scripts/config.sub \ - $(top_srcdir)/scripts/install-sh $(top_srcdir)/scripts/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -195,6 +199,14 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/scripts/config.guess \ + $(top_srcdir)/scripts/config.sub \ + $(top_srcdir)/scripts/global.mk \ + $(top_srcdir)/scripts/install-sh $(top_srcdir)/scripts/missing \ + AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \ + scripts/config.guess scripts/config.sub scripts/install-sh \ + scripts/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -334,6 +346,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -378,7 +391,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -388,7 +400,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -610,15 +622,15 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -654,17 +666,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -835,6 +847,8 @@ uninstall-am: mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am +.PRECIOUS: Makefile + dist-hook: # Remove junk from the generated tarball. @@ -1,12 +1,66 @@ NEWS -*- outline -*- ---- -Welcome to sbuild 0.69.0. Please read these release notes carefully. +Welcome to sbuild 0.70.0. Please read these release notes carefully. Full installation instructions are provided in the INSTALL file. The README file also contains more specific notes regarding building and configuration. + * Major changes in 0.70.0: + + 1) Fix reproducibility issue by not writing the $HOME as set during the + build into config files and man pages anymore + + 2) Add an EXAMPLE section to the sbuild man page + + 3) sbuild-createchroot now has support for SUITE-VARIANT chroot names. This + is useful to create variants of base suits like jessie-backports or + unstable-experimental. + + 4) sbuild-createchroot now has the --no-deb-src option which allows one to + create a chroot without a deb-src entry in its sources.list. This is + useful to save bandwidth and disk space for chroots that will never be + used to download source packages as the source indices do not have to + downloaded, stored and later updated from the mirrors. + + 5) sbuild-createchroot now has the --alias option which is useful to add a + shorthand alias to a chroot which will be used for chroot selection. This + is for example useful for a Debian unstable chroot which will be + automatically selected for package builds that have UNRELEASED in their + debian/changelog, if the UNRELEASED alias is added to the Debian unstable + chroot. + + 6) suild-createchroot now has the --extra-repository which works like the + --extra-repository option for sbuild and permanently adds another line to + the chroot's sources.list. + + 7) Private/public key pairs are now stored in armored ASCII format to + maintain compatibility between different gpg versions on the host and + within the chroot. Re-running `sbuild-update --keygen` will create the + new key types. + + 8) Chroots can now have gpg >= 2.x installed as sbuild will properly clean + up any remaining gpg-agent processes and "apt-key add" is not used + anymore (it will leave a gpg-agent process around that cannot properly + be killed). + + 9) Add the --source-only-changes option which will create a .changes file + suitable for a source-only upload alongside the normal binary .changes + file. + + 10) Do not install debfoster by default in sbuild-createchroot to keep the + build chroot as minimal as possible. Users that use debfoster can use the + --include option of sbuild-createchroot. + + 11) Drop requirement for gpg inside the chroot as external archive keys are + now processed without gpg and signing of the internal repository is + entirely optional with helpful warning and error messages in case + signing failed. + + 12) Allow running autopkgtest after a successful build in the same manner + that piuparts can be run after a successful build. + * Major changes in 0.69.0: 1) Decouple chroot from host in terms of filesystem access to allow @@ -1,5 +1,5 @@ Package: sbuild -Version: 0.69.0 -Release-Date: 08 May 2016 +Version: 0.70.0 +Release-Date: 03 Aug 2016 Released-By: Johannes 'josch' Schauer <josch@mister-muffin.de> -Git-Tag: release/sbuild-0.69.0 +Git-Tag: release/sbuild-0.70.0 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -498,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -573,6 +573,9 @@ END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -602,7 +605,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -644,7 +647,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -694,7 +697,7 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -733,7 +736,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -762,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -781,7 +784,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -862,7 +865,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -922,7 +925,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -950,7 +953,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -969,7 +972,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/bin/Makefile.in b/bin/Makefile.in index 4bd67c8..e7f8115 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -58,7 +58,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -121,13 +131,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -183,6 +192,8 @@ am__can_run_installinfo = \ esac DATA = $(doc_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -281,6 +292,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -350,7 +362,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bin/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -359,7 +370,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -653,6 +664,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-docDATA \ uninstall-am uninstall-binSCRIPTS uninstall-docDATA \ uninstall-sbinSCRIPTS uninstall-sbuilddataSCRIPTS +.PRECIOUS: Makefile + install-exec-hook: # Additional directories diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot index 6216371..5f11b1a 100755 --- a/bin/sbuild-createchroot +++ b/bin/sbuild-createchroot @@ -72,6 +72,15 @@ sub setup { 'KEEP_SBUILD_CHROOT_DIR' => { DEFAULT => 0 }, + 'DEB_SRC' => { + DEFAULT => 1 + }, + 'ALIASES' => { + DEFAULT => [] + }, + 'EXTRA_REPOSITORIES' => { + DEFAULT => [] + }, ); $conf->set_allowed_keys(\%createchroot_keys); @@ -136,6 +145,15 @@ sub set_options { }, "keep-sbuild-chroot-dir" => sub { $self->set_conf('KEEP_SBUILD_CHROOT_DIR', 1); + }, + "no-deb-src" => sub { + $self->set_conf('DEB_SRC', 0); + }, + "alias=s" => sub { + push @{$self->get_conf('ALIASES')}, $_[1]; + }, + "extra-repository=s" => sub { + push @{$self->get_conf('EXTRA_REPOSITORIES')}, $_[1]; }); } @@ -170,14 +188,15 @@ usage_error("sbuild-createchroot", # Make sure fakeroot and build-essential are installed $conf->set('INCLUDE', add_items($conf->get('INCLUDE'), "fakeroot", - "build-essential", - "debfoster")); + "build-essential")); -my $suite = $ARGV[0]; +# Deal with SUITE-VARIANT +my $suitevariant = $ARGV[0]; +(my $suite = $suitevariant) =~ s/-.*//; # check if schroot name is already in use -my $chrootname = "${suite}-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX'); +my $chrootname = "${suitevariant}-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX'); open my $pipe, 'schroot -l --all-source-chroots |'; while (my $line = <$pipe>) { @@ -257,25 +276,32 @@ EOF close POLICY_RC_D or die "Can't close $policy_rc_d"; my (undef, undef, $uid, undef) = getpwnam('root'); -!chown($uid, -1, $policy_rc_d) +chown($uid, -1, $policy_rc_d) == 1 or die "E: Failed to set root: ownership on $policy_rc_d"; -!chmod(0775, $policy_rc_d) +chmod(0775, $policy_rc_d) == 1 or die "E: Failed to set 0755 permissions on $policy_rc_d"; # Display /usr/sbin/policy-rc.d. print "I: Configured /usr/sbin/policy-rc.d:\n"; dump_file("$policy_rc_d"); +if ($conf->get('DEB_SRC') || scalar @{$conf->get('EXTRA_REPOSITORIES')} > 0) { + my $sources = "${target}/etc/apt/sources.list"; + open(SOURCES, ">>$sources") + or die "E: Can't open $sources for writing"; + # Add deb-src to /etc/apt/sources.list. + if ($conf->get('DEB_SRC')) { + my $comps = join(' ',split(/,/,$conf->get('COMPONENTS'))); + print SOURCES "deb-src $mirror $suite $comps\n"; + } -# Set up minimal /etc/apt/sources.list -my $sources = "${target}/etc/apt/sources.list"; -my $comps = join(' ',split(/,/,$conf->get('COMPONENTS'))); -open(SOURCES, ">$sources") - or die "Can't open $sources for writing"; -print SOURCES "deb $mirror $suite $comps\n"; -print SOURCES "deb-src $mirror $suite $comps\n"; -close SOURCES or die "Can't close $sources"; + # Add extra repositories to /etc/apt/sources.list + for my $repo (@{$conf->get('EXTRA_REPOSITORIES')}) { + print SOURCES "$repo\n"; + } + close SOURCES or die "E: Can't close $sources"; +} # Display /etc/apt/sources.list. print "I: Configured APT /etc/apt/sources.list:\n"; @@ -284,9 +310,16 @@ print "I: Please add any additional APT sources to ${target}/etc/apt/sources.lis # Write out schroot chroot configuration. -# Determine the schroot chroot configuration to use. -my $config_entry; my $arch = $conf->get('BUILD_ARCH'); +my $config_entry = <<"EOF"; +[$chrootname] +description=Debian $suitevariant/$arch autobuilder +groups=root,sbuild +root-groups=root,sbuild +profile=sbuild +EOF + +# Determine the schroot chroot configuration to use. if ($conf->get('MAKE_SBUILD_TARBALL')) { my $tarball = $conf->get('MAKE_SBUILD_TARBALL'); @@ -298,40 +331,35 @@ if ($conf->get('MAKE_SBUILD_TARBALL')) { $conf->set('MAKE_SBUILD_TARBALL', $tarball); } - $config_entry = <<"EOF"; -[$chrootname] + $config_entry .= <<"EOF"; type=file -description=Debian $suite/$arch autobuilder file=$tarball -groups=root,sbuild -root-groups=root,sbuild -profile=sbuild EOF } else { # Determine whether system has overlayfs capability - my $uniontype = "union-type=none"; + my $uniontype = "none"; if (lc("$^O") =~ /linux/) { system(qw(/sbin/modprobe overlay)); if (open(FILE, "/proc/filesystems")) { if (grep {/\soverlay$/} <FILE>) { - $uniontype = "union-type=overlay"; + $uniontype = "overlay"; } close(FILE); } } - $config_entry = <<"EOF"; -[$chrootname] + $config_entry .= <<"EOF"; type=directory -$uniontype -description=Debian $suite/$arch autobuilder directory=$target -groups=root,sbuild -root-groups=root,sbuild -profile=sbuild +union-type=$uniontype EOF } +if (scalar @{$conf->get('ALIASES')} > 0) { + my $aliases = join ',', @{$conf->get('ALIASES')}; + $config_entry .= "aliases=$aliases\n"; +} + if (-d "/etc/schroot/chroot.d") { # TODO: Don't hardcode path my $SCHROOT_CONF = @@ -379,6 +407,8 @@ if (! -d "$Sbuild::Sysconfig::paths{'SBUILD_SYSCONF_DIR'}/chroot") { makedir("$Sbuild::Sysconfig::paths{'SBUILD_SYSCONF_DIR'}/chroot", 0775); } +# Populate /etc/sbuild/chroot with a symlink to be able to use the chroot in +# sudo mode for directory based chroots my $chrootlink = "$Sbuild::Sysconfig::paths{'SBUILD_SYSCONF_DIR'}/chroot/$chrootname"; if ((defined $chrootlink) && (! $conf->get('MAKE_SBUILD_TARBALL'))) { if (! -e $chrootlink) { @@ -467,7 +497,7 @@ if ($conf->get('MAKE_SBUILD_TARBALL')) { } } -print "I: Successfully set up $suite chroot.\n"; +print "I: Successfully set up $suitevariant chroot.\n"; print "I: Run \"sbuild-adduser\" to add new sbuild users.\n"; exit 0; diff --git a/configs/Makefile.in b/configs/Makefile.in index 5e92b55..b136adc 100644 --- a/configs/Makefile.in +++ b/configs/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am README subdir = configs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -180,6 +189,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(exampleconfdir)" DATA = $(exampleconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -278,6 +289,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -315,7 +327,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu configs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu configs/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -324,7 +335,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -509,6 +520,8 @@ uninstall-am: uninstall-exampleconfDATA mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \ uninstall uninstall-am uninstall-exampleconfDATA +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sbuild 0.69.0. +# Generated by GNU Autoconf 2.69 for sbuild 0.70.0. # # Report bugs to <buildd-tools-devel@lists.alioth.debian.org>. # @@ -597,8 +597,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sbuild' PACKAGE_TARNAME='sbuild' -PACKAGE_VERSION='0.69.0' -PACKAGE_STRING='sbuild 0.69.0' +PACKAGE_VERSION='0.70.0' +PACKAGE_STRING='sbuild 0.70.0' PACKAGE_BUGREPORT='buildd-tools-devel@lists.alioth.debian.org' PACKAGE_URL='' @@ -701,6 +701,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -776,6 +777,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1028,6 +1030,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1165,7 +1176,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1278,7 +1289,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sbuild 0.69.0 to adapt to many kinds of systems. +\`configure' configures sbuild 0.70.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1318,6 +1329,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1348,7 +1360,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sbuild 0.69.0:";; + short | recursive ) echo "Configuration of sbuild 0.70.0:";; esac cat <<\_ACEOF @@ -1443,7 +1455,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sbuild configure 0.69.0 +sbuild configure 0.70.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1516,7 +1528,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sbuild $as_me 0.69.0, which was +It was created by sbuild $as_me 0.70.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1899,7 +1911,7 @@ ac_config_headers="$ac_config_headers config.h" -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2091,7 +2103,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2385,7 +2397,7 @@ fi # Define the identity of the package. PACKAGE='sbuild' - VERSION='0.69.0' + VERSION='0.70.0' cat >>confdefs.h <<_ACEOF @@ -2419,8 +2431,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -2602,8 +2614,8 @@ else fi AM_BACKSLASH='\' -RELEASE_DATE='08 May 2016' -RELEASE_DATE_S='1462658400' +RELEASE_DATE='03 Aug 2016' +RELEASE_DATE_S='1470175200' cat >>confdefs.h <<_ACEOF #define RELEASE_DATE "$RELEASE_DATE_S" @@ -4323,7 +4335,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sbuild $as_me 0.69.0, which was +This file was extended by sbuild $as_me 0.70.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4389,7 +4401,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sbuild config.status 0.69.0 +sbuild config.status 0.70.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/db/Makefile.in b/db/Makefile.in index b9b168d..4532085 100644 --- a/db/Makefile.in +++ b/db/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = db ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -180,6 +189,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(sqldir)" DATA = $(sql_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -278,6 +289,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -326,7 +338,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu db/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu db/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -335,7 +346,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -521,6 +532,8 @@ uninstall-am: uninstall-sqlDATA pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-sqlDATA +.PRECIOUS: Makefile + db.sql: db.sql.in sqlpath=$$(echo "$(sqldir)"); \ diff --git a/etc/Makefile.in b/etc/Makefile.in index b78ddf1..c8be020 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -58,7 +58,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -121,13 +131,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -184,6 +193,8 @@ am__can_run_installinfo = \ esac DATA = $(builddsysconf_DATA) $(exampleconf_DATA) $(sbuildsysconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -282,6 +293,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -330,7 +342,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -339,7 +350,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -608,6 +619,8 @@ uninstall-am: uninstall-builddsysconfDATA uninstall-exampleconfDATA \ uninstall-exampleconfDATA uninstall-sbuildsysconfDATA \ uninstall-schrootsetupSCRIPTS +.PRECIOUS: Makefile + sbuild.conf: $(abs_top_srcdir)/tools/sbuild-dumpconfig PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ diff --git a/lib/Buildd/Conf.pm b/lib/Buildd/Conf.pm index 0fc3c50..b9cf010 100644 --- a/lib/Buildd/Conf.pm +++ b/lib/Buildd/Conf.pm @@ -122,6 +122,7 @@ sub setup ($) { TYPE => 'STRING', VARNAME => 'daemon_log_file', GROUP => 'Daemon', + IGNORE_DEFAULT => 1, # Don't dump the current home DEFAULT => "$HOME/daemon.log", HELP => 'Main buildd daemon log file' }, @@ -215,6 +216,7 @@ sub setup ($) { GROUP => 'Daemon', # Set once running as a system service. # DEFAULT => "${Sbuild::Sysconfig::paths{'LOCALSTATEDIR'}/run/buildd.pid" + IGNORE_DEFAULT => 1, # Don't dump the current home DEFAULT => "$HOME/build/buildd.pid", HELP => 'PID file to identify running daemon.' }, diff --git a/lib/Buildd/Makefile.in b/lib/Buildd/Makefile.in index b0657fb..823d19f 100644 --- a/lib/Buildd/Makefile.in +++ b/lib/Buildd/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = lib/Buildd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -180,6 +189,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(perlmodbuildddir)" DATA = $(perlmodbuildd_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -278,6 +289,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -323,7 +335,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Buildd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Buildd/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -332,7 +343,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -517,6 +528,8 @@ uninstall-am: uninstall-perlmodbuilddDATA mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-perlmodbuilddDATA +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lib/Makefile.in b/lib/Makefile.in index 041fffa..69c0037 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -215,6 +224,8 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -338,6 +349,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -372,7 +384,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -381,7 +392,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -686,6 +697,8 @@ uninstall-am: uninstall-perlmodDATA mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-perlmodDATA +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lib/Sbuild.pm b/lib/Sbuild.pm index ffea8b1..61584b5 100644 --- a/lib/Sbuild.pm +++ b/lib/Sbuild.pm @@ -33,6 +33,7 @@ use IO::Zlib; use MIME::Base64; use Dpkg::Control; use Dpkg::Checksums; +use POSIX qw(locale_h); BEGIN { use Exporter (); @@ -43,7 +44,7 @@ BEGIN { @EXPORT = qw($debug_level $devnull binNMU_version parse_date isin copy dump_file check_packages help_text version_text usage_error send_mail debug debug2 df - check_group_membership dsc_files dsc_pkgver shellescape); + check_group_membership dsc_files dsc_pkgver shellescape strftime_c); } our $devnull; @@ -70,6 +71,7 @@ sub debug2 (@); sub check_group_membership(); sub dsc_files ($); sub shellescape ($); +sub strftime_c ($@); sub binNMU_version ($$$) { my $v = shift; @@ -250,7 +252,7 @@ sub help_text ($$) { my $section = shift; my $page = shift; - system(qw('man --'), $section, $page); + system('man', '--', $section, $page); exit 0; } @@ -432,4 +434,18 @@ sub shellescape ($) { return "'$string'"; }; +# this function uses strftime to format a timestamp as a string but makes sure +# to use the C locale to do so instead of the system locale +sub strftime_c ($@) { + my $format = shift; + my @time = @_; + + my $old_locale = setlocale(LC_TIME); + setlocale(LC_TIME, "C.UTF-8"); + my $ret = strftime $format, @time; + setlocale(LC_TIME, $old_locale); + + return $ret; +} + 1; diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm index f5cec06..e37867d 100644 --- a/lib/Sbuild/Build.pm +++ b/lib/Sbuild/Build.pm @@ -45,7 +45,7 @@ use MIME::Lite; use Term::ANSIColor; use Sbuild qw($devnull binNMU_version copy isin debug send_mail - dsc_files dsc_pkgver); + dsc_files dsc_pkgver strftime_c); use Sbuild::Base; use Sbuild::ChrootInfoSchroot; use Sbuild::ChrootInfoSudo; @@ -821,6 +821,10 @@ sub run_fetch_install_packages { $self->check_abort(); $self->run_piuparts(); + # Run autopkgtest. + $self->check_abort(); + $self->run_autopkgtest(); + # Run post build external commands $self->check_abort(); if(!$self->run_external_commands("post-build-commands")) { @@ -1138,6 +1142,15 @@ sub check_architectures { $self->log_subsection("Check architectures"); # Check for cross-arch dependencies # parse $build_depends* for explicit :arch and add the foreign arches, as needed + # + # This check only looks at the immediate build dependencies. This could + # fail in a future where a foreign architecture direct build dependency of + # architecture X depends on another foreign architecture package of + # architecture Y. Architecture Y would not be added through this check as + # sbuild will not traverse the dependency graph. Doing so would be very + # complicated as new architectures would have to be added to a dependency + # solver like dose3 as the graph is traversed and new architectures are + # found. sub get_explicit_arches { my $visited_deps = pop; @@ -1466,7 +1479,7 @@ sub run_lintian { my $build_dir = $self->get('Build Dir'); my $resolver = $self->get('Dependency Resolver'); my $lintian = $self->get_conf('LINTIAN'); - my $changes = $self->get_changes($build_dir); + my $changes = $self->get_changes(); if (!defined($changes)) { $self->log_error(".changes is undef. Cannot run lintian.\n"); return 0; @@ -1541,6 +1554,49 @@ sub run_piuparts { return 1; } +sub run_autopkgtest { + my $self = shift; + + return 1 unless ($self->get_conf('RUN_AUTOPKGTEST')); + + $self->log_subsubsection("autopkgtest"); + + my $autopkgtest = $self->get_conf('AUTOPKGTEST'); + my @autopkgtest_command; + if (scalar(@{$self->get_conf('AUTOPKGTEST_ROOT_ARGS')})) { + push @autopkgtest_command, @{$self->get_conf('AUTOPKGTEST_ROOT_ARGS')}; + } else { + push @autopkgtest_command, 'sudo', '--'; + } + push @autopkgtest_command, $autopkgtest; + if (!$self->get_conf('BUILD_SOURCE')) { + push @autopkgtest_command, $self->get('DSC'); + } + push @autopkgtest_command, $self->get('Changes File'); + if (scalar(@{$self->get_conf('AUTOPKGTEST_OPTIONS')})) { + push @autopkgtest_command, @{$self->get_conf('AUTOPKGTEST_OPTIONS')}; + } else { + push @autopkgtest_command, '--', 'null'; + } + $self->get('Host')->run_command( + { COMMAND => \@autopkgtest_command, + PRIORITY => 0, + }); + my $status = $? >> 8; + $self->set('Autopkgtest Reason', 'pass'); + + $self->log("\n"); + # fail if neither all tests passed nor was the package without tests + if ($status != 0 && $status != 8) { + $self->log_error("Autopkgtest run failed.\n"); + $self->set('Autopkgtest Reason', 'fail'); + return 0; + } + + $self->log_info("Autopkgtest run was successful.\n"); + return 1; +} + sub build { my $self = shift; @@ -1940,7 +1996,7 @@ sub build { $self->get('Build End Time')-$self->get('Build Start Time')); $self->write_stats('install-download-time', $self->get('Install End Time')-$self->get('Install Start Time')); - my $finish_date = strftime("%Y%m%d-%H%M",localtime($self->get('Build End Time'))); + my $finish_date = strftime_c "%FT%TZ", gmtime($self->get('Build End Time')); $self->log_sep(); $self->log("Build finished at $finish_date\n"); @@ -1954,7 +2010,8 @@ sub build { $self->log_subsubsection("Finished"); if ($rv) { - $self->log_error("Build failure (dpkg-buildpackage died)\n"); + Sbuild::Exception::Build->throw(error => "Build failure (dpkg-buildpackage died)", + failstage => "build"); } else { $self->log_info("Built successfully\n"); @@ -1989,15 +2046,10 @@ sub build { } $self->log_subsection("Changes"); - $changes = $self->get_changes($build_dir); - if (!defined($changes)) { - $self->log_error(".changes is undef. Cannot copy build results.\n"); - return 0; - } - my @cfiles; - if ($session->test_regular_file_readable("$build_dir/$changes")) { - my(@do_dists, @saved_dists); - $self->log_subsubsection("$changes:"); + + my $copy_changes = sub { + my $changes = shift; + my $F = $session->get_read_file_handle("$build_dir/$changes"); if (!$F) { $self->log_error("cannot get read file handle for $build_dir/$changes\n"); @@ -2017,11 +2069,6 @@ sub build { $pchanges->{Distribution} = $self->get_conf('DISTRIBUTION'); } - my $checksums = Dpkg::Checksums->new(); - $checksums->add_from_control($pchanges); - - push(@cfiles, $checksums->get_files()); - my $sys_build_dir = $self->get_conf('BUILD_DIR'); if (!open( F2, ">$sys_build_dir/$changes.new" )) { $self->log("Cannot create $sys_build_dir/$changes.new: $!\n"); @@ -2043,11 +2090,63 @@ sub build { unlink("$build_dir/$changes") if $build_dir; } + + return $pchanges; + }; + + $changes = $self->get_changes(); + if (!defined($changes)) { + $self->log_error(".changes is undef. Cannot copy build results.\n"); + return 0; + } + my @cfiles; + if ($session->test_regular_file_readable("$build_dir/$changes")) { + my(@do_dists, @saved_dists); + $self->log_subsubsection("$changes:"); + + my $pchanges = &$copy_changes($changes); + + my $checksums = Dpkg::Checksums->new(); + $checksums->add_from_control($pchanges); + + push(@cfiles, $checksums->get_files()); + } else { $self->log_error("Can't find $changes -- can't dump info\n"); } + if ($self->get_conf('SOURCE_ONLY_CHANGES')) { + my $so_changes = $self->get('Package_SVersion') . "_source.changes"; + $self->log_subsubsection("$so_changes:"); + my $genchangescmd = ['dpkg-genchanges', '--build=source']; + if (defined($self->get_conf('SIGNING_OPTIONS')) && + $self->get_conf('SIGNING_OPTIONS')) { + if (ref($self->get_conf('SIGNING_OPTIONS')) eq 'ARRAY') { + push (@{$genchangescmd}, @{$self->get_conf('SIGNING_OPTIONS')}); + } else { + push (@{$genchangescmd}, $self->get_conf('SIGNING_OPTIONS')); + } + } + my $cfile = $session->read_command( + { COMMAND => $genchangescmd, + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0, + DIR => $dscdir}); + if (!$cfile) { + $self->log_error("dpkg-genchanges --build=source failed\n"); + Sbuild::Exception::Build->throw(error => "dpkg-genchanges --build=source failed", + failstage => "source-only-changes"); + } + if (!$session->write_file("$build_dir/$so_changes", $cfile)) { + $self->log_error("cannot write content to $build_dir/$so_changes\n"); + Sbuild::Exception::Build->throw(error => "cannot write content to $build_dir/$so_changes", + failstage => "source-only-changes"); + } + + my $pchanges = &$copy_changes($so_changes); + } + $self->log_subsection("Package contents"); my @debcfiles = @cfiles; @@ -2082,7 +2181,10 @@ sub build { } } - $self->check_space(@space_files); + $self->set('This Time', $self->get('Pkg End Time') - $self->get('Pkg Start Time')); + $self->get('This Time') = 0 if $self->get('This Time') < 0; + + $self->set('This Space', $self->check_space(@space_files)); return $rv == 0 ? 1 : 0; } @@ -2113,40 +2215,16 @@ sub get_env ($$) { sub get_changes { my $self=shift; - my $path=shift; my $changes; - my $session = $self->get('Session'); - return if not defined($session); - - if ($session->test_regular_file_readable($path . '/' . $self->get('Package_SVersion') . "_source.changes")) { - $changes = $self->get('Package_SVersion') . "_source.changes"; - } - elsif ($session->test_regular_file_readable($path . '/' . $self->get('Package_SVersion') . "_all.changes")) { - $changes = $self->get('Package_SVersion') . "_all.changes"; - } - else { + if ($self->get_conf('BUILD_ARCH_ANY')) { $changes = $self->get('Package_SVersion') . '_' . $self->get('Host Arch') . '.changes'; - } - return $changes; -} - -# same as get_changes but checks for the .changes file on the host running -# sbuild instead of inside the chroot -sub get_changes_host { - my $self=shift; - my $path=shift; - my $changes; - - if ( -r $path . '/' . $self->get('Package_SVersion') . "_source.changes") { - $changes = $self->get('Package_SVersion') . "_source.changes"; - } - elsif ( -r $path . '/' . $self->get('Package_SVersion') . "_all.changes") { + } elsif ($self->get_conf('BUILD_ARCH_ALL')) { $changes = $self->get('Package_SVersion') . "_all.changes"; + } elsif ($self->get_conf('BUILD_SOURCE')) { + $changes = $self->get('Package_SVersion') . "_source.changes"; } - else { - $changes = $self->get('Package_SVersion') . '_' . $self->get('Host Arch') . '.changes'; - } + return $changes; } @@ -2158,41 +2236,50 @@ sub check_space { my $dscdir = $self->get('DSC Dir'); my $build_dir = $self->get('Build Dir'); my $pkgbuilddir = "$build_dir/$dscdir"; + my ($space, $spacenum); - my $pkgbuilddirspc = $self->get('Session')->read_command( + # get the required space for the unpacked source package in the chroot + $space = $self->get('Session')->read_command( { COMMAND => ['du', '-k', '-s', $pkgbuilddir], USER => $self->get_conf('USERNAME'), PRIORITY => 0, DIR => '/'}); - if (!$pkgbuilddirspc) { - $self->log_error("Cannot determine space needed (du failed)\n"); + if (!$space) { + $self->log_error("Cannot determine space needed for $pkgbuilddir (du failed)\n"); + return -1; } - if ($pkgbuilddirspc !~ /^(\d+)/) { - $self->log_error("Cannot determine space needed (unexpected du output): $pkgbuilddirspc\n"); + # remove the trailing path from the du output + if (($spacenum) = $space =~ /^(\d+)/) { + $sum += $spacenum; + } else { + $self->log_error("Cannot determine space needed for $pkgbuilddir (unexpected du output): $space\n"); + return -1; } - $sum += $1; - foreach (@files) { - my $space = $self->get('Host')->read_command( - { COMMAND => ['du', '-k', '-s', $_], + # get the required space for all produced build artifacts on the host + # running sbuild + foreach my $file (@files) { + $space = $self->get('Host')->read_command( + { COMMAND => ['du', '-k', '-s', $file], USER => $self->get_conf('USERNAME'), PRIORITY => 0, DIR => '/'}); if (!$space) { - $self->log_error("Cannot determine space needed (du failed): $!\n"); - next; + $self->log_error("Cannot determine space needed for $file (du failed): $!\n"); + return -1; } - if ($pkgbuilddirspc !~ /^(\d+)/) { - $self->log_error("Cannot determine space needed (unexpected du output): $space\n"); + # remove the trailing path from the du output + if (($spacenum) = $space =~ /^(\d+)/) { + $sum += $spacenum; + } else { + $self->log_error("Cannot determine space needed for $file (unexpected du output): $space\n"); + return -1; } - $sum += $1; } - $self->set('This Time', $self->get('Pkg End Time') - $self->get('Pkg Start Time')); - $self->get('This Time') = 0 if $self->get('This Time') < 0; - $self->set('This Space', $sum); + return $sum; } sub lock_file { @@ -2305,6 +2392,8 @@ sub generate_stats { if $self->get('Lintian Reason'); $self->add_stat('Piuparts', $self->get('Piuparts Reason')) if $self->get('Piuparts Reason'); + $self->add_stat('Autopkgtest', $self->get('Autopkgtest Reason')) + if $self->get('Autopkgtest Reason'); } sub log_stats { @@ -2410,7 +2499,7 @@ sub build_log_colour { sub open_build_log { my $self = shift; - my $date = strftime("%Y%m%d-%H%M", localtime($self->get('Pkg Start Time'))); + my $date = strftime_c "%FT%TZ", gmtime($self->get('Pkg Start Time')); my $filter_prefix = '__SBUILD_FILTER_' . $$ . ':'; $self->set('FILTER_PREFIX', $filter_prefix); @@ -2553,17 +2642,14 @@ sub open_build_log { my $hostname = $self->get_conf('HOSTNAME'); $self->log("sbuild (Debian sbuild) $version ($release_date) on $hostname\n"); - my $arch_string = $self->get('Build Arch'); - $arch_string = 'CROSS host=' . $self->get('Host Arch') . - '/build=' . $self->get('Build Arch') - if ($self->get('Host Arch') ne $self->get('Build Arch')); + my $arch_string = $self->get('Host Arch'); my $head1 = $self->get('Package'); if ($self->get('Version')) { $head1 .= ' ' . $self->get('Version'); } $head1 .= ' (' . $arch_string . ') '; - my $head2 = strftime("%d %b %Y %H:%M", - localtime($self->get('Pkg Start Time'))); + my $head2 = strftime_c "%a, %d %b %Y %H:%M:%S +0000", + gmtime($self->get('Pkg Start Time')); my $head = $head1 . ' ' x (80 - 4 - length($head1) - length($head2)) . $head2; $self->log_section($head); @@ -2588,7 +2674,7 @@ sub close_build_log { if ($time == 0) { $time = time; } - my $date = strftime("%Y%m%d-%H%M", localtime($time)); + my $date = strftime_c "%FT%TZ", gmtime($time); my $hours = int($self->get('This Time')/3600); my $minutes = int(($self->get('This Time')%3600)/60), @@ -2617,11 +2703,19 @@ sub close_build_log { my $build_dir = $self->get_conf('BUILD_DIR'); my $changes; $self->log(sprintf("Signature with key '%s' requested:\n", $key_id)); - $changes = $self->get_changes_host($build_dir); + $changes = $self->get_changes(); if (!defined($changes)) { $self->log_error(".changes is undef. Cannot sign .changes.\n"); } else { - system('debsign', "-k$key_id", '--', "$build_dir/$changes"); + system('debsign', '--re-sign', "-k$key_id", '--', "$build_dir/$changes"); + } + if ($self->get_conf('SOURCE_ONLY_CHANGES')) { + my $so_changes = $build_dir . '/' . $self->get('Package_SVersion') . "_source.changes"; + if (-r $so_changes) { + system('debsign', '--re-sign', "-k$key_id", '--', "$so_changes"); + } else { + $self->log_error("$so_changes unreadable. Cannot sign .changes.\n"); + } } } } @@ -2738,7 +2832,7 @@ sub send_mime_build_log { ); } my $build_dir = $self->get_conf('BUILD_DIR'); - my $changes = $self->get_changes_host($build_dir); + my $changes = $self->get_changes(); if ($self->get_status() eq 'successful' && -r "$build_dir/$changes") { my $log_part = MIME::Lite->new( Type => 'text/plain', diff --git a/lib/Sbuild/Chroot.pm b/lib/Sbuild/Chroot.pm index 9a84a49..61d4197 100644 --- a/lib/Sbuild/Chroot.pm +++ b/lib/Sbuild/Chroot.pm @@ -26,6 +26,7 @@ use Sbuild qw(copy debug debug2); use Sbuild::Base; use Sbuild::ChrootInfo; use Sbuild::ChrootSetup qw(basesetup); +use Sbuild qw(shellescape); use strict; use warnings; @@ -249,8 +250,10 @@ sub get_read_file_handle { my $dir = "/"; $dir = $options->{'DIR'} if defined $options->{'DIR'}; + my $escapedsource = shellescape $source; + my $pipe = $self->pipe_command({ - COMMAND => [ "sh", "-c", "cat \"$source\"" ], + COMMAND => [ "sh", "-c", "cat $escapedsource" ], DIR => $dir, USER => $user, PIPE => 'in' @@ -293,8 +296,10 @@ sub get_write_file_handle { my $dir = "/"; $dir = $options->{'DIR'} if defined $options->{'DIR'}; + my $escapeddest = shellescape $dest; + my $pipe = $self->pipe_command({ - COMMAND => [ "sh", "-c", "cat > \"$dest\"" ], + COMMAND => [ "sh", "-c", "cat > $escapeddest" ], DIR => $dir, USER => $user, PIPE => 'out' @@ -582,6 +587,32 @@ sub chown { return 1; } +# test if a program inside the chroot can be run +# we use the function name "can_run" as it is similar to the function in +# IPC::Cmd +sub can_run { + my $self = shift; + my $program = shift; + my $options = shift; + + my $user = "root"; + $user = $options->{'USER'} if defined $options->{'USER'}; + + my $dir = "/"; + $dir = $options->{'DIR'} if defined $options->{'DIR'}; + + my $escapedprogram = shellescape $program; + + my $commandcmd = [ 'sh', '-c', "command -v $escapedprogram >/dev/null 2>&1" ]; + + $self->run_command({ COMMAND => $commandcmd, USER => $user, DIR => $dir}); + if ($?) { + return 0; + } + + return 1; +} + # Note, do not run with $user="root", and $chroot=0, because root # access to the host system is not allowed by schroot, nor required # via sudo. diff --git a/lib/Sbuild/ChrootSetup.pm b/lib/Sbuild/ChrootSetup.pm index a6a5e92..d45ef68 100644 --- a/lib/Sbuild/ChrootSetup.pm +++ b/lib/Sbuild/ChrootSetup.pm @@ -238,10 +238,8 @@ Name-Real: Sbuild Signer Name-Comment: Sbuild Build Dependency Archive Key Name-Email: buildd-tools-devel\@lists.alioth.debian.org Expire-Date: 0 +%commit EOF - print $tmpfh '%secring ' . $conf->get('SBUILD_BUILD_DEPENDS_SECRET_KEY') . "\n"; - print $tmpfh '%pubring ' . $conf->get('SBUILD_BUILD_DEPENDS_PUBLIC_KEY') . "\n"; - print $tmpfh '%commit' . "\n"; close($tmpfh); my $gnupghome = $ENV{'GNUPGHOME'}; @@ -287,10 +285,37 @@ EOF return $?; } + # export keys + @command = ('gpg', '--batch', '--yes', '--export-secret-keys', '--armor', + '--output', $conf->get('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED'), + 'buildd-tools-devel@lists.alioth.debian.org'); + $host->run_command( + { COMMAND => \@command, + USER => $conf->get('BUILD_USER'), + PRIORITY => 0, + DIR => '/'}); + if ($?) { + print STDERR "E: Unable to export secret key."; + return $?; + } + + @command = ('gpg', '--batch', '--yes', '--export', '--armor', + '--output', $conf->get('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED'), + 'buildd-tools-devel@lists.alioth.debian.org'); + $host->run_command( + { COMMAND => \@command, + USER => $conf->get('BUILD_USER'), + PRIORITY => 0, + DIR => '/'}); + if ($?) { + print STDERR "E: Unable to export public key."; + return $?; + } + # Keys needs to be readable by 'sbuild' group. @command = ('chmod', '640', - $conf->get('SBUILD_BUILD_DEPENDS_SECRET_KEY'), - $conf->get('SBUILD_BUILD_DEPENDS_PUBLIC_KEY')); + $conf->get('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED'), + $conf->get('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED')); $host->run_command( { COMMAND => \@command, USER => $conf->get('BUILD_USER'), diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm index c46da7c..14945ae 100644 --- a/lib/Sbuild/Conf.pm +++ b/lib/Sbuild/Conf.pm @@ -358,6 +358,7 @@ sub setup ($) { TYPE => 'STRING', VARNAME => 'stats_dir', GROUP => 'Statistics', + IGNORE_DEFAULT => 1, # Don't dump the current home DEFAULT => "$HOME/stats", HELP => 'Directory for writing build statistics to', CLI_OPTIONS => ['--stats-dir'] @@ -1073,6 +1074,51 @@ $crossbuild_core_depends = { HELP => 'Preceding arguments to launch piuparts as root. If no arguments are specified, piuparts will be launched via sudo.', CLI_OPTIONS => ['--piuparts-root-arg', '--piuparts-root-args'] }, + 'AUTOPKGTEST' => { + TYPE => 'STRING', + VARNAME => 'autopkgtest', + GROUP => 'Build validation', + CHECK => sub { + my $conf = shift; + my $entry = shift; + my $key = $entry->{'NAME'}; + + # Only validate if needed. + if ($conf->get('RUN_AUTOPKGTEST')) { + $validate_program->($conf, $entry); + } + }, + DEFAULT => 'autopkgtest', + HELP => 'Path to autopkgtest binary', + CLI_OPTIONS => ['--autopkgtest-opt', '--autopkgtest-opts'] + }, + 'RUN_AUTOPKGTEST' => { + TYPE => 'BOOL', + VARNAME => 'run_autopkgtest', + GROUP => 'Build validation', + CHECK => sub { + my $conf = shift; + $conf->check('AUTOPKGTEST'); + }, + DEFAULT => 0, + HELP => 'Run autopkgtest', + CLI_OPTIONS => ['--run-autopkgtest', '--no-run-autopkgtest'] + }, + 'AUTOPKGTEST_OPTIONS' => { + TYPE => 'ARRAY:STRING', + VARNAME => 'autopkgtest_opts', + GROUP => 'Build validation', + DEFAULT => [], + HELP => 'Options to pass to autopkgtest. Each option is a separate arrayref element. For example, [\'-b\', \'<chroot_tarball>\'] to add -b and <chroot_tarball>.' + }, + 'AUTOPKGTEST_ROOT_ARGS' => { + TYPE => 'ARRAY:STRING', + VARNAME => 'autopkgtest_root_args', + GROUP => 'Build validation', + DEFAULT => [], + HELP => 'Preceding arguments to launch autopkgtest as root. If no arguments are specified, autopkgtest will be launched via sudo.', + CLI_OPTIONS => ['--autopkgtest-root-arg', '--autopkgtest-root-args'] + }, 'EXTERNAL_COMMANDS' => { TYPE => 'HASH:ARRAY:STRING', VARNAME => 'external_commands', @@ -1174,14 +1220,28 @@ $crossbuild_core_depends = { VARNAME => 'sbuild_build_depends_secret_key', GROUP => 'Dependency resolution', DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.sec', - HELP => 'GPG secret key for temporary local apt archive.' + HELP => 'GPG secret key for temporary local apt archive in GPG native format. This setting is deprecated and is superseded by SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED.' }, 'SBUILD_BUILD_DEPENDS_PUBLIC_KEY' => { TYPE => 'STRING', VARNAME => 'sbuild_build_depends_public_key', GROUP => 'Dependency resolution', DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.pub', - HELP => 'GPG public key for temporary local apt archive.' + HELP => 'GPG public key for temporary local apt archive in GPG native format. This setting is deprecated and is superseded by SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED.' + }, + 'SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED' => { + TYPE => 'STRING', + VARNAME => 'sbuild_build_depends_secret_key_armored', + GROUP => 'Dependency resolution', + DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.sec.asc', + HELP => 'GPG secret key for temporary local apt archive in armored ASCII format.' + }, + 'SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED' => { + TYPE => 'STRING', + VARNAME => 'sbuild_build_depends_public_key_armored', + GROUP => 'Dependency resolution', + DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.pub.asc', + HELP => 'GPG public key for temporary local apt archive in armored ASCII format.' }, 'EXTRA_PACKAGES' => { TYPE => 'ARRAY:STRING', @@ -1207,6 +1267,14 @@ $crossbuild_core_depends = { HELP => 'Additional per-build apt repositories.', CLI_OPTIONS => ['--extra-repository'] }, + 'SOURCE_ONLY_CHANGES' => { + TYPE => 'BOOL', + VARNAME => 'source_only_changes', + GROUP => 'Build options', + DEFAULT => 0, + HELP => 'Also produce a changes file suitable for a source-only upload.', + CLI_OPTIONS => ['--source-only-changes'] + }, ); $conf->set_allowed_keys(\%sbuild_keys); diff --git a/lib/Sbuild/Makefile.in b/lib/Sbuild/Makefile.in index 8f80b13..014f9c1 100644 --- a/lib/Sbuild/Makefile.in +++ b/lib/Sbuild/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(srcdir)/Sysconfig.pm.in subdir = lib/Sbuild ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = Sysconfig.pm @@ -180,6 +189,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(perlmodsbuilddir)" DATA = $(perlmodsbuild_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Sysconfig.pm.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -278,6 +289,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -340,7 +352,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Sbuild/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Sbuild/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -349,7 +360,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -536,6 +547,8 @@ uninstall-am: uninstall-perlmodsbuildDATA mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-perlmodsbuildDATA +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lib/Sbuild/Options.pm b/lib/Sbuild/Options.pm index 0dc6f75..2b436ef 100644 --- a/lib/Sbuild/Options.pm +++ b/lib/Sbuild/Options.pm @@ -50,6 +50,7 @@ sub set_options { my ($opt_clean_source, $opt_no_clean_source); my ($opt_run_lintian, $opt_no_run_lintian); my ($opt_run_piuparts, $opt_no_run_piuparts); + my ($opt_run_autopkgtest, $opt_no_run_autopkgtest); $self->add_options("arch=s" => sub { if (defined $opt_arch && $opt_arch ne $_[1]) { @@ -440,6 +441,36 @@ sub set_options { push(@{$self->get_conf('PIUPARTS_ROOT_ARGS')}, $_[1]); }, + "run-autopkgtest" => sub { + if ($opt_no_run_autopkgtest) { + die "--run-autopkgtest cannot be used together with --no-run-autopkgtest"; + } + $self->set_conf('RUN_AUTOPKGTEST', 1); + $opt_run_autopkgtest = 1; + }, + "no-run-autopkgtest" => sub { + if ($opt_run_autopkgtest) { + die "--no-run-autopkgtest cannot be used together with --run-autopkgtest"; + } + $self->set_conf('RUN_AUTOPKGTEST', 0); + $opt_no_run_autopkgtest = 1; + }, + "autopkgtest-opts=s" => sub { + push(@{$self->get_conf('AUTOPKGTEST_OPTIONS')}, + split(/\s+/, $_[1])); + }, + "autopkgtest-opt=s" => sub { + push(@{$self->get_conf('AUTOPKGTEST_OPTIONS')}, + $_[1]); + }, + "autopkgtest-root-args=s" => sub { + push(@{$self->get_conf('AUTOPKGTEST_ROOT_ARGS')}, + split(/\s+/, $_[1])); + }, + "autopkgtest-root-arg=s" => sub { + push(@{$self->get_conf('AUTOPKGTEST_ROOT_ARGS')}, + $_[1]); + }, "pre-build-commands=s" => sub { push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"pre-build-commands"}}, $_[1]); @@ -506,6 +537,9 @@ sub set_options { "build-path=s" => sub { $self->set_conf('BUILD_PATH', $_[1]); }, + "source-only-changes" => sub { + $self->set_conf('SOURCE_ONLY_CHANGES', 1); + }, ); } diff --git a/lib/Sbuild/ResolverBase.pm b/lib/Sbuild/ResolverBase.pm index b480cd2..7ae1254 100644 --- a/lib/Sbuild/ResolverBase.pm +++ b/lib/Sbuild/ResolverBase.pm @@ -25,8 +25,9 @@ use strict; use warnings; use POSIX; use Fcntl; -use File::Temp qw(tempfile); +use File::Temp qw(mktemp); use File::Copy; +use MIME::Base64; use Dpkg::Deps; use Sbuild::Base; @@ -67,6 +68,10 @@ sub new { '/etc/apt/sources.list.d/sbuild-build-depends-archive.list'; $self->set('Dummy archive list file', $dummy_archive_list_file); + my $extra_repositories_list_file = + '/etc/apt/sources.list.d/sbuild-extra-repositories.list'; + $self->set('Extra repositories list file', $extra_repositories_list_file); + my $dummy_archive_key_file = '/etc/apt/trusted.gpg.d/sbuild-build-depends-archive.gpg'; $self->set('Dummy archive key file', $dummy_archive_key_file); @@ -103,7 +108,7 @@ sub setup { # Always write out apt.conf, because it may become outdated. if ($self->get_conf('APT_ALLOW_UNAUTHENTICATED')) { - print $F qq(APT::Get::AllowUnauthenticated "true";\n"); + print $F qq(APT::Get::AllowUnauthenticated "true";\n); } print $F qq(APT::Install-Recommends "false";\n); print $F qq(APT::AutoRemove::SuggestsImportant "false";\n); @@ -154,7 +159,146 @@ sub setup { $self->get('APT Conf'); } - $self->cleanup_apt_archive(); + # Add specified extra repositories into /etc/apt/sources.list.d/. + # This has to be done this early so that the early apt + # update/upgrade/distupgrade steps also consider the extra repositories. + # If this step would be done too late, extra repositories would only be + # considered when resolving build dependencies but not for upgrading the + # base chroot. + if (scalar @{$self->get_conf('EXTRA_REPOSITORIES')} > 0) { + my $extra_repositories_list_file = $self->get('Extra repositories list file'); + if ($session->test_regular_file($extra_repositories_list_file)) { + $self->log_error("$extra_repositories_list_file exists - will not write extra repositories to it\n"); + } else { + my $tmpfilename = $session->mktemp(); + + my $tmpfh = $session->get_write_file_handle($tmpfilename); + if (!$tmpfh) { + $self->log_error("Cannot open pipe: $!\n"); + return 0; + } + for my $repospec (@{$self->get_conf('EXTRA_REPOSITORIES')}) { + print $tmpfh "$repospec\n"; + } + close $tmpfh; + # List file needs to be moved with root. + if (!$session->chmod($tmpfilename, '0644')) { + $self->log("Failed to create apt list file for dummy archive.\n"); + $session->unlink($tmpfilename); + return 0; + } + if (!$session->rename($tmpfilename, $extra_repositories_list_file)) { + $self->log("Failed to create apt list file for dummy archive.\n"); + $session->unlink($tmpfilename); + return 0; + } + } + } + + # Now, we'll add in any provided OpenPGP keys into the archive, so that + # builds can (optionally) trust an external key for the duration of the + # build. + # + # Keys have to be in a format that apt expects to land in + # /etc/apt/trusted.gpg.d as they are just copied to there. We could also + # support more formats by first importing them using gpg and then + # exporting them but that would require gpg to be installed inside the + # chroot. + if (@{$self->get_conf('EXTRA_REPOSITORY_KEYS')}) { + my $host = $self->get('Host'); + # remember whether running gpg worked or not + my $has_gpg = 1; + for my $repokey (@{$self->get_conf('EXTRA_REPOSITORY_KEYS')}) { + debug("Adding archive key: $repokey\n"); + if (!-f $repokey) { + $self->log("Failed to add archive key '${repokey}' - it doesn't exist!\n"); + return 0; + } + # key might be armored but apt requires keys in binary format + # We first try to run gpg from the host to convert the key into + # binary format (this works even when the key already is in binary + # format). + my $tmpfilename = mktemp("/tmp/tmp.XXXXXXXXXX"); + if ($has_gpg == 1) { + $host->run_command({ + COMMAND => ['gpg', '--yes', '--batch', '--output', $tmpfilename, '--dearmor', $repokey], + USER => $self->get_conf('BUILD_USER'), + }); + if ($?) { + # don't try to use gpg again in later loop iterations + $has_gpg = 0; + } + } + # If that doesn't work, then we manually convert the key + # as it is just base64 encoded data with a header and footer. + # + # The decoding of armored gpg keys can even be done from a shell + # script by using: + # + # awk '/^$/{ x = 1; } /^[^=-]/{ if (x) { print $0; } ; }' | base64 -d + # + # As explained by dkg here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831409#67 + if ($has_gpg == 0) { + # Test if we actually have an armored key. Otherwise, no + # conversion is needed. + open my $fh, '<', $repokey; + read $fh, my $first_line, 36; + if ($first_line eq "-----BEGIN PGP PUBLIC KEY BLOCK-----") { + # Read the remaining part of the line until the newline. + # We do it like this because the line might contain + # additional whitespace characters or \r\n newlines. + <$fh>; + open my $out, '>', $tmpfilename; + # the file is an armored gpg key, so we convert it to the + # binary format + my $header = 1; + while( my $line = <$fh>) { + chomp $line; + # an empty line marks the end of the header + if ($line eq "") { + $header = 0; + next; + } + if ($header == 1) { + next; + } + # the footer might contain lines starting with an + # equal sign or minuses + if ($line =~ /^[=-]/) { + last; + } + print $out (decode_base64($line)); + } + close $out; + } + close $fh; + } + # we could use incrementing integers to number the extra + # repository keys but mktemp will also make sure that the new name + # doesn't exist yet and avoids the complexity of an additional + # variable + my $keyfilename = $session->mktemp({TEMPLATE => "/etc/apt/trusted.gpg.d/sbuild-extra-repository-XXXXXXXXXX.gpg"}); + if (!$keyfilename) { + $self->log_error("Can't create tempfile for external repository key\n"); + $session->unlink($keyfilename); + unlink $tmpfilename; + return 0; + } + if (!$session->copy_to_chroot($tmpfilename, $keyfilename)) { + $self->log_error("Failed to copy external repository key $repokey into chroot $keyfilename\n"); + $session->unlink($keyfilename); + unlink $tmpfilename; + return 0; + } + unlink $tmpfilename; + if (!$session->chmod($keyfilename, '0644')) { + $self->log_error("Failed to chmod $keyfilename inside the chroot\n"); + $session->unlink($keyfilename); + return 0; + } + } + + } return 1; } @@ -183,15 +327,15 @@ sub get_foreign_architectures { if (!$foreignarchs) { - $self->log("There are no foreign architectures configured\n"); + debug("There are no foreign architectures configured\n"); return {}; } my %set; foreach my $arch (split /\s+/, $foreignarchs) { - chomp; - next unless $_; - $set{$_} = 1; + chomp $arch; + next unless $arch; + $set{$arch} = 1; } return \%set; @@ -252,7 +396,7 @@ sub cleanup_foreign_architectures { my $session = $self->get('Session'); if (defined ($session->get('Session Purged')) && $session->get('Session Purged') == 1) { - $self->log("Not removing foreign architectures: cloned chroot in use\n"); + debug("Not removing foreign architectures: cloned chroot in use\n"); return; } @@ -323,7 +467,6 @@ sub update_archive { my $dummy_sources_list_d = $self->get('Dummy package path') . '/sources.list.d'; if (!($session->test_directory($dummy_sources_list_d) || $session->mkdir($dummy_sources_list_d, { MODE => "00700"}))) { $self->log_warning('Could not create build-depends dummy sources.list directory ' . $dummy_sources_list_d . ': ' . $!); - $self->cleanup_apt_archive(); return 0; } @@ -771,12 +914,10 @@ sub setup_apt_archive { if (!$session->test_directory($dummy_dir)) { $self->log_warning('Could not create build-depends dummy dir ' . $dummy_dir . ': ' . $!); - $self->cleanup_apt_archive(); return 0; } if (!($session->test_directory($dummy_gpghome) || $session->mkdir($dummy_gpghome, { MODE => "00700"}))) { $self->log_warning('Could not create build-depends dummy gpg home dir ' . $dummy_gpghome . ': ' . $!); - $self->cleanup_apt_archive(); return 0; } if (!$session->chown($dummy_gpghome, $self->get_conf('BUILD_USER'), 'sbuild')) { @@ -786,7 +927,6 @@ sub setup_apt_archive { } if (!($session->test_directory($dummy_archive_dir) || $session->mkdir($dummy_archive_dir, { MODE => "00775"}))) { $self->log_warning('Could not create build-depends dummy archive dir ' . $dummy_archive_dir . ': ' . $!); - $self->cleanup_apt_archive(); return 0; } @@ -796,20 +936,17 @@ sub setup_apt_archive { if (!($session->mkdir("$dummy_pkg_dir", { MODE => "00775"}))) { $self->log_warning('Could not create build-depends dummy dir ' . $dummy_pkg_dir . $!); - $self->cleanup_apt_archive(); return 0; } if (!($session->mkdir("$dummy_pkg_dir/DEBIAN", { MODE => "00775"}))) { $self->log_warning('Could not create build-depends dummy dir ' . $dummy_pkg_dir . '/DEBIAN: ' . $!); - $self->cleanup_apt_archive(); return 0; } my $DUMMY_CONTROL = $session->get_write_file_handle("$dummy_pkg_dir/DEBIAN/control"); if (!$DUMMY_CONTROL) { $self->log_warning('Could not open ' . $dummy_pkg_dir . '/DEBIAN/control for writing: ' . $!); - $self->cleanup_apt_archive(); return 0; } @@ -866,7 +1003,6 @@ EOF if( !defined $positive ) { my $msg = "Error! deps_parse() couldn't parse the positive Build-Depends '$positive_build_deps'"; $self->log_error("$msg\n"); - $self->cleanup_apt_archive(); return 0; } @@ -883,7 +1019,6 @@ EOF if( !defined $negative ) { my $msg = "Error! deps_parse() couldn't parse the negative Build-Depends '$negative_build_deps'"; $self->log_error("$msg\n"); - $self->cleanup_apt_archive(); return 0; } @@ -971,7 +1106,6 @@ EOF PRIORITY => 0}); if ($?) { $self->log("Dummy package creation failed\n"); - $self->cleanup_apt_archive(); return 0; } @@ -979,7 +1113,6 @@ EOF my $dummy_dsc_fh = $session->get_write_file_handle($dummy_dsc); if (!$dummy_dsc_fh) { $self->log_warning('Could not open ' . $dummy_dsc . ' for writing: ' . $!); - $self->cleanup_apt_archive(); return 0; } @@ -1015,7 +1148,6 @@ EOF # Do code to run apt-ftparchive if (!$self->run_apt_ftparchive()) { $self->log("Failed to run apt-ftparchive.\n"); - $self->cleanup_apt_archive(); return 0; } @@ -1024,121 +1156,154 @@ EOF # Once squeeze is not supported anymore, we want to never sign the # dummy repository anymore but instead make use of apt's support for # [trusted=yes] in wheezy and later. - if ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY')) && - (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY')) && + if ((((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY')) && + (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY'))) || + ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED')) && + (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED')))) && !$self->get_conf('APT_ALLOW_UNAUTHENTICATED')) { - if (!$self->generate_keys()) { - $self->log("Failed to generate archive keys.\n"); - $self->cleanup_apt_archive(); - return 0; - } - if (!$session->test_regular_file($dummy_archive_seckey)) { - if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY'), $dummy_archive_seckey)) { - $self->log_error("Failed to copy secret key"); + if (!$session->can_run("gpg")) { + $self->log_error("Signing the internal dummy package repository was implicitly enabled because\n"); + $self->log_error("a GPG key pair was found on the host. An error occurred because the gnupg\n"); + $self->log_error("executable was not found inside the chroot. Signing the internal dummy\n"); + $self->log_error("repository is only required for chroots with versions of apt versions before\n"); + $self->log_error("version 0.8.16~exp3 (so Debian squeeze or older).\n"); + $self->log_error("To fix this problem, either (if you don't need squeeze):\n"); + $self->log_error(" - disable signing by removing /var/lib/sbuild/apt-keys/ from the host\n"); + $self->log_error("or (if you need squeeze) either:\n"); + $self->log_error(" - install the gnupg package into your chroot\n"); + $self->log_error(" - or add gnupg:native to the CORE_DEPENDS configuration variable\n"); + return 0; + } + my $kill_gpgagent = sub { + if (((((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY')) && + (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY'))) || + ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED')) && + (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED')))) && + !$self->get_conf('APT_ALLOW_UNAUTHENTICATED')) && + $session->can_run("gpgconf")) { + # run gpgconf --kill gpg-agent (for gpg > 2.1) to kill any + # remaining gpg-agent + $session->run_command( + { COMMAND => ['gpgconf', '--kill', 'gpg-agent'], + ENV => { GNUPGHOME => $dummy_gpghome }, # gpgconf (< 2.1.12) doesn't have a --homedir argument + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { + my $err = $? >> 8; + $self->log_error("before conversion: $?\n"); + $self->log_error("gpgconf --kill gpg-agent died with exit $err\n"); + return 0; + } + } + }; + + my @gpg_command = ('gpg', '--homedir', $dummy_gpghome, '--yes'); + # if the armored keys exist, we prefer these. Otherwise we fall back + # to the keys in gpg format + if ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED')) && + (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED'))) { + if (!$session->test_regular_file($dummy_archive_seckey)) { + if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED'), $dummy_archive_seckey)) { + $self->log_error("Failed to copy secret key\n"); + return 0; + } + } + if (!$session->test_regular_file($dummy_archive_pubkey)) { + if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED'), $dummy_archive_pubkey)) { + $self->log_error("Failed to copy public key\n"); + return 0; + } + } + # import the armored keys + my @import_command; + @import_command = ('gpg', '--homedir', $dummy_gpghome, '--import', $dummy_archive_pubkey); + $session->run_command( + { COMMAND => \@import_command, + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { + $self->log_error("Failed to import public key\n"); + &$kill_gpgagent(); return 0; } - } - if (!$session->test_regular_file($dummy_archive_pubkey)) { - if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY'), $dummy_archive_pubkey)) { - $self->log_error("Failed to copy public key"); + @import_command = ('gpg', '--homedir', $dummy_gpghome, '--allow-secret-key-import', '--import', $dummy_archive_seckey); + $session->run_command( + { COMMAND => \@import_command, + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { + $self->log_error("Failed to import public key\n"); + &$kill_gpgagent(); return 0; } + } else { + # Since the armored keys were not present, we fall back to using + # keys in binary gnupg format. This operation can fail if the + # gnupg version with which the keys were generated and the version + # of gnupg inside the chroot are not compatible with each other. + # In that case, the user has to use sbuild-update --keygen to + # create a new armored ASCII keypair. + # This code can be removed once the sbuild version with armored + # ASCII key support is in stable. + if (!$session->test_regular_file($dummy_archive_seckey)) { + if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY'), $dummy_archive_seckey)) { + $self->log_error("Failed to copy secret key"); + return 0; + } + } + if (!$session->test_regular_file($dummy_archive_pubkey)) { + if (!$session->copy_to_chroot($self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY'), $dummy_archive_pubkey)) { + $self->log_error("Failed to copy public key"); + return 0; + } + } + push @gpg_command, '--no-default-keyring', + '--secret-keyring', $dummy_archive_seckey, + '--keyring', $dummy_archive_pubkey; } - my @gpg_command = ('gpg', '--yes', '--no-default-keyring', - '--homedir', $dummy_gpghome, - '--secret-keyring', $dummy_archive_seckey, - '--keyring', $dummy_archive_pubkey, - '--default-key', 'Sbuild Signer', '-abs', - '--digest-algo', 'SHA512', - '-o', $dummy_release_file . '.gpg', - $dummy_release_file); - $session->run_command( - { COMMAND => \@gpg_command, - USER => $self->get_conf('BUILD_USER'), - PRIORITY => 0}); - if ($?) { - $self->log("Failed to sign dummy archive Release file.\n"); - $self->cleanup_apt_archive(); - return 0; - } - } - - # Now, we'll add in any provided OpenPGP keys into the archive, so that - # builds can (optionally) trust an external key for the duration of the - # build. - if (@{$self->get_conf('EXTRA_REPOSITORY_KEYS')}) { - my $dummy_archive_key_file = $self->get('Dummy archive key file'); - - my $tmpfilename = $session->mktemp(); - - my $tmpfh = $session->get_write_file_handle($tmpfilename); - if (!$tmpfh) { - $self->log_error("Cannot open pipe: $!\n"); + push @gpg_command, '--default-key', 'Sbuild Signer', '-abs', + '--digest-algo', 'SHA512', + '-o', $dummy_release_file . '.gpg', + $dummy_release_file; + $session->run_command( + { COMMAND => \@gpg_command, + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { + $self->log_error("Failed to sign dummy archive Release file.\n"); + # output a helpful message in case the keys were not present in + # armored format + if ((! -f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY_ARMORED')) || + (! -f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY_ARMORED'))) { + $self->log_warning("The keys were not found in armored format and thus, a version skew \n"); + $self->log_warning("between gnupg on your host and in the chroot might be responsible \n"); + $self->log_warning("for this failure. Try running sbuild-update --keygen again to \n"); + $self->log_warning("generate a keypair in armored ASCII format.\n"); + $self->log_warning("Alternatively, if you are using sbuild with chroots containing apt\n"); + $self->log_warning("versions of 0.8.16~exp3 or newer (Debian wheezy and later) then\n"); + $self->log_warning("signing isn't required at all and you can just delete\n"); + $self->log_warning("/var/lib/sbuild/apt-keys/ from the host to disable signing.\n"); + } + &$kill_gpgagent(); return 0; } - # Right, so, in order to copy the keys into the chroot (since we may have - # a bunch of them), we'll append to a tempfile, and write *all* of the - # given keys to the same tempfile. After we're clear, we'll move that file - # into the correct location by importing the .asc into a .gpg file. - - for my $repokey (@{$self->get_conf('EXTRA_REPOSITORY_KEYS')}) { - debug("Adding archive key: $repokey\n"); - if (!-f $repokey) { - $self->log("Failed to add archive key '${repokey}' - it doesn't exist!\n"); - $self->cleanup_apt_archive(); - close($tmpfh); - $session->unlink($tmpfilename); - return 0; - } - local *INFILE; - if(!open(INFILE, "<", $repokey)) { - $self->log("Failed to add archive key '${repokey}' - it cannot be opened for reading!\n"); - $self->cleanup_apt_archive(); - close($tmpfh); - $session->unlink($tmpfilename); - return 0; - } - - while ( (read (INFILE, my $buffer, 65536)) != 0 ) { - print $tmpfh $buffer; - } - - close INFILE; - - print $tmpfh "\n"; - } - close($tmpfh); - - # Now that we've concat'd all the keys into the chroot, we're going - # to use GPG to import the keys into a single keyring. We've stubbed - # out the secret ring and home to ensure we don't store anything - # except for the public keyring. - - - my $tmpgpghome = $session->mktemp({ TEMPLATE => '/tmp/extra-repository-keys-XXXXXX', DIRECTORY => 1}); - if (!$tmpgpghome) { - $self->log_error("mktemp /tmp/extra-repository-keys-XXXXXX failed\n"); + # Add the imported key to apt's trusted keys + # + # Write into a temporary file first so that we can run gpg as the + # BUILD_USER instead of root (gpg will complain otherwise) + my $tmpfilename = $session->mktemp({USER => $self->get_conf('BUILD_USER')}); + $session->run_command( + { COMMAND => ['gpg', '--homedir', $dummy_gpghome, '--batch', '--yes', '--export', '--output', $tmpfilename, 'Sbuild Signer'], + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { + $self->log("Failed to add dummy archive key.\n"); + &$kill_gpgagent(); return 0; } - - my @gpg_command = ('gpg', '--import', '--no-default-keyring', - '--homedir', $tmpgpghome, - '--secret-keyring', '/dev/null', - '--keyring', $dummy_archive_key_file, - $tmpfilename); - - $session->run_command( - { COMMAND => \@gpg_command, - USER => 'root', - PRIORITY => 0}); - if ($?) { - $self->log("Failed to import archive keys to the trusted keyring"); - $self->cleanup_apt_archive(); - $session->unlink($tmpfilename); - return 0; - } - $session->unlink($tmpfilename); + $session->rename($tmpfilename, $self->get('Dummy archive key file')); + &$kill_gpgagent(); } # Write a list file for the dummy archive if one not create yet. @@ -1174,41 +1339,20 @@ EOF print $tmpfh 'deb [trusted=yes] copy://' . $dummy_archive_dir . " ./\n"; print $tmpfh 'deb-src [trusted=yes] copy://' . $dummy_archive_dir . " ./\n"; - for my $repospec (@{$self->get_conf('EXTRA_REPOSITORIES')}) { - print $tmpfh "$repospec\n"; - } - close($tmpfh); # List file needs to be moved with root. if (!$session->chmod($tmpfilename, '0644')) { $self->log("Failed to create apt list file for dummy archive.\n"); - $self->cleanup_apt_archive(); $session->unlink($tmpfilename); return 0; } if (!$session->rename($tmpfilename, $dummy_archive_list_file)) { $self->log("Failed to create apt list file for dummy archive.\n"); - $self->cleanup_apt_archive(); $session->unlink($tmpfilename); return 0; } } - if ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY')) && - (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY')) && - !$self->get_conf('APT_ALLOW_UNAUTHENTICATED')) { - # Add the generated key - $session->run_command( - { COMMAND => ['apt-key', 'add', $dummy_archive_pubkey], - USER => 'root', - PRIORITY => 0}); - if ($?) { - $self->log("Failed to add dummy archive key.\n"); - $self->cleanup_apt_archive(); - return 0; - } - } - return 1; } @@ -1226,31 +1370,13 @@ sub cleanup_apt_archive { $session->unlink($self->get('Dummy archive key file'), { FORCE => 1 }); + $session->unlink($self->get('Extra repositories list file'), { FORCE => 1 }); + $self->set('Dummy package path', undef); $self->set('Dummy archive directory', undef); $self->set('Dummy Release file', undef); } -# Generate a key pair if not already done. -sub generate_keys { - my $self = shift; - - if ((-f $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY')) && - (-f $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY'))) { - return 1; - } - - $self->log_error("Local archive GPG signing key not found\n"); - $self->log_info("Please generate a key with 'sbuild-update --keygen'\n"); - $self->log_info("Note that on machines with scarce entropy, you may wish ". - "to generate the key with this command on another machine ". - "and copy the public and private keypair to '" . - $self->get_conf('SBUILD_BUILD_DEPENDS_PUBLIC_KEY') - ."' and '". - $self->get_conf('SBUILD_BUILD_DEPENDS_SECRET_KEY') ."'\n"); - return 0; -} - # Function that runs apt-ftparchive sub run_apt_ftparchive { my $self = shift; @@ -1282,6 +1408,7 @@ use IO::Compress::Gzip qw(gzip $GzipError); use Digest::MD5; use Digest::SHA; use POSIX qw(strftime); +use POSIX qw(locale_h); # Execute a command without /bin/sh but plain execvp while redirecting its # standard output to a file given as the first argument. @@ -1338,8 +1465,17 @@ my $sources_size = -s 'Sources'; my $packagesgz_size = -s 'Packages.gz'; my $sourcesgz_size = -s 'Sources.gz'; -# time format stolen from apt ftparchive/writer.cc -my $datestring = strftime "%a, %d %b %Y %H:%M:%S UTC", gmtime(); +# The timestamp format of release files is documented here: +# https://wiki.debian.org/RepositoryFormat#Date.2CValid-Until +# It is specified to be the same format as described in Debian Policy §4.4 +# https://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog +# or the same as in debian/changelog or the Date field in .changes files. +# or the same format as `date -R` +# To adhere to the specified format, the C or C.UTF-8 locale must be used. +my $old_locale = setlocale(LC_TIME); +setlocale(LC_TIME, "C.UTF-8"); +my $datestring = strftime "%a, %d %b %Y %H:%M:%S +0000", gmtime(); +setlocale(LC_TIME, $old_locale); open(my $releasefh, '>', 'Release') or die "cannot open Release for writing: $!"; diff --git a/man/Makefile.in b/man/Makefile.in index ea05a16..5d57aeb 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -56,7 +56,17 @@ # ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -119,13 +129,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(srcdir)/defs.man.in subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = defs.man @@ -185,6 +194,8 @@ man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defs.man.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -283,6 +294,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -337,7 +349,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -346,7 +357,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -692,6 +703,8 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man7 \ uninstall-man uninstall-man1 uninstall-man5 uninstall-man7 \ uninstall-man8 +.PRECIOUS: Makefile + sbuild.conf.man: $(abs_top_srcdir)/tools/sbuild-dumpconfig PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ diff --git a/man/sbuild-createchroot.8.in b/man/sbuild-createchroot.8.in index 25e4996..d6db4cc 100644 --- a/man/sbuild-createchroot.8.in +++ b/man/sbuild-createchroot.8.in @@ -34,6 +34,9 @@ sbuild\-createchroot \- create sbuild chroot .RB [ "\-\-setup\-only" ] .RB [ "\-\-make\-sbuild\-tarball=\fIfile\fP" ] .RB [ "\-\-keep\-sbuild\-chroot\-dir" ] +.RB [ "\-\-no\-deb\-src" ] +.RB [ "\-\-alias=\fIalias\fP" ] +.RB [ \-\-extra\-repository=\fIspec\fP ] .B SUITE TARGET-DIRECTORY DEBIAN-MIRROR-URI .RB [ SCRIPT ] .PP @@ -135,6 +138,15 @@ empty string to disable signature checking. The distribution to bootstrap (e.g. \[oq]sarge\[cq], \[oq]etch\[cq], \[oq]lenny\[cq], \[oq]sid\[cq]). A complete list may be found in \fI/usr/share/debootstrap/scripts\fP. +The special syntax \fISUITE-VARIANT\fP is also supported, which will creates a +chroot for \fISUITE\fP, but named \fISUITE-VARIANT\fP. This is useful to create +variants of a base suite like jessie-backports which which would create a +jessie chroot to which the backports archive can be manually added after the +base chroot was created using sbuild-shell. This way, a normal jessie chroot +and a jessie-backports chroot can exist side-by-side. Besides this common use +case, this syntax can also be used to create chroots with any other type of +customization. It is a shortcut for creating a base chroot and then having to +manually copy it and edit the configuration files. .TP .B TARGET-DIRECTORY The directory to create the chroot in. The directory will be created if it @@ -162,6 +174,38 @@ details. .BR \-\-keep\-sbuild\-chroot\-dir Don't delete the directory used for creating a file type chroot. This option does nothing if not creating a file type chroot. +.TP +.BR \-\-no\-deb\-src +Don't add a deb-src line to the \fI/etc/apt/sources.list\fP file in the +\fITARGET-DIRECTORY\fP after the debootstrap process. This is useful in +situation when it is known that sbuild will never have to download the source +package itself but is always given an already downloaded dsc. In that case, +this option will help to save bandwidth and disk space because the source +indices don't have to be downloaded and later continually updated. +.TP +.BR \-\-alias=\fIalias\fP +Add an alternative name that the chroot will be known by. This option can be +given multiple times to add more than one alias. Using an alias is useful for +chroots of distributions that are known by more than one name. For example +Debian unstable is also known as sid. Additionally, sbuild chooses the +distribution by the latest changelog entry which could list \fIUNRELEASED\fP +for packages that the maintainer is currently working on. For Debian it thus +makes sense to add \fIUNRELEASED\fP as an alias for a Debian unstable chroot. +See the EXAMPLES section for how to use this option in practice. +.TP +.BR \-\-extra\-repository=\fIspec\fP +Add a repository to the list of apt sources. The repository specification is a +line suitable for an apt +.BR sources.list (5) +file. For instance, you might use +.nh +.B \-\-extra\-repository="deb http://httpredir.debian.org/debian experimental main" +.hy +to allow packages in the experimental distribution to fulfill +build-dependencies. Note that the build chroot must already trust the key of +this repository. This option is especially useful for creating variant chroots. +See the EXAMPLES section for how to combine this option with variants and +aliases. .SH TARBALL FILE When creating an sbuild tarball \fIfile\fP, the compression format used to generate the tarball depends on the entension used in \fIfile\fP. Here is a @@ -200,10 +244,33 @@ temporary directory as the target: \f[CB] http://httpredir.debian.org/debian\fP\[CR] .PP To create a plain type sid (unstable) chroot in \fI/srv/chroot/unstable\fP using -the \fIhttpredir.debian.org\fP Debian http mirror redirector service: +the \fIhttpredir.debian.org\fP Debian http mirror redirector service and with +aliases for \fIunstable\fP and \fIUNRELEASED\fP: .PP \f[CR]% \f[CB]sudo sbuild\-createchroot sid /srv/chroot/unstable-amd64 \fP\fP\\ .br + \-\-alias=unstable \-\-alias=UNRELEASED \fP\fP\\ +.br +\f[CB] http://httpredir.debian.org/debian\fP\[CR] +.PP +To create a chroot to build for Jessie backports: +.PP +\f[CR]% \f[CB]sudo sbuild\-createchroot \fP\fP\\ +.br + \-\-extra\-repository="deb http://httpredir.debian.org/debian jessie-backports main" \fP\fP\\ +.br + jessie-backports /srv/chroot/jessie-backports-amd64 \fP\fP\\ +.br +\f[CB] http://httpredir.debian.org/debian\fP\[CR] +.PP +To create a chroot to build for experimental with an alias: +.PP +\f[CR]% \f[CB]sudo sbuild\-createchroot \-\-alias=experimental \fP\fP\\ +.br + \-\-extra\-repository="deb http://httpredir.debian.org/debian experimental main" \fP\fP\\ +.br + unstable-experimental /srv/chroot/unstable-experimental-amd64 \fP\fP\\ +.br \f[CB] http://httpredir.debian.org/debian\fP\[CR] .SH HISTORY sbuild\-createchroot was previously known as \fBbuildd.chroot\fP. diff --git a/man/sbuild-setup.7.in b/man/sbuild-setup.7.in index 8ba45f3..56fd30d 100644 --- a/man/sbuild-setup.7.in +++ b/man/sbuild-setup.7.in @@ -187,7 +187,7 @@ You only need to run dpkg-reconfigure if you weren't asked the questions during the debconf install. Next, install the packages required for building packages: .PP -\f[CR]# \f[CB]apt\-get install debfoster fakeroot build\-essential\fP\fP +\f[CR]# \f[CB]apt\-get install fakeroot build\-essential\fP\fP .br \f[CR]# \f[CB]apt\-get install makedev\fP\fP .br diff --git a/man/sbuild.1.in b/man/sbuild.1.in index e8440e8..4022852 100644 --- a/man/sbuild.1.in +++ b/man/sbuild.1.in @@ -48,6 +48,7 @@ sbuild \- build debian packages from source .RB [ \-m \[or] \-\-maintainer=\fImaintainer\fP ] .RB [ \-e \[or] \-\-uploader=\fIuploader\fP ] .RB [ \-k \[or] \-\-keyid=\fIkey-id\fP ] +.RB [ \-\-source\-only\-changes ] .RB [ \-j \[or] \-\-jobs=\fIn\fP ] .RB [ \-\-debbuildopt=\fIoption\fP ] .RB [ \-\-debbuildopts=\fIoptions\fP ] @@ -71,6 +72,12 @@ sbuild \- build debian packages from source .RB [ \-\-piuparts\-opts=\fIoptions\fP ] .RB [ \-\-piuparts\-root\-arg=\fIoptions\fP ] .RB [ \-\-piuparts\-root\-args=\fIoptions\fP ] +.RB [ \-\-run\-autopkgtest ] +.RB [ \-\-no\-run\-autopkgtest ] +.RB [ \-\-autopkgtest\-opt=\fIoptions\fP ] +.RB [ \-\-autopkgtest\-opts=\fIoptions\fP ] +.RB [ \-\-autopkgtest\-root\-arg=\fIoptions\fP ] +.RB [ \-\-autopkgtest\-root\-args=\fIoptions\fP ] .RB [ \-\-pre\-build\-commands=\fIstring\fP ] .RB [ \-\-chroot\-setup\-commands=\fIstring\fP ] .RB [ \-\-chroot\-update\-failed\-commands=\fIstring\fP ] @@ -336,12 +343,21 @@ This command line option sets the \fBUPLOADER_NAME\fP configuration variable. Se for more information. .TP .BR \-k ", " "\-\-keyid=\fIkey-id\fP" -Passed to dpkg\-genchanges and is used to set the key to sign the .changes -file(s). Default is not using any key. +Passed to debsign and is used to set the key to sign the .changes +file(s). Default is not using any key and not signing the .changes file(s). This command line option sets the \fBKEY_ID\fP configuration variable. See .BR sbuild.conf (5) for more information. .TP +.BR \-\-source\-only\-changes +In addition to the .changes file generated by dpkg-buildpackage, also produce a +\[char46]changes file suitable for a source-only upload. If requested by +\-\-keyid, this .changes file will also be signed by debsign. +This command line option sets +the \fBSOURCE_ONLY_CHANGES\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP .BR \-j ", " "\-\-jobs=\fIn\fP" Number of jobs to run simultaneously. Passed through to dpkg\-buildpackage. This command line option appends the appropriate \fB-j\fP option to the \fBDPKG_BUILDPACKAGE_USER_OPTIONS\fP configuration variable. See @@ -371,7 +387,7 @@ This command line option appends to the \fBDPKG_BUILDPACKAGE_USER_OPTIONS\fP con .BR sbuild.conf (5) for more information. .TP -.BR \-\-dpkg\-source\-opt=\fIoptions\f +.BR \-\-dpkg\-source\-opt=\fIoptions\fP Pass the specified option directly to dpkg-source in addition to the options already passed by sbuild. This is only used when creating a source package from a Debianized source directory. This option can be passed multiple times (once @@ -639,6 +655,59 @@ This command line option appends to the \fBPIUPARTS_ROOT_ARGS\fP configuration v .BR sbuild.conf (5) for more information. .TP +.BR \-\-run\-autopkgtest +Run autopkgtest after a successful build. This command line option sets the +\fBRUN_AUTOPKGTEST\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP +.BR \-\-no\-run\-autopkgtest +Don't run autopkgtest after a successful build. If sbuild is configured to run +autopkgtest by default, this option will prevent autopkgtest being run. This +command line option sets the \fBRUN_AUTOPKGTEST\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP +.BR \-\-autopkgtest\-opt=\fIoptions\fP +Pass the specified option directly to autopkgtest in addition to the options +already passed by sbuild. This option can be passed multiple times (once per +autopkgtest option) and can be freely mixed with the \-\-autopkgtest\-opts +option. Options will be passed to autopkgtest in the order that the +\-\-autopkgtest\-opt and \-\-autopkgtest\-opts options are given on the command +line. This command line option appends to the \fBAUTOPKGTEST_OPTIONS\fP +configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP +.BR \-\-autopkgtest\-opts=\fIoptions\fP +Pass the specified options directly to autopkgtest in addition to the options +already passed by sbuild. The argument will be split by whitespaces and the +resulting array passed to the autopkgtest invocation. If any options contain +spaces, use \-\-autopkgtest\-opt for them. This option can be passed multiple +times and can be freely mixed with the \-\-autopkgtest\-opts option. Options +will be passed to autopkgtest in the order that the \-\-autopkgtest\-opt and +\-\-autopkgtest\-opts options are given on the command line. This command line +option appends to the \fBAUTOPKGTEST_OPTIONS\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP +.BR \-\-autopkgtest\-root\-arg=\fIoptions\fP +Add an argument that is used to launch autopkgtest as root. If no arguments are +specified, autopkgtest will be launched via sudo. This option can be specified +multiple times. This command line option appends to the +\fBAUTOPKGTEST_ROOT_ARGS\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP +.BR \-\-autopkgtest\-root\-args=\fIoptions\fP +Add arguments that are used to launch autopkgtest as root. If no arguments are +specified, autopkgtest will be launched via sudo. The argument will be split by +whitespaces. To pass options containing whitespaces use the option +\-\-autopkgtest\-root\-arg. This command line option appends to the +\fBAUTOPKGTEST_ROOT_ARGS\fP configuration variable. See +.BR sbuild.conf (5) +for more information. +.TP .BR \-\-pre\-build\-commands=\fIstring\fP This is the earliest external command which is run right after the chroot session has been initialized and before anything else is done (like installing @@ -831,7 +900,7 @@ for more information. .BR \-\-extra\-package=\fIpackage.deb\fP Make \fIpackage.deb\fP available for build-dependency resolution, by adding it to a temporary archive created by sbuild. This makes it -easier to build packages against locally-built build depenencies, +easier to build packages against locally-built build dependencies, without waiting for those packages to enter the main archive, or going through the hassle of maintaining a local archive and making it accessible inside the chroot. \fIpackage.deb\fP is copied into the @@ -887,7 +956,7 @@ prefix. For instance, the following set of command line options will use the adt-virt-schroot backend for a package build: .nh .B \-\-chroot-mode=adt \-\-adt\-virt\-server=schroot \-\-chroot unstable-amd64-sbuild -.ny +.hy The value of the \f[CB]--chroot\fP option will be passed as the last positional argument to the adt-virt-* invocation. Thus, the value of the \f[CB]--chroot\fP option becomes the image name of the virtual machine in case of adt-virt-qemu, @@ -1005,15 +1074,20 @@ command hook The following table shows each command hook in the context of the tasks sbuild performs. The column \fIroot\fP shows whether the command is run as root (yes) or not (no). The column \fIchroot\fP shows whether the command is run inside -our outside the chroot. The remaining columns show the percent escapes that are -defined in each command. Percent escapes that are available in all commands -(\fB%%\fR, \fB%a\fR, \fB%b\fR, \fB%s\fR) are omitted. The value \fImaybe\fP in -the column for the \fB%d\fR and \fB%p\fR escapes means that the value can not -relied upon to be defined in these stages. More specifically, these escapes -will not be defined at these points if the user specified a source package name -without a version on the command line. In that case, the version will only -become known after the source package has been retrieved in the "Fetch and -unpack source package" stage. +our outside the chroot. The working directory inside the chroot is the one +marked with \f[CB]<<BUILDDIR>>\fR inside the log. By default, this is a +directory of the format \f[CB]/build/packagename-XXXXXX/\f[R] where +\f[CB]XXXXXX\fR is a random ascii string. Otherwise, it is the directory set +by \f[CB]--build-path\fR or by the \f[CB]BUILD_PATH\fR configuration option. +The working directory outside of the chroot is $HOME. The remaining columns +show the percent escapes that are defined in each command. Percent escapes +that are available in all commands (\fB%%\fR, \fB%a\fR, \fB%b\fR, \fB%s\fR) are +omitted. The value \fImaybe\fP in the column for the \fB%d\fR and \fB%p\fR +escapes means that the value can not relied upon to be defined in these stages. +More specifically, these escapes will not be defined at these points if the +user specified a source package name without a version on the command line. In +that case, the version will only become known after the source package has been +retrieved in the "Fetch and unpack source package" stage. .PP .if t \{\ .ft CW @@ -1040,6 +1114,7 @@ Cleanup build files and dependencies \f[CB]\-\-chroot\-cleanup\-commands\fP yes inside yes no yes Close schroot session Run piuparts (if configured) +Run autopkgtest (if configured) \f[CB]\-\-post\-build\-commands\fP yes outside yes yes yes .TE .if t \{\ @@ -1099,8 +1174,11 @@ These escapes are converted to the absolute path to a package's .dsc file. .TP \fB%c\fR, \fB%SBUILD_CHANGES\fR These escapes are converted to the absolute path to a package's source .changes -file. This variable is only set after the build is finished, i.e in -\f[CB]\-\-chroot\-cleanup\-commands\fP and \f[CB]\-\-post\-build\-commands\fP. +file. This is the .changes file generated by the dpkg-buildpackage invocation +and not the source-only .changes file that might've been produced additionally +via --source-only-changes. This variable is only set after the build is +finished, i.e in \f[CB]\-\-chroot\-cleanup\-commands\fP and +\f[CB]\-\-post\-build\-commands\fP. .TP \fB%a\fR, \fB%SBUILD_HOST_ARCH\fR These escapes are converted to the debian name of the architecture the build @@ -1189,6 +1267,26 @@ the regular configured apt sources. .PP At the end of the build, the local archive is removed, along with the rest of the build tree. +.SH EXAMPLES +Before you use sbuild for the first time, you have to do some setup depending +on the chroot backend you are using. The default backend is schroot. To use +sbuild with the schroot backend, you need to add your user to the sbuild group +and create a schroot chroot. The latter can be accomplished by using +sbuild-createchroot(8). If the chroot contains a Debian derivative with apt (<< +0.8.16~exp3), or a Debian release before Wheezy, then it is also required to +create gpg key pairs using sbuild-update --keygen. After this one time setup, +you can now use sbuild to build packages like this: +.PP +\f[CR]% \f[CB]sbuild \-d unstable bash\fP\fP +.PP +Or on a .dsc: +.PP +\f[CR]% \f[CB]sbuild \-d unstable bash.dsc\fP\fP +.PP +Or from within an unpacked source package (the -d parameter is not necessary +here because the distribution is inferred from debian/copyright): +.PP +\f[CR]% \f[CB]sbuild\fP\fP .SH ENVIRONMENT VARIABLES The following environment variables are used by \fBsbuild\fR: .IP "HOME" diff --git a/scripts/config.guess b/scripts/config.guess index 1f5c50c..0967f2a 100755 --- a/scripts/config.guess +++ b/scripts/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2016-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2014-03-23' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -223,6 +237,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -235,6 +253,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,42 +272,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -359,16 +380,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -393,7 +414,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -579,8 +600,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -617,13 +639,13 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -662,11 +684,11 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -679,12 +701,12 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -789,14 +811,14 @@ EOF echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -878,7 +900,7 @@ EOF exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -901,7 +923,7 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -932,6 +954,9 @@ EOF crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -944,6 +969,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1020,7 +1048,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1099,7 +1127,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1248,6 +1276,9 @@ EOF SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1261,9 +1292,9 @@ EOF UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1285,7 +1316,7 @@ EOF exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1316,7 +1347,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1358,7 +1389,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1369,6 +1400,9 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 <<EOF @@ -1378,9 +1412,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/scripts/config.sub b/scripts/config.sub index bba4efb..8d39c4b 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-09-11' +timestamp='2016-03-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ timestamp='2014-09-11' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ timestamp='2014-09-11' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ timestamp='2014-09-11' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +254,13 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -305,7 +305,7 @@ case $basic_machine in | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -313,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -327,6 +328,9 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -372,12 +376,13 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -424,12 +429,13 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -437,6 +443,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -513,6 +520,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -774,6 +784,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1365,11 +1378,11 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ @@ -1385,7 +1398,8 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1517,6 +1531,8 @@ case $os in ;; -nacl*) ;; + -ios) + ;; -none) ;; *) diff --git a/scripts/install-sh b/scripts/install-sh index 377bb86..59990a1 100755 --- a/scripts/install-sh +++ b/scripts/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ do # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,81 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +377,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +456,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +474,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff --git a/scripts/missing b/scripts/missing index db98974..f62bbae 100755 --- a/scripts/missing +++ b/scripts/missing @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify diff --git a/scripts/test-driver b/scripts/test-driver index d306056..8e575b0 100755 --- a/scripts/test-driver +++ b/scripts/test-driver @@ -3,7 +3,7 @@ scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 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 @@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -119,6 +122,12 @@ case $estatus:$expect_failure in *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" diff --git a/test/Makefile.in b/test/Makefile.in index 0f34d06..bbc8ee2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -56,7 +56,17 @@ # ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -119,17 +129,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(srcdir)/perl-syntax.in \ - $(srcdir)/sbuild-checkpackages.in $(srcdir)/sbuild-hold.in \ - $(srcdir)/sbuild-update.in $(srcdir)/sbuild-upgrade.in \ - $(srcdir)/sbuild-distupgrade.in $(srcdir)/sbuild-clean.in \ - $(srcdir)/sbuild.in $(top_srcdir)/scripts/test-driver subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = perl-syntax sbuild-checkpackages sbuild-hold \ @@ -360,6 +365,12 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/scripts/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/perl-syntax.in \ + $(srcdir)/sbuild-checkpackages.in $(srcdir)/sbuild-clean.in \ + $(srcdir)/sbuild-distupgrade.in $(srcdir)/sbuild-hold.in \ + $(srcdir)/sbuild-update.in $(srcdir)/sbuild-upgrade.in \ + $(srcdir)/sbuild.in $(top_srcdir)/scripts/global.mk \ + $(top_srcdir)/scripts/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -458,6 +469,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -510,7 +522,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -519,7 +530,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -582,7 +593,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ - else \ + elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ @@ -911,6 +922,8 @@ uninstall-am: maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am recheck tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tools/Makefile.in b/tools/Makefile.in index 2d2c703..bd7a0ae 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,17 @@ ##################################################################### VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -120,13 +130,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(top_srcdir)/scripts/global.mk $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -152,6 +161,8 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -250,6 +261,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -282,7 +294,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $( echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -291,7 +302,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(top_srcdir)/scripts/global.mk: +$(top_srcdir)/scripts/global.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -451,6 +462,8 @@ uninstall-am: maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. |
