1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

Remove SyncFirst option

This has outlived its usefulness and causes more problems than it
solves. It has historically only ever been used to install pacman first.
That should not be needed given we provide the vercmp utility (which has
no library dependencies) and so calling pacman in install scripts is a
sign of poor packaging.

Work-duplicated-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2012-02-14 12:32:25 -06:00
parent 8fb1948cd0
commit 6a8e50a69e
11 changed files with 1 additions and 268 deletions

View File

@ -93,15 +93,6 @@ Options
Instructs pacman to ignore any upgrades for this package when performing
a '\--sysupgrade'. Shell-style glob patterns are allowed.
*SyncFirst =* package ...::
Instructs pacman to check for newer version of these packages before any
sync operation. The user will have the choice to either cancel the current
operation and upgrade these packages first or go on with the current
operation. This option is typically used with the 'pacman' package.
*NOTE*: when a `SyncFirst` transaction takes place, no command line flags
(e.g. '\--force') are honored. If this is not ideal, disabling `SyncFirst`
and performing a manual sync of the involved packages may be required.
*IgnoreGroup =* group ...::
Instructs pacman to ignore any upgrades for all packages in this
group when performing a '\--sysupgrade'. Shell-style glob patterns are

View File

@ -15,8 +15,6 @@
#LogFile = @localstatedir@/log/pacman.log
#GPGDir = @sysconfdir@/pacman.d/gnupg/
HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst = pacman
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled

View File

@ -71,7 +71,6 @@ int config_free(config_t *oldconfig)
alpm_list_free(oldconfig->explicit_removes);
FREELIST(oldconfig->holdpkg);
FREELIST(oldconfig->syncfirst);
FREELIST(oldconfig->ignorepkg);
FREELIST(oldconfig->ignoregrp);
FREELIST(oldconfig->noupgrade);
@ -422,8 +421,6 @@ static int _parse_options(const char *key, char *value,
setrepeatingoption(value, "IgnoreGroup", &(config->ignoregrp));
} else if(strcmp(key, "HoldPkg") == 0) {
setrepeatingoption(value, "HoldPkg", &(config->holdpkg));
} else if(strcmp(key, "SyncFirst") == 0) {
setrepeatingoption(value, "SyncFirst", &(config->syncfirst));
} else if(strcmp(key, "CacheDir") == 0) {
setrepeatingoption(value, "CacheDir", &(config->cachedirs));
} else if(strcmp(key, "Architecture") == 0) {

View File

@ -84,7 +84,6 @@ typedef struct __config_t {
/* select -Sc behavior */
unsigned short cleanmethod;
alpm_list_t *holdpkg;
alpm_list_t *syncfirst;
alpm_list_t *ignorepkg;
alpm_list_t *ignoregrp;
alpm_list_t *noupgrade;

View File

@ -591,26 +591,6 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
return 0;
}
static alpm_list_t *syncfirst(void) {
alpm_list_t *i, *res = NULL;
alpm_db_t *db_local = alpm_get_localdb(config->handle);
alpm_list_t *syncdbs = alpm_get_syncdbs(config->handle);
for(i = config->syncfirst; i; i = alpm_list_next(i)) {
const char *pkgname = i->data;
alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);
if(pkg == NULL) {
continue;
}
if(alpm_sync_newversion(pkg, syncdbs)) {
res = alpm_list_add(res, strdup(pkgname));
}
}
return res;
}
static alpm_db_t *get_db(const char *dbname)
{
alpm_list_t *i;
@ -1001,38 +981,7 @@ int pacman_sync(alpm_list_t *targets)
}
}
alpm_list_t *targs = alpm_list_strdup(targets);
if(!config->op_s_downloadonly && !config->print) {
/* check for newer versions of packages to be upgraded first */
alpm_list_t *packages = syncfirst();
if(packages) {
/* Do not ask user if all the -S targets are SyncFirst packages, see FS#15810 */
alpm_list_t *tmp = NULL;
if(config->op_s_upgrade || (tmp = alpm_list_diff(targets, packages, (alpm_list_fn_cmp)strcmp))) {
alpm_list_free(tmp);
printf(_(":: The following packages should be upgraded first :\n"));
list_display(" ", packages, getcols(fileno(stdout)));
if(yesno(_(":: Do you want to cancel the current operation\n"
":: and upgrade these packages now?"))) {
FREELIST(targs);
targs = packages;
config->flags = 0;
config->op_s_upgrade = 0;
} else {
FREELIST(packages);
}
printf("\n");
} else {
pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog\n");
FREELIST(packages);
}
}
}
int ret = sync_trans(targs);
FREELIST(targs);
return ret;
return sync_trans(targets);
}
/* vim: set ts=2 sw=2 noet: */

