summaryrefslogtreecommitdiffstats
path: root/quilt
Commit message (Collapse)AuthorAgeFilesLines
* top: Fix parameter quotingJean Delvare2012-12-051-1/+1
|
* push: Fix variable usage in interruptJean Delvare2012-12-051-1/+3
| | | | | While bash allows poking at a function caller's variables, that's not something we normally do in quilt.
* Fix handling of patch files with ':' in their nameBenjamin Poirier2012-12-051-2/+8
| | | | | | | | | | | | 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.]
* push: Always let the user force pushing a patchJean Delvare2012-12-031-2/+1
| | | | | | Let the user force pushing a patch even if patch returns with error code 2. The user should know better. This happens when pushing a patch with a header but no actual contents, for example.
* pop: Fix timestamp comparisonJean Delvare2012-12-031-2/+2
| | | | | | | | | The timestamps recorded on file systems have a limited resolution. For this reason, a patch or file with a timestamp exactly equal to .timestamp should be considered as more recent than .timestamp, i.e. potentially modified since the last push or refresh. This is particularly important for the test suite, as we can do many actions in the same second there.
* inspect: Refactor code to pwd_to_dirJean Delvare2012-10-251-22/+19
| | | | | Move the code deriving the directory from $PWD to a separate function to avoid code duplication.
* setup: Check for existing directories before unpackingJean Delvare2012-10-251-0/+22
| | | | Check for existing directories before unpacking.
* setup: Fix white space handling by check_for_existing_filesJean Delvare2012-10-251-3/+8
| | | | | | | | Fix handling of directory names including white spaces by check_for_existing_files. awk can't deal with tokens which include white spaces, so use bash's read function instead. As a side bonus, we get rid of the undocumented dependency to "uniq".
* setup/inspect: Handle zip archivesJean Delvare2012-10-252-2/+49
| | | | Let quilt setup handle zip archives.
* setup: Run create_dbJean Delvare2012-10-251-2/+6
| | | | | Run create_db() as part of quilt setup, so that $QUILT_PATCHES and $QUILT_SERIES are recorded for future quilt commands.
* setup: Try alternative patches/series namesJean Delvare2012-10-251-1/+7
| | | | | setup: If a tar file contains a patches directory or a series file, automatically try alternative names which are less likely to collide.
* setup: Check for existing files after unpackingJean Delvare2012-10-251-2/+2
| | | | | | setup: check for existing files after unpacking the tar files, not before, otherwise we check too early and a tar file containing a "patches" directory will not be handled properly.
* Merge remote branch 'origin/fixes-0.51'Jean Delvare2012-02-292-17/+56
|\
| * quilt mail: Implement option -M to read the introduction message from a filefixes-0.51Andreas Gruenbacher2012-02-161-4/+21
| |
| * quilt mail: Skip additional recipients with "bad" email addressesAndreas Gruenbacher2012-02-111-1/+1
| | | | | | | | | | | | Instead of failing when a proper email address cannot be extracted from a Signed-off-by, Acked-by, Suggested-by, Reviewed-by, Requested-by, Reported-by, Tested-by, To, or Cc line, give a warning and skip that line.
| * edmail: Allow to add "good" recipient addresses while skipping "bad" onesAndreas Gruenbacher2012-02-111-3/+16
| |
| * quilt mail: Fix wrong use of edmailAndreas Gruenbacher2012-02-111-1/+1
| | | | | | | | | | It makes no sense to pass the recipient addresses to edmail when removing Bcc lines.
| * quilt mail: Require a "reasonable looking" email address in patch headersAndreas Gruenbacher2012-02-111-4/+4
| | | | | | | | | | | | | | In particular, empty strings will not work as email addresses. Also, use sed's "I" flag for case-insensitive searching; "i" will sometimes be mistaken for the "insert" operator.
| * quilt mail: Don't use localized date format in From linesAndreas Gruenbacher2012-02-111-1/+1
| |
| * quilt mail: Improve error reporting (requires bash 3.2)Andreas Gruenbacher2012-02-111-3/+12
| | | | | | | | | | | | | | Improve error checking by using the "pipefail" option, available since bash 3. Since bash 3.1 is known to be broken already, require bash 3.2 directly. Report the patch name as well when "quilt mail" finds a problem with a patch.
* | Document the patch grouping featureJean Delvare2012-02-221-1/+2
| | | | | | | | This fixes bug #12428.
* | setup, scripts/inspect: Properly escape spaces in directory and archive namesJean Delvare2012-02-172-4/+12
| | | | | | | | This fixes bug #25579.
* | grep: Accept file names with spacesJean Delvare2012-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | 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.
* | backup-files: Skip echo-only loops in silent modeJean Delvare2012-02-011-13/+14
| | | | | | | | | | | | | | | | In silent mode, loops which do nothing but print messages turn into no-ops. Skip them completely to save some time. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Keep /dev/null openedJean Delvare2012-02-011-7/+9
| | | | | | | | | | | | | | | | Keep /dev/null opened as we will need it repeatedly. Avoiding repeated calls to open brings a small performance boost. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Drop support for backup removalJean Delvare2012-02-011-15/+1
| | | | | | | | | | | | | | 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>
* | backup-files: Drop support for -L on restoreJean Delvare2012-02-011-14/+4
| | | | | | | | | | | | | | Drop support for -L on restore, quilt doesn't use it. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Inline restore_fastJean Delvare2012-02-011-22/+10
| | | | | | | | | | | | | | | | | | The two callers of restore_fast already know if they are operating on an empty or non-empty backup-file. Move the code back to the calling sites, to avoid this redundant test. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Clarify command line optionsJean Delvare2012-02-011-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Misc cleanups: * Add my copyright and simplify the reference to the initial version. * Drop the program description, as it is redundant with the usage function. * Clarify the usage message, to make it clear what each option is doing, and which ones are compatible with each other. * Let the script complain if no action is given, as this has to be a user or developer error. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Try mass copy first on copyJean Delvare2012-02-011-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying many files to a snapshot directory, try a mass copy first, as it is much faster. It is however not portable and may thus fail. If it fails, fallback to per-file processing, which always works. This change results in a huge performance boost on systems where the cp command supports all the required options (which includes all systems using GNU coreutils.) Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Separate function copy_manyJean Delvare2012-02-011-0/+33
| | | | | | | | | | | | | | | | Create a dedicated function for mass-copying files. At the moment it isn't bringing any gain, but this will get improved next. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: New function for copyJean Delvare2012-02-012-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | backup-files: Skip first mkdir on restoreJean Delvare2012-02-011-6/+3
| | | | | | | | | | | | | | | | | | | | The mass link/copy will create the required directories by itself if it succeeds. As files being removed don't require the creation of a directory, this means we can move the creation of the directories to the case where non-empty files have to be processed individually. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Try mass link/copy first on restoreJean Delvare2012-02-011-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When restoring all files from a backup directory, try a mass link (or copy) first, as it is much faster. It is however not portable and may thus fail. If it fails, fallback to per-file processing, which always works. This change results in a huge performance boost on systems where the cp command supports all the required options (which includes all systems using GNU coreutils.) Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Separate lists for empty and non-empty filesJean Delvare2012-02-011-14/+22
| | | | | | | | | | | | | | | | Create two separate lists for empty and non-empty files. This will allow dedicated handling of each set of files. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Remember the list of filesJean Delvare2012-02-013-18/+30
| | | | | | | | | | | | | | | | | | | | Remember the results of the find command, to avoid having to run it again later. We use a temporary file rather than a local variable, because you can't store binary zeroes in a bash string, and because the temporary file approach performs better on large file sets. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Quick exit when unlinking is not neededJean Delvare2012-02-011-0/+14
| | | | | | | | | | | | | | | | | | | | | | The "check for hard links" use case is almost always a no-op. Check if any work is needed at all first, and only if this is the case, walk the list of files and unlink the faulty files. This approach results in a huge performance gain in the most common case, and a very small performance loss in the uncommon case. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Separate function restore_allJean Delvare2012-02-011-21/+29
| | | | | | | | | | | | | | | | | | | | Move the code to restore all files from a backup directory to a separate function. This only duplicates a small amount of code, and makes the code clearer. This will also allow further optimizations of the specific use case of "quilt pop". Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Avoid negationsJean Delvare2012-02-011-13/+13
| | | | | | | | | | | | | | | | In if/else constructs, always start with the positive case, to avoid a negation. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Optimize noopJean Delvare2012-02-011-3/+10
| | | | | | | | | | | | | | | | | | Optimize the noop operation. The only use case in quilt is to ensure that files have a link count of 1, so we can check that OPT_NOLINKS is set once and for all, instead of checking again with every file. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Drop curly bracesJean Delvare2012-02-011-10/+10
| | | | | | | | | | | | | | | | | | Don't use the ${VAR} construct when we don't have to, it's slightly slower than simple variable names. Likewise, don't use quotes when we don't have to. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Batch mass restoreJean Delvare2012-02-011-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | backup-files: Use internal implementation of dirnameJean Delvare2012-02-013-36/+49
| | | | | | | | | | | | | | | | Use quilt's internal implementation of dirname. This is more efficient than calling an external binary, and avoids a dependency. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Make input methods mutually exclusiveJean Delvare2012-02-011-22/+19
| | | | | | | | | | | | | | | | | | Make the various file list selection methods mutually exclusive. This is the actual usage scheme by quilt, and handling them separately makes the code both clearer and more efficient. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Drop variable filelistJean Delvare2012-02-011-9/+5
| | | | | | | | | | | | | | | | No need to copy all file names to a dedicated array, we can use $@ directly instead. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Optimize backupJean Delvare2012-02-011-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize backup: * Due to the way quilt uses backup-files, the backup file will never exist, so there is no point checking for this. * Don't attempt to create directories which already exist. * Use > instead of touch to create new files, it's faster. * Stop supporting option -t on backup, it's undocumented and quilt doesn't use it. * Drop unneeded quotes around constant. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Optimize restoreJean Delvare2012-02-011-14/+8
| | | | | | | | | | | | | | | | | | | | | | Optimize restore: * Don't call mkdir if we know the directory already exists. * Don't try to optimize the -L case, quilt doesn't use it anyway and the current optimization is broken. * Move common code at the end of the function. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Split code to sparate functionsJean Delvare2012-02-011-63/+78
| | | | | | | | | | | | | | | | The different actions don't have much code in common, so it would be more efficient to let different functions handle them. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Simplify find loopJean Delvare2012-02-011-12/+6
| | | | | | | | | | | | | | Let find report errors by itself. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* | backup-files: Prefix must be a directoryJean Delvare2012-02-011-20/+7
| | | | | | | | | | | | | | | | Enforce the fact that the prefix must be a directory. This is what quilt does, and enforcing it allows some code clean-ups. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>