mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
xdelta : only handle gz compression specifically
There is apparently no need to handle the re-compression manually when applying a xdelta patch in case of bzip2 or xz. Only gzip needs to be handled specifically for disabling timestamp with the -n option. After this patch, if xdelta is enhanced with xz support (1-line patch), it will be transparent from pacman side. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
9af9c0f328
commit
13b281d743
@ -622,15 +622,12 @@ static int apply_deltas(pmtrans_t *trans)
|
|||||||
snprintf(to, len, "%s/%s", cachedir, d->to);
|
snprintf(to, len, "%s/%s", cachedir, d->to);
|
||||||
|
|
||||||
/* build the patch command */
|
/* build the patch command */
|
||||||
/* compression command */
|
|
||||||
char *compress = "cat";
|
|
||||||
if(endswith(to, ".gz")) {
|
if(endswith(to, ".gz")) {
|
||||||
compress = "gzip -n";
|
/* special handling for gzip : we disable timestamp with -n option */
|
||||||
} else if(endswith(to, ".bz2")) {
|
snprintf(command, PATH_MAX, "xdelta3 -d -q -R -c -s %s %s | gzip -n > %s", from, delta, to);
|
||||||
compress = "bzip";
|
} else {
|
||||||
|
snprintf(command, PATH_MAX, "xdelta3 -d -q -s %s %s %s", from, delta, to);
|
||||||
}
|
}
|
||||||
/* -R for disabling external recompression, -c for sending to stdout */
|
|
||||||
snprintf(command, PATH_MAX, "xdelta3 -d -q -R -c -s %s %s | %s > %s", from, delta, compress, to);
|
|
||||||
|
|
||||||
_alpm_log(PM_LOG_DEBUG, "command: %s\n", command);
|
_alpm_log(PM_LOG_DEBUG, "command: %s\n", command);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user