View File

@ -108,7 +108,6 @@ is not necessarily complete:
- HoldPkg
- IgnorePkg
- IgnoreGroup
- SyncFirst
- NoExtract
- NoUpgrade
- XferCommand

View File

@ -1,27 +0,0 @@
self.description = "Sysupgrade : pacman needs to be upgraded and has new deps"
sp = pmpkg("pacman", "1.0-2")
sp.depends = ["dep"]
self.addpkg2db("sync", sp)
spdep = pmpkg("dep")
self.addpkg2db("sync", spdep)
sp1 = pmpkg("pkg1", "1.0-2")
self.addpkg2db("sync", sp1)
lp = pmpkg("pacman", "1.0-1")
self.addpkg2db("local", lp)
lp1 = pmpkg("pkg1", "1.0-1")
self.addpkg2db("local", lp1)
self.option["SyncFirst"] = ["pacman"]
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pacman")
self.addrule("PKG_VERSION=pacman|1.0-2")
self.addrule("PKG_VERSION=pkg1|1.0-1")
self.addrule("PKG_EXIST=dep")

View File

@ -1,49 +0,0 @@
self.description = "Sysupgrade : pacman needs to be upgraded and has updated deps"
sp = pmpkg("pacman", "1.0-2")
sp.depends = ["zlib", "curl", "libarchive"]
self.addpkg2db("sync", sp)
libcdep = pmpkg("glibc", "2.15-1")
self.addpkg2db("sync", libcdep)
curldep = pmpkg("curl", "7.22-1")
self.addpkg2db("sync", curldep)
libadep = pmpkg("libarchive", "2.8.5-1")
self.addpkg2db("sync", libadep)
zlibdep = pmpkg("zlib", "1.2.5-3")
zlibdep.depends = ["glibc"]
self.addpkg2db("sync", zlibdep)
lp = pmpkg("pacman", "1.0-1")
self.addpkg2db("local", lp)
lp1 = pmpkg("curl", "7.21.7-1")
self.addpkg2db("local", lp1)
lp2 = pmpkg("glibc", "2.13-1")
self.addpkg2db("local", lp2)
lp3 = pmpkg("libarchive", "2.8.4-1")
self.addpkg2db("local", lp3)
lp4 = pmpkg("zlib", "1.2.5-3")
self.addpkg2db("local", lp4)
self.option["SyncFirst"] = ["pacman"]
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pacman|1.0-2")
self.addrule("PKG_EXIST=glibc")
self.addrule("PKG_EXIST=curl")
self.addrule("PKG_EXIST=libarchive")
# TODO: when SyncFirst recursive comes back, re-enable these
#self.addrule("PKG_VERSION=glibc|2.15-1")
#self.addrule("PKG_VERSION=curl|7.22-1")
#self.addrule("PKG_VERSION=libarchive|2.8.5-1")
self.addrule("PKG_EXIST=zlib")

View File

