Make pacman forget deltas exist

Dummy callbacks are still present to prevent compiler warnings until
libalpm is delta free.

Also remove Delta parsing from pacman.conf.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2019-03-02 18:40:19 +10:00
parent 40391c564a
commit e7bb0f8824
7 changed files with 9 additions and 71 deletions

View file

@ -186,14 +186,6 @@ Options
*Color*::
Automatically enable colors only when pacman's output is on a tty.
*UseDelta* [= ratio]::
Download delta files instead of complete packages if possible. Requires
the `xdelta3` program to be installed. If a ratio is specified (e.g.,
`0.5`), then it is used as a cutoff for determining whether to use deltas.
Allowed values are between `0.0` and `2.0`; sensible values are between
`0.2` and `0.9`. Using a value above `1.0` is not recommended. The
default is `0.7` if left unspecified.
*TotalDownload*::
When downloading, display the amount downloaded, download rate, ETA,
and completed percentage of the entire download list rather

View file

@ -19,7 +19,6 @@ HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup

View file

@ -267,23 +267,6 @@ void cb_event(alpm_event_t *event)
printf(_("loading package files...\n"));
}
break;
case ALPM_EVENT_DELTA_INTEGRITY_START:
printf(_("checking delta integrity...\n"));
break;
case ALPM_EVENT_DELTA_PATCHES_START:
printf(_("applying deltas...\n"));
break;
case ALPM_EVENT_DELTA_PATCH_START:
printf(_("generating %s with %s... "),
event->delta_patch.delta->to,
event->delta_patch.delta->delta);
break;
case ALPM_EVENT_DELTA_PATCH_DONE:
printf(_("success!\n"));
break;
case ALPM_EVENT_DELTA_PATCH_FAILED:
printf(_("failed.\n"));
break;
case ALPM_EVENT_SCRIPTLET_INFO:
fputs(event->scriptlet_info.line, stdout);
break;
@ -355,8 +338,6 @@ void cb_event(alpm_event_t *event)
case ALPM_EVENT_KEYRING_DONE:
case ALPM_EVENT_KEY_DOWNLOAD_DONE:
case ALPM_EVENT_LOAD_DONE:
case ALPM_EVENT_DELTA_INTEGRITY_DONE:
case ALPM_EVENT_DELTA_PATCHES_DONE:
case ALPM_EVENT_DISKSPACE_DONE:
case ALPM_EVENT_RETRIEVE_DONE:
case ALPM_EVENT_RETRIEVE_FAILED:
@ -366,6 +347,14 @@ void cb_event(alpm_event_t *event)
case ALPM_EVENT_PKGDOWNLOAD_START:
case ALPM_EVENT_PKGDOWNLOAD_DONE:
case ALPM_EVENT_PKGDOWNLOAD_FAILED:
/* temporary until removed from libalpm */
case ALPM_EVENT_DELTA_INTEGRITY_START:
case ALPM_EVENT_DELTA_INTEGRITY_DONE:
case ALPM_EVENT_DELTA_PATCHES_START:
case ALPM_EVENT_DELTA_PATCHES_DONE:
case ALPM_EVENT_DELTA_PATCH_START:
case ALPM_EVENT_DELTA_PATCH_DONE:
case ALPM_EVENT_DELTA_PATCH_FAILED:
/* nothing */
break;
}

View file

