summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Source
AgeCommit message (Collapse)AuthorFilesLines
2012-06-13Dpkg::Source::Patch: let analyze() extract the patch header tooRaphaël Hertzog1-1/+8
2012-06-12dpkg-source: 3.0 (quilt): restore quilt backup files after a failed patchRaphaël Hertzog1-6/+45
dpkg-source will now clean up after a failed application of a quilt patch. This required passing “--reject-file=-” to patch to avoid the creation of *.rej files that would clutter the source package and intercepting the failure to restore the files from .pc/$patch/. dpkg-source will also display a message explaining the most likely cause of failure (patch applying with fuzz). Closes: #652970
2012-05-23Dpkg::Source::Package: Do not obscure ‘require’ errors with custom errorsThomas Adam1-1/+2
When coming out of eval blocks and reporting on errors, make sure $@ is included as part of the textual output so that the real underlying error is reported. dpkg-source: error: source package format `3.0 (native)' is not supported (Perl module Dpkg::Source::Package::V3::native is required) Of course, that file is being required just fine, the problem turned out to be missing File::Temp, but without including $@, it was not obvious due to the custom error message completely hiding this detail. Improved-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2011-12-23dpkg-source: fix issue with relative filename given to --commitRaphaël Hertzog1-1/+8
With the “3.0 (quilt)” source format, dpkg-source would happily ignore the patch-file parameter if it was not found, instead of properly erroring out. Furthermore a relative filename would also not be found when the given directory is "." since dpkg-source does a chdir("..") in that case. Both issues are fixed by this commit. Closes: #652414 Reported-by: Sam Hartman <hartmans@debian.org>
2011-12-15Dpkg::Source::Package: Add missing parenthesis in find_command() callGuillem Jover1-1/+1
Regression introduced in commit 383247f0d2dfbd3d0d6388f87869ac1abaa8b7cd. Closes: #652113 Reported-by: Vincent Danjean <vdanjean@debian.org>
2011-12-13Do not use absolute paths for programs in perl and shell codeGuillem Jover1-3/+3
The location of programs on the filesystem is not standardized, and as such using absolute paths is not a portable assumption to make. This causes test suite errors on at least Mac OS X. Use just the program name on perl system() calls, when needing the full path use Dpkg::Path::find_command() in perl code and “which” in shell code. Reported-by: Stuart Ambler <stuart@zulazon.com>
2011-10-06dpkg-source: ignore changes on debian/patches/.dpkg-source-appliedRaphaël Hertzog1-1/+2
With 2.0 source packages, dpkg-source records as a comment in debian/patches/.dpkg-source-applied whether the patches have been applied at build time or at unpack time. This can lead to differences between the file in the build tree and the file in the reference tree used to check for changes. Thus we need to ignore that file in the diff process or the build might fail considering this difference as a local change that has not been recorded in a patch. Reported-by: Jakub Wilk <jwilk@debian.org>
2011-09-27dpkg-source: let --commit create debian/patches when requiredRaphaël Hertzog1-0/+1
Reported-by: Jakub Wilk <jwilk@debian.org>
2011-09-27dpkg-source: do not ignore the automatic patch when checking for unrecorded ↵Raphaël Hertzog1-7/+11
changes The former behaviour to always generate the automatic patch required to not apply it on the tree used as a basis for the patch generation. That way it could be updated at each build. With the new behaviour to fail on any new change, we should no longer ignore it. It must be applied on the reference tree except when --auto-commit is on. This should fix 227 (source package) build failures in Debian unstable.
2011-08-23dpkg-source: Make single-debian-patch not abort on upstream changesGuillem Jover2-2/+3
The single-debian-patch option usage in Dpkg::Source::Package::V2 was typoed as single_debian_patch, and thus not avoiding aborting on upstream changes. Instead of fixing the typo, let's just not expose single-debian-patch in Dpkg::Source::Package::V2, as it's Dpkg::Source::Package::V3::quilt specific and as such a layer violation, the code will just set auto_commit when single-debian-patch is specified, which is the actual intended behaviour. Reflect this explicitly in the man page. Regression introduced in commit 46b688e4824f00842568b517b119eec34a5f7286. Reported-by: Bernhard R. Link <brlink@debian.org>
2011-08-23Dpkg::Source::Package: Use “-z” instead of “not -s”Guillem Jover2-2/+2
2011-08-04dpkg-source: simplify message pointing to dpkg-source --commitRaphaël Hertzog1-1/+1
The supplementary arguments suggested are awkward and are generally not needed unless your package is huge and takes a long time to uncompress and diff. The best advice is thus “dpkg-source --commit” without any parameter. Maintainers of big packages will read the manual package and learn by themselves how to reuse the generated patch.
2011-08-03dpkg-source: don't always print "local changes have been recorded in a new ↵Raphaël Hertzog1-1/+2
patch" The message should only be printed if such a patch has really been created. Reported-by: Sven Joachim
2011-08-02dpkg-source: clean up temporary file in case of interruptionRaphaël Hertzog1-0/+3
Navite packages (both "1.0" and "3.0 (native)") failed to remove the temporary tarball if the process is interrupted during its generation. Reported-by: Cyril Brulebois <kibi@debian.org>
2011-08-01dpkg-source: implement --commit and fail with unrecorded changesRaphaël Hertzog2-10/+66
Formats "2.0" and "3.0 (quilt)" now fail by default in presence of changes to upstream files that are not managed by their respective patch system. The user is invited to run dpkg-source --commit if he wants to keep the changes. This will avoid that maintainers upload packages with unexpected changes. The old behaviour can be kept with the option --auto-commit. The option --abort-on-upstream-changes is now useless with formats "2.0" and "3.0 (quilt)" except to cancel the effect of a former --auto-commit. See http://lists.debian.org/20110529085303.GA17707@rivendell.home.ouaza.com for the discussion that enterined this change.
2011-08-01Dpkg::Source::Package::V2: cleanup generate_patch()Raphaël Hertzog1-9/+6
Drop all references to $autopatch which has nothing to do with generating a patch. Move the message explaining where the changes have been recorded outside of the function. Drop unused parameter to get_patch_header(). Drop intermediary variables which are only used once.
2011-08-01Dpkg::Source::Package::V2: move logic to create patches in a separate functionRaphaël Hertzog1-36/+55
This commit extracts the logic to create automatic patches in a new generate_patch() method. It's expected that this function will be reused to implement dpkg-source --commit. The code is mainly moved around as-is to simplify reviews. All desired changes have been left for further commits.
2011-08-01Dpkg::Source::Package: replace register_autopatch() with register_patch()Raphaël Hertzog2-34/+42
While register_autopatch() is only able to register a patch as the automatic patch, register_patch() can register a patch under any desired patch name. Also it doesn't not drop the input patch file, leaving that responsibility to whoever called it. However if the input patch file is empty, it will remove the target patch from the debian source package.
2011-08-01dpkg-source: uniform handling of the patch headerRaphaël Hertzog2-56/+35
Formats "2.0" and "3.0 (quilt)" now generate the patch header with the same code. Drop some useless duplication.
2011-07-19dpkg-source: improve the error message "no orig.tar file found"Raphaël Hertzog1-2/+13
Now we include the template corresponding to files that we try to look for.
2011-07-05dpkg-source: improve the logic to identify ignored filesRaphaël Hertzog1-3/+9
The list of ignored files was only generated by expanding the patterns relative to the current directory (which usually is the directory above the source package). Instead what we want is to expand them at the top-level directory of the source package and at the directory being inspected. Reported-by: Joachim Breitner <nomeata@debian.org>
2011-06-12dpkg-source: unapplied patches do not warrant a warningRaphaël Hertzog2-3/+2
There are perfectly legitimate cases where the patches are not applied and there's no need to output a long warning about this. A brief message is more than enough.
2011-06-12dpkg-source: --after-build unapplies patches applied during --before-buildRaphaël Hertzog2-1/+30
Implement this logic for the "2.0" and "3.0 (quilt)" source formats.
2011-06-11dpkg-source: support debian/source/local-patch-headerRaphaël Hertzog4-8/+15
Useful to use in combination with a --single-debian-patch option in debian/source/local-options. The commit also changes the place where the local-options file is ignored. Instead of using the default diff_ignore regexp, it's hardcoded in the initialization function in case the default regexp is not used. Suggested-by: Russ Allbery <rra@debian.org>
2011-05-29Dpkg::Source::Package: add extraction functions to the supported APIRaphaël Hertzog1-1/+106
Add the extraction part of Dpkg::Source::Package to the supported API. It's useful to extract source packages without having to depend on dpkg-source (and hence dpkg-dev). Suggested-by: Niels Thykier
2011-05-24Dpkg::Source::Package: Add ‘.hgsigs’ to the default ignore listsGuillem Jover1-1/+2
Closes: #627462 Based-on-patch-by: Jakub Wilk <jwilk@debian.org>
2011-04-22dpkg-source: tighten the regexp used to ignore the .pc directory of quiltRaphaël Hertzog1-1/+1
The "." was not escaped and the regex incorrectly matched an "ipc" directory for example. Reported-by: Mike Hommey <glandium@debian.org>
2011-04-02Dpkg::Source::Package: Add ‘.gitmodules’ to the default ignore listsGuillem Jover1-1/+3
Closes: #620490
2011-03-24Dpkg::Source::Patch: don't choke on empty patchesRaphaël Hertzog1-1/+1
Commit 255e73e11d1365fbb1e8d78287fad751a8ebc6e5 introduced a regression with empty patches by assuming that a patch analysis would always give back at least one filename. Reported-by: Niels Thykier <niels@thykier.net>
2011-03-07dpkg-source: be a bit less strict when parsing patchesRaphaël Hertzog1-6/+8
It will now accept seeing the same file twice Reported-by: Bastian Blank <waldi@debian.org> It will no longer match on the English text "No newline at end of file" as it might be translated in some cases. It will only consider the intial "\ ". Reported-by: Jan-Marek Glogowski <glogow@fbihome.de>
2011-03-06dpkg-source: remove quilt's .pc directory when --unapply-patches is in useRaphaël Hertzog1-1/+1
2011-03-06Do not print warnings resulting from the autopatch analysisRaphaël Hertzog3-8/+15
Colin's change in 40dcf24632684ec726210dd4437fdedbdbe6134e meant that the autopatch is parsed while it's already applied and this can trigger some undue warnings. This patch silences them. And also deals with similar cases that were unnoticed up to now.
2011-03-06dpkg-source: use server-side clock for patched file timestamp on NFSJonathan Nieder5-12/+38
Since 1.13.14~20 (2006-02-10), dpkg-source touches the files it patches when unpacking, with a single date. This way, the order of mtimes does not depend on the order in which the files were patched, which is convenient when e.g. configure.in and configure are patched. More precisely, dpkg-source does something like the following: my $now = time(); foreach my $fn (@patched_files) { utime($now, $now, $fn); } Unfortunately when the filesystem is NFS, "touch" and normal modification set mtime and atime to the current time on the server side, while time() returns the current time on the client side. The two clocks can disagree, producing breakage. So unless a timestamp has been passed explicitly, use utime(undef, undef, $fn) to set mtime for the first file to the server side time and copy it (rounded down to a number of seconds) to all patched files. Reported-by: Stéphane Glondu <glondu@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Improved-by: Raphaël Hertzog <hertzog@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2011-03-05dpkg-source: keep file order stable when regenerating autopatches.Colin Watson2-26/+59
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2011-01-06Merge commit '1.15.8.8'Raphaël Hertzog3-37/+70
2011-01-06Fix multiple security issues with dpkg-source (CVE-2010-1679)Raphaël Hertzog3-37/+70
- Enhance checks to catch maliciously crafted patches which could modify files outside of the unpacked source package. - Do not consider a top-level symlink like a directory when extracting a tarball. - Exclude .pc while extracting the upstream tarball in 3.0 (quilt) as patch blindly writes in that directory during unpack (and would follow any existing symlink).
2011-01-03Dpkg::Source::Package::V1.pm: correctly detect debian filesRaphaël Hertzog1-1/+1
The code was erroneously assuming that $newdirectory was always a simple filename, but it can be a complete path.
2010-10-03dpkg-source: correctly create .pc/.quilt_series with alternate series filesRaphaël Hertzog1-1/+3
If you have debian/patches/ubuntu.series and you were unpacking the source package on ubuntu, quilt was still directed to debian/patches/series instead of debian/patches/ubuntu.series.
2010-09-19dpkg-source: properly exclude debian/source/local-options in source format 1.0Raphaël Hertzog1-0/+1
commit 2290a1248af081c6df98805295d921e919624356 introduced a regression for V1 native packages since they were no longer excluding debian/source/local-options.
2010-09-18dpkg-source: ensure debian/source/local-options is always excludedRaphaël Hertzog1-1/+1
It should be excluded even if the user provides -I or -i options to override the lists of files to ignore. Reported-by: Robert Luberda <robert@debian.org>
2010-09-05dpkg-source: drop -k parameter from the tar command line used to extract ↵Raphaël Hertzog1-1/+1
tarballs dpkg-source only extracts tarballs in directories that it has created itself, there's no risk of overwriting any user files. Furthermore in the few cases where we do extract a tarball on a non-empty directory, we really want to be able to overwrite files already present. That's the case with a debian.tar.gz file. Reported-by: James Westby <james.westby@linaro.org>
2010-08-26Add gettext messages for plural formsGuillem Jover1-3/+6
Some of the singular forms are not currently used, but we keep them for consistency, and to avoid confusing translators. Closes: #594218
2010-07-26dpkg-source: drop upstream debian directory before copying the debian one in ↵Raphaël Hertzog1-0/+1
place In source formats "2.0" and "3.0 (quilt)", make sure to remove the upstream-provided debian directory before copying the debian-provided version of that directory in place. Closes: #590297
2010-07-25dpkg-source: fix path to gitshallow file in source format "3.0 (git)"Joey Hess1-1/+1
It was looking in the current directory, which works most of the time, but not always.
2010-07-25dpkg-source: replace tar ignore pattern *~ with */*~Raphaël Hertzog1-1/+1
With this change, it can't match the top-level directory anymore and the source package directory can again end with a tilde without creating problems.
2010-07-25dpkg-source: modify source format "3.0 (git)" to use git bundleJoey Hess1-207/+107
Much better than the old approach of a tarball of the .git repository, the git bundle format is simple to understand and work with, and doesn't need to be sanitized for security. Much code went away. Supports limiting history depth by creating a shallow clone. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-06-11Dpkg::Source::Patch: capture output of patch and print it on errorRaphaël Hertzog2-3/+13
patch is now run without its -s flag and thus outputs the usual messages about which file it's patching and gives more verbose error messages. Those messages are captured and only displayed to the user when the patch application failed.
2010-06-10dpkg-source: new option --abort-on-upstream-changesRaphaël Hertzog2-0/+14
This option can be used with source formats 1.0, 2.0 and 3.0 (quilt). It aborts every time that you try to build a source package which contains (unmanaged) changes to the upstream source code.
2010-06-10dpkg-source: new --unapply-patches optionRaphaël Hertzog2-0/+50
This option is used by source formats 2.0 and 3.0 (quilt) to unapply patches after a successful build. It's useful for people who manage their packages in a VCS repository and prefer to have patches unapplied, even after a package build. Given that this option is a matter of personal taste, do not allow it in debian/source/options so that the resulting source package cannot have this behaviour by default and so that all source packages behave in a consistent way: patches applied by default is a major feature of the new formats.
2010-05-19Merge branch 'sid' (through tag '1.15.7.1')Guillem Jover1-0/+1
Conflicts: debian/changelog