| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Create directory "patches" so that quilt commands get the right root
even if patch-wrapper fails.
|
|
|
|
|
|
|
|
|
|
| |
The heuristic to find file names in unapplied patches fails miserably
on all patches with timestamps. We have to consider everything past
the last tab as the timestamp and strip it. The timestamp itself will
contain spaces so we can't split on that.
This fixes a regression introduced by commit 4df47975. It's hard to
believe this has been broken for over 4 years and nobody ever noticed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Old versions of bash (at least version 3.2.51) don't properly handle
prefix stripping together with quoting when evaluating an array. So
strip the prefix before adding each file to opt_files. It's faster
anyway.
Same thing when diffing against a snapshot, strip the snapshot
directory prefix from file names before evaluating the quoted files
array.
This fixes a regression introduced in:
commit b0baeeb6b61132af92fd75df5f912554d295dee1
Author: Jean Delvare <jdelvare@suse.de>
Date: Fri Mar 25 18:48:49 2011 +0100
diff, refresh: Accept file names with spaces
(Only affecting the versions of bash which have the aforementioned bug.)
This also fixes a bug when called from a subdirectory and a file
passed as an argument starts with "./".
Extend the test suite to test both cases, so that such bugs can't
sneak in in the future.
|
|
|
|
|
| |
Test the top and previous of patches with unusual names. Also test a
few more unusual characters.
|
|
|
|
|
|
|
|
|
|
| |
In the case of a generated or manually tweaked series file, it can
happen that the same patch shows up twice in the series file. Check
for this before pushing any patch, otherwise we would corrupt quilt's
internal database.
This fixes bug #20628:
https://savannah.nongnu.org/bugs/?20628
|
|
|
|
| |
These instructions no longer works.
|
|
|
|
| |
%{P} already has a trailing slash.
|
|
|
|
|
|
| |
Recent versions of GNU diff will quote file names which include a
space, but GNU patch version 2.5.9 and older do not support that. So
strip the quotes to let the test succeed.
|
|
|
|
|
|
|
| |
Add tests for the patches command in two test cases. In particular
we want to test that the patches command works OK when patch filenames
contain spaces or other unusual characters, and that file names are
properly guessed in patches which create or delete files.
|
|
|
|
|
|
|
| |
"quilt files" returns a blank line if no files are included in the
patch. This could easily break constructs such as "quilt files | wc
-l". Let "quilt files" return nothing at all if there are no files in
the patch.
|
|
|
|
|
|
|
|
| |
* Don't set $needs_shell before we need it. When handling commands
internally, we don't care about $needs_shell.
* Use a single regexp to set $use_re.
* Clear $good as soon as a test fails, instead of grepping for
failures later.
|
|
|
|
|
| |
* Command lines containing "&" need /bin/sh.
* "*" and "?" need not be escaped inside brackets in regular expressions.
|
|
|
|
|
| |
Declare all global variables with qw() and stop passing them as
arguments to some functions.
|
|
|
|
|
| |
Move functions before they are called, so that we no longer need forward
declarations.
|
|
|
|
|
| |
Code indentation in this file is inconsistent, this makes editing it
difficult. Use tabulations everywhere.
|
|
|
|
|
|
| |
The su and sg commands can only work if running as root. The quilt
test cases do not use these commands and I certainly wouldn't
recommend running the test suite as root, so drop the feature.
|
|
|
|
|
|
|
|
| |
Perl has a standard module which can split shell command lines for
us, so use it. Function shellwords can deal with quoted parameters
too so we no longer need to pass commands to /bin/sh just because
they contain quoted parameters. This lowers the ratio of commands
passed to /bin/sh from 34% to 31%.
|
|
|
|
|
| |
Delay command line splitting until it's actually needed. This avoids
having to join it again to log it or to pass it to /bin/sh.
|
| |
|
|
|
|
|
|
|
| |
* Delete blank lines at end of files.
* Delete white space at end of lines.
* Delete spaces before tab.
* Replace 8 spaces by a tab where it makes sense.
|
|
|
|
|
|
| |
This is trigered e.g. when you try to add a binary file to a patch.
This is actually creepy to think that we were not checking the
retcode of diff :)
|
|
|
|
|
|
| |
Use the same syntax for file testing as used in other test cases. It
is more readable and avoids having to add yet another condition for
$needs_shell.
|
|
|
|
|
|
|
| |
Add a test case for "quilt refresh" on a patch leaving an empty file.
We were already testing that imported patches doing that were handled
properly, now we want to ensure that refreshing such patches preserves
the information.
|
| |
|
|
|
|
|
|
| |
For now this only covers the push and fold commands on imported patches,
which we just fixed. Later we can add tests for the refresh command,
which is still not OK.
|
|
|
|
|
| |
* Remove the implemented features from the to-do list.
* Document the command line interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Variable substitution on command lines was happening too early so
setting a variable only took effect with the second next line of the
test case.
Additionally, there was no check that the environment variable was
actually set. This resulted in perl warnings during the test suite if
a variable is ever used before having been set.
Fix both issues.
Also add a test case for this feature, to avoid a future breakage.
Some of the tester script features are tricky and easy to get wrong,
so test them independently of quilt in a dedicated test case.
|
|
|
|
|
|
|
| |
Rewrite the main parsing loop of the tester scripts, in a way which
is easier to understand and avoids redundant tests.
No functional change here.
|
|
|
|
|
| |
Quilt pop at the bottom of the stack returns 2, as does quilt push at
the top of the stack.
|
|
|
|
|
|
|
| |
- test/run: Record the status returned by every command, so that test
cases can check them.
- test/*.text: Test the status returned by all commands in 4 test
cases.
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX-compliant implementations of wc right-justify each column of
output in 7 character wide columns. Tests that verify the output
of wc -l should take into account the number of digits in the line
count and add the appropriate padding. Therefore, in order for the
tests to pass with both POSIX-compliant and non-POSIX-compliant
implementations of wc tests should match wc output against patterns
with optional whitespace prefixes.
Signed-off-by: Kent R. Spillner <kspillner@acm.org>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Timestamp comparisons when popping a patch were fixed in commit
005922085f0135c35baa4b0e8db6f05d78586377, so we can get rid of this
sleep in the test suite.
|
|
|
|
|
| |
Add support for multiple files to "quilt patches". Patches will be
printed, that modify any of the listed files.
|
|
|
|
|
| |
Let "quilt patches" also match deleted files in unapplied patches.
Commit 4df47975 was supposed to fix that already, but did not really.
|
| |
|
|
|
|
|
|
| |
As a bug was recently found in this script, add a test case covering
both unified and context patch formats, so that hopefully no other
bug creeps in in the future.
|
|
|
|
|
|
|
| |
If told to refresh a patch and the patch is empty, still obey. The
user should know what he/she is doing. If the patch was non-empty
before, we must erase it, otherwise a subsequent pop will fail,
complaining that the patch should be refreshed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
avoids errors like this:
$ quilt refresh
sed: -e expression #1, char 21: unknown option to `s'
Nothing in patch patches/strange:name
[Satoru Takeuchi: suggested first alternative implementation not
relying on find -printf.]
[Jean Delvare: added missing quoting and a new test file for this
case.]
|
|
|
|
| |
Check for existing directories before unpacking.
|
|
|
|
|
| |
Run create_db() as part of quilt setup, so that $QUILT_PATCHES and
$QUILT_SERIES are recorded for future quilt commands.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is a continuation of Yasushi SHOJI's initial work of fixing
support for file names with spaces. This time I fixed support in the
grep command. This is particularly important because the grep command
operates on all files in the work tree, even if they aren't touched
by any patch, so the chances that one of them has a space in its name
is greater. As before, no guarantee is made that all options are
covered, but this should be a good starting point.
|
|
|
|
|
|
|
| |
Drop support for backup removal (option -x). Quilt doesn't use it.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Raphael Hertzog <hertzog@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are abusing backup-files's "backup" function for quilt snapshot.
What we need is semantically different, and it works almost by
accident. We don't want linked copies of the files, we want real
copies, and the fact that "quilt snapshot" may touch the working
files is a little frightening IMHO.
So, implement a separate "copy" function which does what we need. Not
only it does the right thing, but it will also be somewhat faster
than "backup", as we can do straight copies of the files without
checking for their link count first.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Raphael Hertzog <hertzog@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When restoring all files, batch the first steps (directory creation
and target file removal) and last steps (optional touch and backup
file removal). This makes the typical restore case (quilt pop) much,
much faster.
Note: a similar optimization would be possible for the removal
function (-x), but quilt doesn't use this function at the moment.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Raphael Hertzog <hertzog@debian.org>
|
|
|
|
|
|
|
| |
Let find report errors by itself.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Raphael Hertzog <hertzog@debian.org>
|
|
|
|
|
|
|
|
| |
Make backup-files a shell script instead of a binary, so we can make
quilt arch: all [Steve Langasek, thanks so much]
(Closes: Debian #363659)
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|