@ -103,7 +103,6 @@ config_t *config_new(void)
newconfig->op = PM_OP_MAIN;
newconfig->logmask = ALPM_LOG_ERROR | ALPM_LOG_WARNING;
newconfig->configfile = strdup(CONFFILE);
newconfig->deltaratio = 0.0;
if(alpm_capabilities() & ALPM_CAPABILITY_SIGNATURES) {
newconfig->siglevel = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL |
ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL;
@ -485,9 +484,6 @@ static int _parse_options(const char *key, char *value,
} else if(strcmp(key, "VerbosePkgLists") == 0) {
config->verbosepkglists = 1;
pm_printf(ALPM_LOG_DEBUG, "config: verbosepkglists\n");
} else if(strcmp(key, "UseDelta") == 0) {
config->deltaratio = 0.7;
pm_printf(ALPM_LOG_DEBUG, "config: usedelta (default 0.7)\n");
} else if(strcmp(key, "TotalDownload") == 0) {
config->totaldownload = 1;
pm_printf(ALPM_LOG_DEBUG, "config: totaldownload\n");
@ -525,26 +521,6 @@ static int _parse_options(const char *key, char *value,
if(!config->arch) {
config_set_arch(value);
}
} else if(strcmp(key, "UseDelta") == 0) {
double ratio;
char *endptr;
const char *oldlocale;
/* set the locale to 'C' for consistent decimal parsing (0.7 and never
* 0,7) from config files, then restore old setting when we are done */
oldlocale = setlocale(LC_NUMERIC, NULL);
setlocale(LC_NUMERIC, "C");
ratio = strtod(value, &endptr);
setlocale(LC_NUMERIC, oldlocale);
if(*endptr != '\0' || ratio < 0.0 || ratio > 2.0) {
pm_printf(ALPM_LOG_ERROR,
_("config file %s, line %d: invalid value for '%s' : '%s'\n"),
file, linenum, "UseDelta", value);
return 1;
}
config->deltaratio = ratio;
pm_printf(ALPM_LOG_DEBUG, "config: usedelta = %f\n", ratio);
} else if(strcmp(key, "DBPath") == 0) {
/* don't overwrite a path specified on the command line */
if(!config->dbpath) {
@ -766,7 +742,6 @@ static int setup_libalpm(void)
alpm_option_set_arch(handle, config->arch);
alpm_option_set_checkspace(handle, config->checkspace);
alpm_option_set_usesyslog(handle, config->usesyslog);
alpm_option_set_deltaratio(handle, config->deltaratio);
alpm_option_set_ignorepkgs(handle, config->ignorepkg);
alpm_option_set_ignoregroups(handle, config->ignoregrp);

View file

@ -56,7 +56,6 @@ typedef struct __config_t {
unsigned short usesyslog;
unsigned short color;
unsigned short disable_dl_timeout;
double deltaratio;
char *arch;
char *print_format;
/* unfortunately, we have to keep track of paths both here and in the library

View file

@ -125,14 +125,6 @@ static void list_repos(void)
}
}
static void show_float(const char *directive, float val)
{
if(verbose) {
printf("%s = ", directive);
}
printf("%f%c", val, sep);
}
static void show_bool(const char *directive, short unsigned int val)
{
if(val) {
@ -269,8 +261,6 @@ static void dump_config(void)
show_bool("DisableDownloadTimeout", config->disable_dl_timeout);
show_bool("ILoveCandy", config->chomp);
show_float("UseDelta", config->deltaratio);
show_cleanmethod("CleanMethod", config->cleanmethod);
show_siglevel("SigLevel", config->siglevel, 0);
@ -380,9 +370,6 @@ static int list_directives(void)
} else if(strcasecmp(i->data, "DisableDownloadTimeout") == 0) {
show_bool("DisableDownloadTimeout", config->disable_dl_timeout);
} else if(strcasecmp(i->data, "UseDelta") == 0) {
show_float("UseDelta", config->deltaratio);
} else if(strcasecmp(i->data, "CleanMethod") == 0) {
show_cleanmethod("CleanMethod", config->cleanmethod);

View file

@ -222,9 +222,7 @@ static int sync_cleancache(int level)
/* skip package databases within the cache directory */
"*.db*", "*.files*",
/* skip source packages within the cache directory */
"*.src.tar.*",
/* skip package deltas, we aren't smart enough to clean these yet */
"*.delta"
"*.src.tar.*"
};
size_t j;
@ -847,7 +845,6 @@ int sync_prepare_execute(void)
case ALPM_ERR_PKG_INVALID:
case ALPM_ERR_PKG_INVALID_CHECKSUM:
case ALPM_ERR_PKG_INVALID_SIG:
case ALPM_ERR_DLT_INVALID:
for(i = data; i; i = alpm_list_next(i)) {
char *filename = i->data;
printf(_("%s is invalid or corrupted\n"), filename);