@ -1,35 +0,0 @@
self.description = "Sysupgrade: upgrade pacman with deps as provisions"
sp = pmpkg("pacman", "1.0-2")
sp.depends = ["zlib"]
self.addpkg2db("sync", sp)
glibcdep = pmpkg("glibc", "2.13-1")
self.addpkg2db("sync", glibcdep)
zlibdep = pmpkg("zlib", "1.2.5-3")
zlibdep.depends = ["glibc"]
self.addpkg2db("sync", zlibdep)
lp = pmpkg("pacman", "1.0-1")
lp.depends = ["zlib"]
self.addpkg2db("local", lp)
lp2 = pmpkg("glibc-awesome", "2.13-2")
lp2.provides = ["glibc=2.13"]
lp2.conflicts = ["glibc"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("zlib", "1.2.5-3")
self.addpkg2db("local", lp3)
self.option["SyncFirst"] = ["pacman"]
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pacman|1.0-2")
self.addrule("PKG_EXIST=glibc-awesome")
self.addrule("PKG_VERSION=glibc-awesome|2.13-2")
self.addrule("PKG_EXIST=zlib")

View File

@ -1,25 +0,0 @@
self.description = "Sysupgrade: upgrade pacman being depended on"
sp = pmpkg("pacman", "4.0.1-1")
self.addpkg2db("sync", sp)
sp2 = pmpkg("pyalpm", "2-1")
sp2.depends = ["pacman>=4.0", "pacman<4.1"]
self.addpkg2db("sync", sp2)
lp = pmpkg("pacman", "3.5.4-1")
self.addpkg2db("local", lp)
lp2 = pmpkg("pyalpm", "1-1")
lp2.depends = ["pacman>=3.5", "pacman<3.6"]
self.addpkg2db("local", lp2)
self.option["SyncFirst"] = ["pacman"]
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pacman|4.0.1-1")
self.addrule("PKG_VERSION=pyalpm|2-1")
self.expectfailure = True

View File

@ -1,64 +0,0 @@
self.description = "Sysupgrade: syncfirst with recursive/cascading deps"
sp = pmpkg("pacman", "4.0.1-2")
sp.depends = ["glibc>=2.15", "curl"]
self.addpkg2db("sync", sp)
glibcdep = pmpkg("glibc", "2.15-1")
self.addpkg2db("sync", glibcdep)
gcldep = pmpkg("gcc-libs", "4.6.2-5")
gcldep.depends = ["glibc>=2.14"]
self.addpkg2db("sync", gcldep)
curldep = pmpkg("curl", "7.23.1-2")
curldep.depends = ["openssl"]
self.addpkg2db("sync", curldep)
openssldep = pmpkg("openssl", "1.0.0.e-1")
openssldep.depends = ["perl"]
self.addpkg2db("sync", openssldep)
gccdep = pmpkg("gcc", "4.6.2-5")
gccdep.depends = ["gcc-libs=4.6.2-5"]
self.addpkg2db("sync", gccdep)
perldep = pmpkg("perl", "5.14.2-5")
perldep.depends = ["db"]
self.addpkg2db("sync", perldep)
dbdep = pmpkg("db", "5.2.36-2")
dbdep.depends = ["gcc-libs"]
self.addpkg2db("sync", dbdep)
lp = pmpkg("pacman", "4.0.1-1")
lp.depends = ["glibc>=2.14", "curl"]
self.addpkg2db("local", lp)
lp2 = pmpkg("glibc", "2.14-2")
self.addpkg2db("local", lp2)
lp3 = pmpkg("curl", "7.23.1-2")
self.addpkg2db("local", lp3)
lp4 = pmpkg("gcc-libs", "4.6.2-3")
self.addpkg2db("local", lp4)
lp5 = pmpkg("gcc", "4.6.2-3")
lp5.depends = ["gcc-libs=4.6.2-3"]
self.addpkg2db("local", lp5)
lp6 = pmpkg("perl", "5.14.2-5")
lp6.depends = ["db"]
self.addpkg2db("local", lp6)
lp7 = pmpkg("db", "5.2.36-2")
lp7.depends = ["gcc-libs"]
self.addpkg2db("local", lp7)
self.option["SyncFirst"] = ["pacman"]
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pacman|4.0.1-2")