Raphael Hertzog [Wed, 12 Mar 2008 11:02:28 +0000 (12:02 +0100)]
Dpkg::Source::Package::V3_0::quilt: New source package variant using quilt.
* scripts/Dpkg/Source/Package/V3_0/quilt.pm: Implement a new source
package format that uses quilt to apply patches from
debian/patches/series. It is based on the wig&pen class (V2_0.pm).
* scripts/Makefile.am, scripts/po/POTFILES.in: Register the new module.
Raphael Hertzog [Wed, 12 Mar 2008 10:59:04 +0000 (11:59 +0100)]
Dpkg::Source::Package::V2_0: Misc changes in preparation of a quilt subclass
* scripts/Dpkg/Source/Package/V2_0.pm (get_patches): Return patch name
relative to debian/patches/.
* scripts/Dpkg/Source/Package/V2_0.pm (prepare_build): New hook function
used to prepare some options for the creation of the auto_patch.
* scripts/Dpkg/Source/Package/V2_0.pm (do_build): Create the debian/patches
directory if needed.
Raphael Hertzog [Wed, 5 Mar 2008 23:09:08 +0000 (00:09 +0100)]
Rename DSP::V1_0::native to DSP::V3_0::native
* scripts/Dpkg/Source/Package/V1_0/native.pm: This file got
renamed into...
* scripts/Dpkg/Source/Package/V3_0/native.pm: The goal is to
not pollute the namespace of versions 1.0 and 2.0. The usage
of the format specifier between parenthesis is thus limited
to version 3.0.
* scripts/dpkg-source.pl: Updated to take into account the
previous renaming.
* scripts/Dpkg/Source/Package/V1_0.pm: Adapt to the name change
and two small bug fixes that affect building of native packages.
* scripts/Makefile.am, scripts/po/POTFILES.in: Register the new
file and remove the old one.
Raphael Hertzog [Sun, 2 Mar 2008 13:08:55 +0000 (14:08 +0100)]
Miscellaneous fixes
* scripts/Dpkg/Source/Package/V1_0.pm: Remove properly the
temporary file used for creating diff.gz file in case of
failure during its generation.
* scripts/Dpkg/Source/Patch.pm: The bad file was analyzed and
lead to failure of the stat call.
* scripts/Makefile.am: Add the new V3_0/git.pm file and
remove the old VCS/git.pm.
Raphael Hertzog [Fri, 29 Feb 2008 22:27:30 +0000 (23:27 +0100)]
Create Dpkg::Source::Package::V1_0::native
* scripts/Dpkg/Source/Package/V1_0/native.pm: New module that
handles native source packages with any compression.
* scripts/Dpkg/Source/Package/V1_0.pm: Adjusted to use the previous
module when it comes to handle native packages. Simplified
several other code paths.
* scripts/Makefile.am, scripts/po/POTFILES.in: Add the new module.
* scripts/dpkg-source.pl: Add the new format as fallback to try
when building a source package. It will likely only be selected
when non-gzip compression has been requested.
Raphael Hertzog [Fri, 29 Feb 2008 20:24:14 +0000 (21:24 +0100)]
dpkg-source: use a list of possible format for building a source package
* scripts/dpkg-source.pl: Define a list of formats that can be used
to build a source package and use the first one that is able to build
a source package. Let the user add formats to try at the beginning of that
list with the --format=<format> command-line option.
* scripts/Dpkg/Source/Package/V1_0.pm (can_build): Only accept to build a
source package is the compression option is gzip.
* scripts/Dpkg/Source/Package.pm (can_build): Return a proper error
message.
* scripts/dpkg-source.pl: Use the info() function to report progress.
* scripts/Dpkg/Source/Package/V2_0.pm: When extracting additional
tarballs, removes the destination directory in case it existed in
the main tarball. Same goes for the debian subdirectory.
* scripts/Makefile.am: Add the module above.
Raphael Hertzog [Thu, 28 Feb 2008 22:11:11 +0000 (23:11 +0100)]
Add support of wig&pen source package
* scripts/Dpkg/Source/Package/V2_0.pm: New module to support "Format: 2.0"
source packages. Various method are overridables so that it's easy
to create an (upcoming) "Format: 2.0 (quilt)" variant. Native packages
(i.e. without orig.tar and with a single tarball) are not yet supported.
Raphael Hertzog [Thu, 28 Feb 2008 22:04:22 +0000 (23:04 +0100)]
Dpkg::Source::Package: Fix extract() and build() to clean up by default
* scripts/Dpkg/Source/Package.pm (extract, build): Change those methods
to delegate the real work to do_extract() and do_build() and catch
critical failures to clean up any temporary files/directories before
re-raising the error.
* scripts/Dpkg/Source/Package/V1_0.pm: Rename build() into do_build()
and extract() into do_extract().
Raphael Hertzog [Thu, 28 Feb 2008 20:20:46 +0000 (21:20 +0100)]
Dpkg::Source::Archive/Package: misc fixes and changes
* scripts/Dpkg/Source/Archive.pm: Replace unsafe rmtree() by
the safer erasedir() function.
* scripts/Dpkg/Source/Archive.pm (add_file, add_directory): Prefix
filename with chdir when the directory of the tar process isn't
the current directory.
* scripts/Dpkg/Source/Package.pm (find_original_tarballs): New
function to find original tarballs possibly associated to the current
source package.
* scripts/Dpkg/Source/Package.pm (add_file): Support adding file
who are not stored in the current directory (or who are prefixed with
"./").
* scripts/Dpkg/Source/Package.pm (can_build): New function to check
if a source package build is likely to succeed given the constraints
of a particular source package format. Will be used by dpkg-source to
find an appropriate format.
Raphael Hertzog [Sun, 24 Feb 2008 21:16:30 +0000 (22:16 +0100)]
dpkg-source: use the new Dpkg::Source::Package object
* scripts/dpkg-source.pl: Major restructuring of the script. It's
now based on the Dpkg::Source::Package object and its derived
classes. This was the last big step of cleanup. The script is now less
than 500 lines compared to more than 1300 not so long ago...
Raphael Hertzog [Sun, 24 Feb 2008 21:11:46 +0000 (22:11 +0100)]
Dpkg::Source::Package and Dpkg::Source::Package:V1_0: new modules
* scripts/Dpkg/Source/Package.pm: New module that represents a source
package. It provides some common functions and is the base class
from which real format of source packages must derive. The two main
functions that subclass must implement are build($dir) and extract($dir).
* scripts/Dpkg/Source/Package/V1_0.pm: Implementation of the Debian
source package version 1.0, the current version in wide-spread use.
Raphael Hertzog [Sun, 24 Feb 2008 20:56:16 +0000 (21:56 +0100)]
Dpkg::Exit and Dpkg::Source::Functions: two new modules
* scripts/Dpkg/Exit.pm: Enable to register some exit handlers that
are called when a script is interrupted by a signal.
* scripts/Dpkg/Source/Functions.pm: Contains some generic functions
used by other Dpkg::Source::* modules. Only erasedir() for now.
Raphael Hertzog [Sun, 24 Feb 2008 20:48:34 +0000 (21:48 +0100)]
Dpkg::Source::Archive/Patch: small tweaks
* scripts/Dpkg/Source/Archive.pm (create): Offer possibility to chdir
before calling tar. This is required to create tar achives that do not
encode the full path to the location of the directory that we want to
integrate.
* scripts/Dpkg/Source/Patch.pm (apply): Make sure to remove
POSIXLY_CORRECT while calling patch to avoid unexpected changes
in his behaviour.
Raphael Hertzog [Fri, 22 Feb 2008 18:07:11 +0000 (19:07 +0100)]
Dpkg::Source::Patch gains last features from dpkg-source
* scripts/Dpkg/Source/Patch.pm: New analyze() function that
replaces dpkg-source's checkdiff(). Check sanity of patch,
and reports directories to create and list of patched files.
* scripts/Dpkg/Source/Patch.pm (apply): Create required
directories on the fly and adjust timestamp of patched
files. This behaviour is configurable.
* scripts/dpkg-source.pl: Adjust accordingly.
* scripts/Dpkg/Source/Patch.pm (add_diff_file): Support
new option include_timestamp.
Raphael Hertzog [Fri, 22 Feb 2008 10:17:44 +0000 (11:17 +0100)]
Fix usage of hyphens in some manual pages
* man/deb-symbols.5: Escape some hyphens so that they
are not used as minus sign.
* man/dpkg-architecture.1: Same.
* man/dpkg-shlibdeps.1: Same.
* man/start-stop-daemon.8: Same.
Raphael Hertzog [Fri, 22 Feb 2008 07:42:04 +0000 (08:42 +0100)]
Fix make check to work on systems without dpkg in the standard PATH
* scripts/Makefile.am: Modify PATH to include build directories
containing the dpkg binary and the related scripts. That way
the tests work even if dpkg is not yet available. Thanks to
Mike Frysinger <vapier@gentoo.org> who noticed that.
Raphael Hertzog [Fri, 22 Feb 2008 00:25:38 +0000 (01:25 +0100)]
Dpkg::Source::Patch: New module to generate and apply patches
* scripts/Dpkg/Source/Patch.pm: New module that is able to
generate patches (between files or between directories). It's
also able to apply patches. Built on CompressedFile, it
handles compression/decompression of patches files on the fly.
It still lack some functionalities of dpkg-source (patch
analysis and pre-creation of new directories before patch
application).
* scripts/dpkg-source.pl: Replaced big chunks of the code by
some usage of Dpkg::Source::Patch. More to come later.
* scripts/Makefile.am, scripts/po/POTFILES.in: Register the new
module file.
Raphael Hertzog [Thu, 21 Feb 2008 00:52:49 +0000 (01:52 +0100)]
dpkg-source: more cleanup
* scripts/dpkg-source.pl: Replace several implicit fork made with
open() by fork_and_exec().
* scripts/dpkg-source.pl: Remove another chunk of unused code.
Raphael Hertzog [Wed, 20 Feb 2008 23:28:10 +0000 (00:28 +0100)]
Adjust Dpkg::Changelog::parse_changelog() search list of parser
* scripts/Dpkg/Changelog.pm (parse_changelog): Fallback
into /usr/lib/dpkg/parsechangelog to find a changelog parser
in case $dpkglibdir points to another directory (for example
when DPKG_DATADIR is manually set).
Raphael Hertzog [Wed, 20 Feb 2008 23:12:40 +0000 (00:12 +0100)]
Create Dpkg::Source::CompressedFile as spinoff of Dpkg::Source::Compressor
* scripts/Dpkg/Source/Compressor.pm: Drom from this object
all filename related code and move it ...
* scripts/Dpkg/Source/CompressedFile.pm: ...here. This
object is a named file and it handles either explicit
compression (call to set_compression()) or implicit compression
(compression type is guessed from the filename). It offers
open_for_write() and open_for_read() to write into/read from
a data stream that is compressed/uncompressed on the fly.
* scripts/Dpkg/Source/Archiver.pm: Make it based on
CompressedFile and simplify code.
* scripts/dpkg-source.pl: Adapt code to the new interface of
the Compressor object.
* scripts/Makefile.am, scripts/po/POTFILES.in: register new
file CompressedFile.pm.
Raphael Hertzog [Wed, 20 Feb 2008 19:55:19 +0000 (20:55 +0100)]
Dpkg::Source: don't handle the compression level explicitely
* scripts/Dpkg/Source/Archiver.pm: Drop set_compression_level() and always
use the default compression level (from Dpkg::Source::Compressor).
* scripts/Dpkg/Source/Compressor.pm: New set_default_compression() and
set_default_compression_level() to change the default values of those
parameters.
* scripts/dpkg-source.pl: Change the default compression and the default
compression level globally. Replace forkgzipread(), forkgzipwrite() and
reapgzip() by direct usage of Dpkg::Source::Compressor in a way that it
inherits the compression level automatically. Also simplify some
subprocess execution by using Dpkg::IPC::fork_and_exec().
* scripts/Dpkg.pm: Allow overriding $pkgdatadir
with $ENV{DPKG_DATADIR}.
* scripts/Makefile.am (check): Use DPKG_DATADIR.
* debian/rules: Remove hack to copy data files
to build directory.
dpkg-buildpackage: Set a set of compiler flags for a build
* scripts/dpkg-buildpackage.pl: Set a set of environment variables
for setting compiler and linker options, unless already set in the
environment. See https://wiki.ubuntu.com/DistCompilerFlags for
background information.
* man/dpkg-buildpackage.pl: Document the new behaviour.
Based on a patch by Matthias Klose <doko@cs.tu-berlin.de>
Guillem Jover [Sun, 17 Feb 2008 04:34:41 +0000 (06:34 +0200)]
dpkg.cfg: Reintroduce 'no-debsig' option
This avoids failing to install any package when debsig-verify is installed,
as distributions do not use embedded signatures in packages. Closes: #311843
Raphael Hertzog [Sat, 16 Feb 2008 22:20:35 +0000 (23:20 +0100)]
Handling of compression level in dpkg-source
* scripts/Dpkg/Source/Archiver.pm (create): Forward properly the
compression level.
* scripts/Dpkg/Source/Archiver.pm (extract): Correct parameters in
an error message.
* scripts/dpkg-source.pl: Take into account the compression level
when generating a new tarball.
Raphael Hertzog [Sat, 16 Feb 2008 19:20:36 +0000 (20:20 +0100)]
Dpkg::Source::Archiver: new module to work with tar archives
* scripts/Dpkg/Source/Archive.pm: New module handling tar
archive creation and extraction.
* scripts/dpkg-source.pl: Updated and simplified to use the new module.
* scripts/Makefile.am: Add new modules to dist tarball.
* scripts/po/POTFILES.in: Add new module in list of files to scan for
translations.
* scripts/Dpkg/Compression.pm: Add function
get_compression_from_filename() to identify the compression
type from the file extension. Returns undef in case of failure.
* scripts/Dpkg/Source/Compressor.pm: Simplify some code
by using the new get_compression_from_filename().
Dpkg::IPC: Add a sanitiy_check for options of fork_and_exec
* scripts/Dpkg/IPC.pm (_sanity_check_opts): Check for some
probable errors in options.
(fork_and_exec): Apply _sanity_check_opts to the options to
catch some errors that might go unnoticed otherwise and to
error out early for some other errors.
Dpkg::IPC: New {to,from}_string options for fork_and_exec
* scripts/Dpkg/IPC.pm (fork_and_exec): Add new options
{to,from}_string. For symmetry reasons both options take
a scalar reference, even though this is really only
necessary for to_string. to_string implies the
wait_child option.
Dpkg::IPC: avoid surprising execution via the shell
* scripts/Dpkg/IPC.pm (fork_and_exec): If @prog only
contains one entry exec() might execute it via the
shell if it deems it necessary. This is not intended,
so avoid this by giving $prog[0] explicetly as the
program to execute.
Raphael Hertzog [Fri, 15 Feb 2008 18:34:32 +0000 (19:34 +0100)]
Simplify Dpkg::Source::Compressor by using the extended fork_and_exec()
* scripts/Dpkg/Source/Compressor.pm: Replace the multiple compress_*
functions by a single compress() function that accepts the same
parameters than fork_and_exec(). The exec parameter is replaced
with the right compressor/decompressor invocation, and some other
parameters have default values.
Same for uncompress_* replaced by uncompress().
* scripts/dpkg-source.pl: Update accordingly to use the new syntax.
Raphael Hertzog [Fri, 15 Feb 2008 18:30:21 +0000 (19:30 +0100)]
Dpkg::IPC: extend fork_and_exec() to create pipes on request
* scripts/Dpkg/IPC.pm (fork_and_exec): Now accept from_pipe and
to_pipe parameters that should point to a scalar reference. The
scalar will be set with the filehandle of the other side of the
created pipe.
* scripts/Dpkg/Source/Compressor.pm: This new module knows how
to compress/uncompress streams of data. It supports all the
compression types defined in Dpkg::Compression.
Raphael Hertzog [Fri, 15 Feb 2008 14:45:10 +0000 (15:45 +0100)]
Dpkg::IPC: new module to handle common IPC
* scripts/Dpkg/IPC.pm: New module handling IPC. Started with
fork_and_exec() and wait_child(). STDIN/STDOUT of the child
process can be easily redirected to a file or any other
filehandle.
* scripts/dpkg-genchanges.pl, scripts/dpkg-source.pl: Use new
Dpkg::Checksums module. Adds new 'Checksums-{Sha1,Sha256}' field
to .changes and .dsc files. Increase changes format to 1.8.
* scripts/Dpkg/Source/VCS/git.pm(read_git_config): Simplify
by setting $/ = "\0" instead of splitting on \n, which
separates keys and values, but can also occour in the
values themself.
Raphael Hertzog [Sun, 3 Feb 2008 17:54:00 +0000 (18:54 +0100)]
dpkg-shlibdeps: some accuracy improvements for warnings about unused libraries
* scripts/dpkg-shlibdeps.pl: Handle better the case when the
library found has a different soname than the one used to look up
the library file. Properly affect symbols coming from it to the
soname wanted by the binary, thus avoiding invalid warnings about
unused library.
Justin Pryzby [Wed, 30 Jan 2008 04:35:30 +0000 (06:35 +0200)]
s-s-d: Documentation improvements
Cosmetic fixes to start-stop-daemon output and man page. Document
that --chuid will change the group even if it has not been specified.
Add EXIT STATUS and EXAMPLE sections to man page.
Raphael Hertzog [Sat, 19 Jan 2008 20:53:18 +0000 (21:53 +0100)]
dpkg-buildpackage: add a new -R option and allow parameters in -r
* scripts/dpkg-buildpackage.pl: Add a new -R option to be able to replace
"debian/rules" by something else. The replacement command can contain
parameters (and thus spaces). Fix -r option to also accept parameters.
* man/dpkg-buildpackage.1: Document the new option and the changed
behaviour of -r.