summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Source
AgeCommit message (Collapse)AuthorFilesLines
2010-05-02dpkg-source: implement --before-build and --after-build commandRaphaël Hertzog2-0/+13
Those commands are really hooks that source formats can use and that will be called by dpkg-buildpackage before and after the actual build. Source formats "2.0" and "3.0 (quilt)" use this hook to ensure patches are applied before the build.
2010-05-01dpkg-source: add Bug-Ubuntu field in DEP-3 templateRaphaël Hertzog1-0/+1
The DEP-3 template is provided in the automatic header of patches in 3.0 (quilt) source packages.
2010-04-22dpkg-source: fix ignore regexp for source format 1.0 when -i is not usedRaphaël Hertzog1-1/+1
The variable is defined by default but empty and the check was wrong leading all files to be ignored.
2010-04-09dpkg-source: do not allow underscore in component name for supplementary ↵Raphaël Hertzog2-4/+4
tarballs According the documentation they were never meant to be allowed but usage of perl's \w allowed them nevertheless. [\w-] has now been replaced by [[:alnum:]-] everywhere so that the code fits the documentation.
2010-04-02dpkg-source: fix initialization of diff-ignore in 1.0 formatRaphaël Hertzog1-1/+5
Commit 3378e8fa435abe79e9bd3cea07b02f562b906695 broke "dpkg-source -i -b" on version 1.0 source packages. This restores it.
2010-04-01dpkg-source: support debian/source/local-optionsRaphaël Hertzog2-0/+4
It's like debian/source/options but it's not stored in the generated source package. This is ensured by the way of being part of the default ignore lists (-i and -I) and being explicitely excluded for the old 1.0 format that doesn't use the default ignore list.
2010-03-29Dpkg::Source::Package: do not overwrite debian/source/format if it already ↵Raphaël Hertzog1-4/+6
exists
2010-03-28Dpkg::Source::Package: add .gitattributes to dpkg-source ignore listsRaphaël Hertzog1-1/+2
2010-03-16dpkg-source: support unpacking old source packages lacking the Format fieldColin Watson1-1/+3
.dsc files haven't always had a Format field. It was introduced in dpkg 1.6.13, in May 2000. This means that it's still not entirely implausible to run across source packages without Format, for example when importing the history of a source package into revision control. Thus, dpkg-source should treat a missing Format field as 1.0, for compatibility with these old packages.
2010-03-10Dpkg::Source::Package::V3::quilt: sanity check of series fileRaphaël Hertzog1-0/+1
A series file should only contain path pointing inside debian/patches/ and thus "../" are forbidden. Given that the path to patches appear in the patch command-line with -B .pc/$path, a carefully crafted path could lead patch to overwrite an arbitrary file outside of the destination directory with a file provided in the source package.
2010-03-10Dpkg::Source::Patch: add more sanity checks on patchesRaphaël Hertzog1-2/+15
patch will happily accept filenames like "../../../../stuff" and modify files outside of the expected destination directory. To avoid problems we error out when we detect a filename that contains "/../". Any leading "../" is not a problem since patches are applied with -p1 and it's stripped. We also verify that the file to be modified is not accessed through a symlink as a compromised source package could also provide a symlink in the orig.tar.gz that points outside of the destination directory.
2010-02-25Dpkg::Checksums: rewrite to provide an object-oriented APIRaphaël Hertzog1-44/+11
Many other modules and scripts are also updated to cope with the new API. The API of the module should be stable from now on, hence increased $VERSION to "1.00".
2010-02-21dpkg-source: new option --create-empty-orig in formats "2.0" and "3.0 (quilt)"Raphaël Hertzog2-8/+28
With this option, dpkg-source will auto-create the main original tarball when it's missing and when there are supplementary tarballs. This makes it easier to bundle multiple software together. dpkg-source needs to be modified since the options have to be parsed before can_build() is called.
2010-02-21Dpkg::Source: fix parsing of diff's output to be POSIX-compliantRaphaël Hertzog2-2/+5
While parsing diff's output, accept any sentence that contains the word differ (as specified by POSIX) to identify that binary files could not be compared.
2010-02-21Add $VERSION numbers to all perl modulesRaphaël Hertzog11-0/+22
Modules whose API should be stable have a version 1.00. The modules with version 0.01 are expected to have further API changes in the (near) future or are deemed to be useful mostly for dpkg-dev's internal usage.
2010-02-20Update Dpkg::Control::* to use Dpkg::Interface::StorableRaphaël Hertzog1-3/+1
This implies renaming parse_fh() into parse() and parse() into load(). Update all scripts and modules using those methods.
2010-02-19libdpkg-perl: Rename Dpkg::IPC::fork_and_exec() to Dpkg::IPC::spawn()Guillem Jover4-24/+24
2010-01-27Dpkg::Source::Patch: fix output of patch with an headerRaphaël Hertzog1-1/+1
The line was misparsed. Use the print method to avoid any ambiguity.
2010-01-23dpkg-source: unpacking a 3.0 (quilt) source package configures quilt accordinglyRaphaël Hertzog1-4/+22
The files .pc/.quilt_patches and .pc/.quilt_series are always created so that any quilt invocation will know where to look for (or where to store) patches. This will only work with quilt >= 0.48-5.
2010-01-22Rename Dpkg::Compression::CompressedFile and Dpkg::Compression::CompressorRaphaël Hertzog2-4/+2
Dpkg::Compression::CompressedFile -> Dpkg::Compression::FileHandle Dpkg::Compression::Compressor -> Dpkg::Compression::Process The new names are more expressive and avoid repeating "Compress". Update all scripts and modules to use the new name.
2010-01-22Dpkg::Compression: new API based on public functionsRaphaël Hertzog6-16/+18
This API change requires lots of adjustements through the source code.
2010-01-22Dpkg::Compression::CompressedFile: update APIRaphaël Hertzog2-55/+51
Change the Dpkg::Compression::CompressedFile API to make it behave like a normal filehandle. Update all users of the object to use the new API.
2010-01-22Rename Dpkg::Source::CompressedFile into Dpkg::Compression::CompressedFileRaphaël Hertzog3-152/+3
2010-01-22Rename Dpkg::Source::Compressor into Dpkg::Compression::CompressorRaphaël Hertzog3-134/+3
2009-12-23dpkg-source: ensure quilt's .pc directory is created before writing ↵Raphaël Hertzog1-0/+1
.pc/applied-patches The quilt .pc directory was not created when a new automatic patch was registered and when no other patches were managed by quilt. Based-on-patch-by: Tommi Vainikainen <thv+debian@iki.fi>
2009-12-02dpkg-source: verify version of the quilt metadata before buildRaphaël Hertzog1-0/+28
Since format "3.0 (quilt)" can now modify the content of the .pc directory, ensure it still uses the supported format (currently version 2). Add an option --allow-version-of-quilt-db=<ver> to be able to force creation of a source package despite the unexpected version.
2009-12-02dpkg-source: support debian/source/patch-headerRaphaël Hertzog2-1/+17
The content of this file is used as header of the automatic patch generated in formats "2.0" and "3.0 (quilt)".
2009-12-02dpkg-source: support --single-debian-patch for "3.0 (quilt)"Raphaël Hertzog1-1/+14
With this option, the automatic patch is named debian/patches/debian-changes instead of debian/patches/debian-changes-<ver>. With this option, the new format is closer to 1.0 with its single diff that is always updated.
2009-12-02Dpkg::Source::Package::V3::quilt: create and use .pc directoryRaphaël Hertzog2-168/+135
Instead of calling quilt to apply patches, we always apply them by hand and we create the .pc directory used by quilt (version 2 in .pc/.version). That way we are fully compatible with quilt and we can't have differing behaviour whether quilt is installed or not. Update the documentation accordingly. The option --without-quilt is gone as is debian/patches/.dpkg-source-applied (replaced by .pc/applied-patches).
2009-11-24Dpkg::Source::Package::V3::quilt: check debian/patches{,series} before buildRaphaël Hertzog1-0/+18
Before accepting to build a 3.0 (quilt) source packages, ensure that debian/patches is a directory (or non-existing) and that debian/patches/series is a file (or non-existing).
2009-11-24Dpkg::Source::Package::V3::quilt: set QUILT_PATCH_OPTS to mimick D::S::PatchRaphaël Hertzog1-2/+4
When building "3.0 (quilt)" source packages, use QUILT_PATCH_OPTS="-t -F 0 -N -u -V never -g0" so that quilt is as strict as dpkg-source's internal implementation of quilt that relies on Dpkg::Source::Patch::apply().
2009-11-22dpkg-source: fail if several orig.tar files are availableRaphaël Hertzog1-0/+4
This concerns formats 2.0 and 3.0 (quilt) where the upstream tarball can be available with different compression schemes. We need precisely one file otherwise it doesn't know which one should be used and might pick the wrong one.
2009-11-11dpkg-source: add a DEP-3 compliant header to automatic patchesRaphaël Hertzog3-3/+57
In "3.0 (quilt)" format, dpkg-source can automatically create patches with the upstream changes applied to the source package. Those patches will now contain an informative header respecting the DEP-3 proposal where the Description contains a copy of the last changelog entry, the last uploader is mentionned in the Author field. Supplementary fields can be added by a vendor hook "extend-patch-header". The Debian implementation of this hook automatically adds Bug-Debian and Bug-Ubuntu entries. Dpkg::Source::Patch has been modified to be able to output a preliminary header.
2009-11-11dpkg-source: list upstream files modified by the diff during buildRaphaël Hertzog1-1/+11
This only applies to "1.0" source packages using orig.tar.gz + diff.gz. In that case, it also recommends usage of the new format 3.0 (quilt) to keep changes separate and documented.
2009-11-11dpkg-source: list upstream files modified by the diff during extractionRaphaël Hertzog2-2/+7
This only applies to "1.0" source packages using orig.tar.gz + diff.gz. Dpkg::Source::Patch::apply() is modified to return the hashref containing information about the patch applied so that we can extract the list of files in Dpkg::Source::Package::V1::do_extract()
2009-11-08Clean up perl shebang lineGuillem Jover2-2/+0
Use “use warnings” instead of passing “-w”. Remove “--” parameters. Remove shebangs from perl modules. Remove spaces after “#!”.
2009-11-08Add missing license headersGuillem Jover1-0/+13
2009-11-08Unify format in license headersGuillem Jover12-30/+32
Indent license text to one space after the '#'. Add '#' to blank lines between paragraphs and remove trailing '#' after the license text.
2009-11-08Replace FSF address by pointing to the gnu.org URLGuillem Jover12-34/+22
Use the <http://www.gnu.org/licenses/> URL, instead of in most cases the outdated FSF address, which is way more stable, as the latter has changed several times in the past.
2009-11-08Dpkg::Source::Patch::add_diff_directory(): small optimizationRaphaël Hertzog1-2/+2
The calls to File::Spec->abs2rel() are relatively expensive and can be avoided given that we control the find() invocation and can only receive filenames below the scanned directory. They are replaced with simple string extraction with substr(), it gives another 25% speed benefit on big source packages. Based-on-patch-by: Mike Hommey <mh@glandium.org>
2009-11-06dpkg-source: optimize diffing phase of a source package buildRaphaël Hertzog1-0/+3
Optimize dpkg-source -b by avoiding many diff calls when not required. Based-on-patch-by: Mike Hommey <mh@glandium.org>
2009-11-06Dpkg::Control::Hash: handle arbitrary field valuesRaphaël Hertzog1-3/+3
Checking the validity of new field values at run-time was very expensive. In order to avoid this check, the design of the object has been changed to accept arbitrary values, they are simply escaped as necessary during output. The only data lost in a save()/load() cycle are the trailing whitespaces on every line of all values. This API change implies fixes in all scripts/modules reading/creating values for multiline fields. The non-regression test also had to be adjusted.
2009-11-06Dpkg::Source::Package::V3::git::do_build(): remove extra quotesRaphaël Hertzog1-1/+1
Remove extra quoting that should not be there while passing an exclude file to git ls-files during build of 3.0 (git) source package. Based-on-patch-by: Courtney Bane <debian-bugs-5265@cbane.org>
2009-11-05Dpkg::Source::Package::V2::do_build(): improve matching of ignored filesRaphaël Hertzog1-4/+5
Modify logic to also match ignored files based on their relative path inside the source package (and not only on their filename).
2009-11-05Dpkg::Source::Package::V2:do_build(): fix binary file checkRaphaël Hertzog1-2/+2
The find() call that is supposed to look for binary files in the debian sub-directory was missing the no_chdir option and due to this the File::Spec->abs2rel() call (inside the wanted function) was returning an invalid value when find() changed the current directory (since its second parameter is only valid while being in the current directory). The parameter got lost by mistake in 3525f79792cff51757d99d45f51c96a15e6fa779 and it was present in lenny's version.
2009-10-04Update all Perl modules and scripts to use the new Dpkg::Version APIRaphaël Hertzog1-5/+6
2009-09-19Get rid of Dpkg::Deps @src_dep_fields @pkg_dep_fields and %dep_field_typeRaphaël Hertzog1-10/+0
Update all modules and scripts to not use those variables of Dpkg::Deps but instead the two functions field_list_(pkg|src)_dep() of Dpkg::Control::Fields.
2009-09-19Use the new Dpkg::Control interface everywhereRaphaël Hertzog1-7/+6
Update all scripts and module to use Dpkg::Control instead of parsecdata and Dpkg::Fields::Object.
2009-09-16Rename Dpkg::Cdata into Dpkg::ControlRaphaël Hertzog1-1/+1
Update all scripts and modules to use the new module names.
2009-09-06Unify and mark strings for translationGuillem Jover2-3/+3