FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 02-14-2012, 07:30 PM
Dan McGee
 
Default Remove SyncFirst option

This has outlived its usefulness and causes more problems than it
solves.

Signed-off-by: Dan McGee <dan@archlinux.org>
---

This is an RFC first of all, so please feel free to comment.

Pros:
1. Removes complexity and a fair amount of code.
2. Removes the hack necesary for download-only and print operations.
3. Closes at least two bug reports.
4. Pacman is now much more resiliant to updates to itself since vercmp is
statically linked, etc. so updating it alone isn't always necessary.

Cons:
1. If a major underlying change occurs (such as a new compression format),
users would need to update pacman explicitly first.
2. ???

doc/pacman.conf.5.txt | 9 -----
etc/pacman.conf.in | 2 -
src/pacman/conf.c | 3 +-
src/pacman/conf.h | 1 -
src/pacman/sync.c | 55 +---------------------------------
test/pacman/README | 1 -
test/pacman/tests/sync301.py | 27 -----------------
test/pacman/tests/sync302.py | 49 ------------------------------
test/pacman/tests/sync303.py | 38 -----------------------
test/pacman/tests/sync304.py | 27 -----------------
test/pacman/tests/sync305.py | 67 ------------------------------------------
11 files changed, 2 insertions(+), 277 deletions(-)
delete mode 100644 test/pacman/tests/sync301.py
delete mode 100644 test/pacman/tests/sync302.py
delete mode 100644 test/pacman/tests/sync303.py
delete mode 100644 test/pacman/tests/sync304.py
delete mode 100644 test/pacman/tests/sync305.py

diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt
index 3913292..a9c5db3 100644
--- a/doc/pacman.conf.5.txt
+++ b/doc/pacman.conf.5.txt
@@ -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
diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in
index 7f9db1b..4c72724 100644
--- a/etc/pacman.conf.in
+++ b/etc/pacman.conf.in
@@ -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
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index bfa8cad..e03df36 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -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);
@@ -423,7 +422,7 @@ static int _parse_options(const char *key, char *value,
} else if(strcmp(key, "HoldPkg") == 0) {
setrepeatingoption(value, "HoldPkg", &(config->holdpkg));
} else if(strcmp(key, "SyncFirst") == 0) {
- setrepeatingoption(value, "SyncFirst", &(config->syncfirst));
+ /* old option, do nothing */
} else if(strcmp(key, "CacheDir") == 0) {
setrepeatingoption(value, "CacheDir", &(config->cachedirs));
} else if(strcmp(key, "Architecture") == 0) {
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 481132f..9b6ab20 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -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;
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 700bb78..612cd5f 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -549,26 +549,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;
@@ -959,40 +939,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 :
"));
- list_display(" ", packages);
- if(yesno(_(":: Do you want to cancel the current operation
"
- ":: and upgrade these packages now?"))) {
- FREELIST(targs);
- targs = packages;
- config->flags = 0;
- config->flags |= ALPM_TRANS_FLAG_RECURSE;
- config->flags |= ALPM_TRANS_FLAG_NEEDED;
- config->op_s_upgrade = 0;
- } else {
- FREELIST(packages);
- }
- printf("
");
- } else {
- pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog
");
- FREELIST(packages);
- }
- }
- }
-
- int ret = sync_trans(targs);
- FREELIST(targs);
-
- return ret;
+ return sync_trans(targets);
}

/* vim: set ts=2 sw=2 noet: */
diff --git a/test/pacman/README b/test/pacman/README
index a3c36fc..ae3303a 100644
--- a/test/pacman/README
+++ b/test/pacman/README
@@ -108,7 +108,6 @@ is not necessarily complete:
- HoldPkg
- IgnorePkg
- IgnoreGroup
- - SyncFirst
- NoExtract
- NoUpgrade
- XferCommand
diff --git a/test/pacman/tests/sync301.py b/test/pacman/tests/sync301.py
deleted file mode 100644
index 96402fc..0000000
--- a/test/pacman/tests/sync301.py
+++ /dev/null
@@ -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")
diff --git a/test/pacman/tests/sync302.py b/test/pacman/tests/sync302.py
deleted file mode 100644
index b44aaed..0000000
--- a/test/pacman/tests/sync302.py
+++ /dev/null
@@ -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_EXIST=pacman")
-self.addrule("PKG_VERSION=pacman|1.0-2")
-self.addrule("PKG_EXIST=glibc")
-self.addrule("PKG_VERSION=glibc|2.15-1")
-self.addrule("PKG_EXIST=curl")
-self.addrule("PKG_VERSION=curl|7.22-1")
-self.addrule("PKG_EXIST=libarchive")
-self.addrule("PKG_VERSION=libarchive|2.8.5-1")
-self.addrule("PKG_EXIST=zlib")
diff --git a/test/pacman/tests/sync303.py b/test/pacman/tests/sync303.py
deleted file mode 100644
index b717dd2..0000000
--- a/test/pacman/tests/sync303.py
+++ /dev/null
@@ -1,38 +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_EXIST=pacman")
-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")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/sync304.py b/test/pacman/tests/sync304.py
deleted file mode 100644
index 4ac1a01..0000000
--- a/test/pacman/tests/sync304.py
+++ /dev/null
@@ -1,27 +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_EXIST=pacman")
-self.addrule("PKG_VERSION=pacman|4.0.1-1")
-self.addrule("PKG_EXIST=pyalpm")
-self.addrule("PKG_VERSION=pyalpm|2-1")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/sync305.py b/test/pacman/tests/sync305.py
deleted file mode 100644
index 24fcee4..0000000
--- a/test/pacman/tests/sync305.py
+++ /dev/null
@@ -1,67 +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_EXIST=pacman")
-self.addrule("PKG_VERSION=pacman|4.0.1-2")
-
-self.expectfailure = True
--
1.7.9
 
Old 02-14-2012, 09:08 PM
Dave Reisner
 
Default Remove SyncFirst option

On Tue, Feb 14, 2012 at 02:30:06PM -0600, Dan McGee wrote:
> This has outlived its usefulness and causes more problems than it
> solves.
>
> Signed-off-by: Dan McGee <dan@archlinux.org>
> ---
>
> This is an RFC first of all, so please feel free to comment.
>
> Pros:
> 1. Removes complexity and a fair amount of code.
> 2. Removes the hack necesary for download-only and print operations.
> 3. Closes at least two bug reports.
> 4. Pacman is now much more resiliant to updates to itself since vercmp is
> statically linked, etc. so updating it alone isn't always necessary.
>
> Cons:
> 1. If a major underlying change occurs (such as a new compression format),
> users would need to update pacman explicitly first.
> 2. ???

Just to be a jerk... Suppose the following:

- The fabled keyring package exists. Life is awesome.
- I go insane and have to be forcefully removed from the dev team, and
my packaging key needs to be blacklisted. Alternatively, I'm off on
vacation and my desktop+gpg key is compromised. Same end effect.
- It's assumed that a number of the packages that I maintain are now
highly suspect and should NOT be installed.

In this case, SyncFirst seems like the only way to make sure that people
are safe from the rootkits that are infecting my packages.

> doc/pacman.conf.5.txt | 9 -----
> etc/pacman.conf.in | 2 -
> src/pacman/conf.c | 3 +-
> src/pacman/conf.h | 1 -
> src/pacman/sync.c | 55 +---------------------------------
> test/pacman/README | 1 -
> test/pacman/tests/sync301.py | 27 -----------------
> test/pacman/tests/sync302.py | 49 ------------------------------
> test/pacman/tests/sync303.py | 38 -----------------------
> test/pacman/tests/sync304.py | 27 -----------------
> test/pacman/tests/sync305.py | 67 ------------------------------------------
> 11 files changed, 2 insertions(+), 277 deletions(-)
> delete mode 100644 test/pacman/tests/sync301.py
> delete mode 100644 test/pacman/tests/sync302.py
> delete mode 100644 test/pacman/tests/sync303.py
> delete mode 100644 test/pacman/tests/sync304.py
> delete mode 100644 test/pacman/tests/sync305.py
>
> diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt
> index 3913292..a9c5db3 100644
> --- a/doc/pacman.conf.5.txt
> +++ b/doc/pacman.conf.5.txt
> @@ -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
> diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in
> index 7f9db1b..4c72724 100644
> --- a/etc/pacman.conf.in
> +++ b/etc/pacman.conf.in
> @@ -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
> diff --git a/src/pacman/conf.c b/src/pacman/conf.c
> index bfa8cad..e03df36 100644
> --- a/src/pacman/conf.c
> +++ b/src/pacman/conf.c
> @@ -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);
> @@ -423,7 +422,7 @@ static int _parse_options(const char *key, char *value,
> } else if(strcmp(key, "HoldPkg") == 0) {
> setrepeatingoption(value, "HoldPkg", &(config->holdpkg));
> } else if(strcmp(key, "SyncFirst") == 0) {
> - setrepeatingoption(value, "SyncFirst", &(config->syncfirst));
> + /* old option, do nothing */
> } else if(strcmp(key, "CacheDir") == 0) {
> setrepeatingoption(value, "CacheDir", &(config->cachedirs));
> } else if(strcmp(key, "Architecture") == 0) {
> diff --git a/src/pacman/conf.h b/src/pacman/conf.h
> index 481132f..9b6ab20 100644
> --- a/src/pacman/conf.h
> +++ b/src/pacman/conf.h
> @@ -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;
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index 700bb78..612cd5f 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -549,26 +549,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;
> @@ -959,40 +939,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 :
"));
> - list_display(" ", packages);
> - if(yesno(_(":: Do you want to cancel the current operation
"
> - ":: and upgrade these packages now?"))) {
> - FREELIST(targs);
> - targs = packages;
> - config->flags = 0;
> - config->flags |= ALPM_TRANS_FLAG_RECURSE;
> - config->flags |= ALPM_TRANS_FLAG_NEEDED;
> - config->op_s_upgrade = 0;
> - } else {
> - FREELIST(packages);
> - }
> - printf("
");
> - } else {
> - pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog
");
> - FREELIST(packages);
> - }
> - }
> - }
> -
> - int ret = sync_trans(targs);
> - FREELIST(targs);
> -
> - return ret;
> + return sync_trans(targets);
> }
>
> /* vim: set ts=2 sw=2 noet: */
> diff --git a/test/pacman/README b/test/pacman/README
> index a3c36fc..ae3303a 100644
> --- a/test/pacman/README
> +++ b/test/pacman/README
> @@ -108,7 +108,6 @@ is not necessarily complete:
> - HoldPkg
> - IgnorePkg
> - IgnoreGroup
> - - SyncFirst
> - NoExtract
> - NoUpgrade
> - XferCommand
> diff --git a/test/pacman/tests/sync301.py b/test/pacman/tests/sync301.py
> deleted file mode 100644
> index 96402fc..0000000
> --- a/test/pacman/tests/sync301.py
> +++ /dev/null
> @@ -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")
> diff --git a/test/pacman/tests/sync302.py b/test/pacman/tests/sync302.py
> deleted file mode 100644
> index b44aaed..0000000
> --- a/test/pacman/tests/sync302.py
> +++ /dev/null
> @@ -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_EXIST=pacman")
> -self.addrule("PKG_VERSION=pacman|1.0-2")
> -self.addrule("PKG_EXIST=glibc")
> -self.addrule("PKG_VERSION=glibc|2.15-1")
> -self.addrule("PKG_EXIST=curl")
> -self.addrule("PKG_VERSION=curl|7.22-1")
> -self.addrule("PKG_EXIST=libarchive")
> -self.addrule("PKG_VERSION=libarchive|2.8.5-1")
> -self.addrule("PKG_EXIST=zlib")
> diff --git a/test/pacman/tests/sync303.py b/test/pacman/tests/sync303.py
> deleted file mode 100644
> index b717dd2..0000000
> --- a/test/pacman/tests/sync303.py
> +++ /dev/null
> @@ -1,38 +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_EXIST=pacman")
> -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")
> -
> -self.expectfailure = True
> diff --git a/test/pacman/tests/sync304.py b/test/pacman/tests/sync304.py
> deleted file mode 100644
> index 4ac1a01..0000000
> --- a/test/pacman/tests/sync304.py
> +++ /dev/null
> @@ -1,27 +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_EXIST=pacman")
> -self.addrule("PKG_VERSION=pacman|4.0.1-1")
> -self.addrule("PKG_EXIST=pyalpm")
> -self.addrule("PKG_VERSION=pyalpm|2-1")
> -
> -self.expectfailure = True
> diff --git a/test/pacman/tests/sync305.py b/test/pacman/tests/sync305.py
> deleted file mode 100644
> index 24fcee4..0000000
> --- a/test/pacman/tests/sync305.py
> +++ /dev/null
> @@ -1,67 +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_EXIST=pacman")
> -self.addrule("PKG_VERSION=pacman|4.0.1-2")
> -
> -self.expectfailure = True
> --
> 1.7.9
>
>
 
Old 02-15-2012, 05:34 AM
Pierre Schmitz
 
Default Remove SyncFirst option

Am 14.02.2012 23:08, schrieb Dave Reisner:
> On Tue, Feb 14, 2012 at 02:30:06PM -0600, Dan McGee wrote:
>> This has outlived its usefulness and causes more problems than it
>> solves.
>>
>> Signed-off-by: Dan McGee <dan@archlinux.org>
>> ---
>>
>> This is an RFC first of all, so please feel free to comment.
>>
>> Pros:
>> 1. Removes complexity and a fair amount of code.
>> 2. Removes the hack necesary for download-only and print operations.
>> 3. Closes at least two bug reports.
>> 4. Pacman is now much more resiliant to updates to itself since vercmp is
>> statically linked, etc. so updating it alone isn't always necessary.
>>
>> Cons:
>> 1. If a major underlying change occurs (such as a new compression format),
>> users would need to update pacman explicitly first.
>> 2. ???
>
> Just to be a jerk... Suppose the following:
>
> - The fabled keyring package exists. Life is awesome.
> - I go insane and have to be forcefully removed from the dev team, and
> my packaging key needs to be blacklisted. Alternatively, I'm off on
> vacation and my desktop+gpg key is compromised. Same end effect.
> - It's assumed that a number of the packages that I maintain are now
> highly suspect and should NOT be installed.
>
> In this case, SyncFirst seems like the only way to make sure that people
> are safe from the rootkits that are infecting my packages.

SyncFirst wont help if I am able to sign malicious packages: I'll just
sign my own keyring package. I don't think there is any automatic method
to guarantee a secure update once a signing keys has been compromised.
(This is also why https and OCSP just cannot work; esp. when the
attacker owns the network)

Anyway: I think it'll be a good idea to remove the SyncFirst feature as
it indeed introduces some strange side effects. For some of them we
abused some versioned deps from the pacman package. But one result is
that your system might be in an inconsistent stage after the SyncFirst
run.

I don't think we need to be afraid about having the user to perform
some potential manual steps on major updates.

Greetings,

Pierre

--
Pierre Schmitz, http://pierre-schmitz.com
 
Old 02-15-2012, 11:57 AM
Lukas Fleischer
 
Default Remove SyncFirst option

On Wed, Feb 15, 2012 at 07:34:54AM +0100, Pierre Schmitz wrote:
> Am 14.02.2012 23:08, schrieb Dave Reisner:
> > On Tue, Feb 14, 2012 at 02:30:06PM -0600, Dan McGee wrote:
> >> This has outlived its usefulness and causes more problems than it
> >> solves.
> >>
> >> Signed-off-by: Dan McGee <dan@archlinux.org>
> >> ---
> >>
> >> This is an RFC first of all, so please feel free to comment.
> >>
> >> Pros:
> >> 1. Removes complexity and a fair amount of code.
> >> 2. Removes the hack necesary for download-only and print operations.
> >> 3. Closes at least two bug reports.
> >> 4. Pacman is now much more resiliant to updates to itself since vercmp is
> >> statically linked, etc. so updating it alone isn't always necessary.
> >>
> >> Cons:
> >> 1. If a major underlying change occurs (such as a new compression format),
> >> users would need to update pacman explicitly first.
> >> 2. ???
> >
> > Just to be a jerk... Suppose the following:
> >
> > - The fabled keyring package exists. Life is awesome.
> > - I go insane and have to be forcefully removed from the dev team, and
> > my packaging key needs to be blacklisted. Alternatively, I'm off on
> > vacation and my desktop+gpg key is compromised. Same end effect.
> > - It's assumed that a number of the packages that I maintain are now
> > highly suspect and should NOT be installed.
> >
> > In this case, SyncFirst seems like the only way to make sure that people
> > are safe from the rootkits that are infecting my packages.
>
> SyncFirst wont help if I am able to sign malicious packages: I'll just
> sign my own keyring package. I don't think there is any automatic method
> to guarantee a secure update once a signing keys has been compromised.
> (This is also why https and OCSP just cannot work; esp. when the
> attacker owns the network)

No, there isn't. Another problem is that there will always be some kind
of delay before we notice that a key is compromised. Anyone doing a
system update during this delay time will possibly be affected by
malicious packages. I think that Dave is/was talking about reducing the
delay by enforcing a new keyring package after we removed the malicious
user from our "authorized_keys", though. If there's no way to enforce
and prioritize such an package, all systems continue to be affected
until we finished following steps:

* Revoke that developer's/TU's SSH access.

* Push a new keyring package (any systems that didn't pull in malicious
packages yet would be safe from now on if we "SyncFirst" the keyring
package).

* Add a big warning to our front page.

* Review all recent commits of that user in detail (and/or revert all or
some of them, depending on how consistent and systematical we want to
be).

* Rebuild all packages signed with the compromised key.

* Add another big warning to our front page recommending everyone, who
updated their system recently, to reinstall everything and restore
data from an older backup.

There might be other solutions than "SyncFirst" but it's a good idea to
discuss this before it is "too late"...

>
> Anyway: I think it'll be a good idea to remove the SyncFirst feature as
> it indeed introduces some strange side effects. For some of them we
> abused some versioned deps from the pacman package. But one result is
> that your system might be in an inconsistent stage after the SyncFirst
> run.
>
> I don't think we need to be afraid about having the user to perform
> some potential manual steps on major updates.
>
> Greetings,
>
> Pierre
>
> --
> Pierre Schmitz, http://pierre-schmitz.com
 
Old 02-15-2012, 12:56 PM
Dan McGee
 
Default Remove SyncFirst option

On Tue, Feb 14, 2012 at 4:08 PM, Dave Reisner <d@falconindy.com> wrote:
> On Tue, Feb 14, 2012 at 02:30:06PM -0600, Dan McGee wrote:
>> This has outlived its usefulness and causes more problems than it
>> solves.
>>
>> Signed-off-by: Dan McGee <dan@archlinux.org>
>> ---
>>
>> This is an RFC first of all, so please feel free to comment.
>>
>> Pros:
>> 1. Removes complexity and a fair amount of code.
>> 2. Removes the hack necesary for download-only and print operations.
>> 3. Closes at least two bug reports.
>> 4. Pacman is now much more resiliant to updates to itself since vercmp is
>> * *statically linked, etc. so updating it alone isn't always necessary.
>>
>> Cons:
>> 1. If a major underlying change occurs (such as a new compression format),
>> * *users would need to update pacman explicitly first.
>> 2. ???
>
> Just to be a jerk... Suppose the following:
>
> - The fabled keyring package exists. Life is awesome.
> - I go insane and have to be forcefully removed from the dev team, and
> *my packaging key needs to be blacklisted. Alternatively, I'm off on
> *vacation and my desktop+gpg key is compromised. Same end effect.
> - It's assumed that a number of the packages that I maintain are now
> *highly suspect and should NOT be installed.
>
> In this case, SyncFirst seems like the only way to make sure that people
> are safe from the rootkits that are infecting my packages.

Another alternative that came to me this morning, that even means we
don't really need to rename the option, only re-document it. What if
SyncFirst simply moved packages to the top of the targets list by
default? Since right now we simply keep targets in alphabetical order
(outside of necessary dependency reordering), what if being in
SyncFirst gave you a free ticket to the head of the line?

If one kept pacman in SyncFirst, it would get pulled up, and then via
dep reordering, would be behind only the packages it depends on, which
is kind of what we have wanted all along, except now we continue to
install everything else as well. If someone was silly enough to
interrupt the sync operation, there is a slightly smaller chance they
leave themselves in a bad situation.

-Dan
 
Old 02-15-2012, 01:14 PM
Seblu
 
Default Remove SyncFirst option

On Wed, Feb 15, 2012 at 2:56 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Tue, Feb 14, 2012 at 4:08 PM, Dave Reisner <d@falconindy.com> wrote:
>> On Tue, Feb 14, 2012 at 02:30:06PM -0600, Dan McGee wrote:
>>> This has outlived its usefulness and causes more problems than it
>>> solves.
>>>
>>> Signed-off-by: Dan McGee <dan@archlinux.org>
>>> ---
>>>
>>> This is an RFC first of all, so please feel free to comment.
>>>
>>> Pros:
>>> 1. Removes complexity and a fair amount of code.
>>> 2. Removes the hack necesary for download-only and print operations.
>>> 3. Closes at least two bug reports.
>>> 4. Pacman is now much more resiliant to updates to itself since vercmp is
>>> * *statically linked, etc. so updating it alone isn't always necessary.
>>>
>>> Cons:
>>> 1. If a major underlying change occurs (such as a new compression format),
>>> * *users would need to update pacman explicitly first.
>>> 2. ???
>>
>> Just to be a jerk... Suppose the following:
>>
>> - The fabled keyring package exists. Life is awesome.
>> - I go insane and have to be forcefully removed from the dev team, and
>> *my packaging key needs to be blacklisted. Alternatively, I'm off on
>> *vacation and my desktop+gpg key is compromised. Same end effect.
>> - It's assumed that a number of the packages that I maintain are now
>> *highly suspect and should NOT be installed.
>>
>> In this case, SyncFirst seems like the only way to make sure that people
>> are safe from the rootkits that are infecting my packages.
>
> Another alternative that came to me this morning, that even means we
> don't really need to rename the option, only re-document it. What if
> SyncFirst simply moved packages to the top of the targets list by
> default? Since right now we simply keep targets in alphabetical order
> (outside of necessary dependency reordering), what if being in
> SyncFirst gave you a free ticket to the head of the line?
>
> If one kept pacman in SyncFirst, it would get pulled up, and then via
> dep reordering, would be behind only the packages it depends on, which
> is kind of what we have wanted all along, except now we continue to
> install everything else as well. If someone was silly enough to
> interrupt the sync operation, there is a slightly smaller chance they
> leave themselves in a bad situation.
>
What would be the interest of doing this?

SyncFirst is useful to force some update to be completed before
upgrade the remaining packages and pacman be run again.

Currently, pacman is in syncfirst, as we want pacman be up-to-date
before installing new packages. With this new behaviour, add pacman in
syncfirst, will change something?
All packages will be upgraded with old pacman and next upgrade will be
done with new one. What is the purpose of ordering in the package
list?

Regards,

--
Sébastien Luttringer
www.seblu.net
 
Old 02-16-2012, 08:31 PM
Nagy Gabor
 
Default Remove SyncFirst option

This has outlived its usefulness and causes more problems than it
solves.

Signed-off-by: Dan McGee <dan@archlinux.org>
---

This is an RFC first of all, so please feel free to comment.

Pros:
1. Removes complexity and a fair amount of code.
2. Removes the hack necesary for download-only and print operations.
3. Closes at least two bug reports.
4. Pacman is now much more resiliant to updates to itself since vercmp is
statically linked, etc. so updating it alone isn't always necessary.

Cons:
1. If a major underlying change occurs (such as a new compression format),
users would need to update pacman explicitly first.
2. ???


Well, I don't really like SyncFirst neither, but if we don't want to
maintain a "package manager from the garage", something like SyncFirst
is needed imho. Personally I don't like news in www.archlinux.org
about pacman limitations (please manually do this and this), and
removing SyncFirst could increase the number of such news.


Btw, maybe this whole SyncFirst concept is an overkill. What we really
need is in fact some kind of "database trigger", which can be recorded
in sync db. Something like this: if(local_version(pacman)<=3.5) then
syncfirst(pacman), otherwise the database changes can cause some
(serious) headaches. I would be happy if "manual intervention
required" www news could be printed by pacman in the future somehow in
a similar way. Of course, this way is also hackish...


But I am fine with the current (buggy?) implementation, too. I haven't
run into any of its bugs yet. If someone doesn't like SyncFirst, he
can press no to the syncfirst question.


I can also see that if we want to make a bug-free syncfirst, the code
becomes more and more complicated:
1. First of all syncfirst = gtk2 makes no sense (result: dangerous
partial upgrade). We only need to syncfirst pacman. (In an optimal
world, the new version of pacman would be automatically run to perform
the requested operation to avoid partial upgrade. Unfortunately, even
the pacman syntax can be changed in a major upgrade.)
2. I don't think that "third-party-package-manager needs
pacman<=3.5.0" bug is a serious one (sync304.py). It can be fixed
(reverse dependencies), or just simply ask users to put
third-party-package-manager to SyncFirst, contradicting my comment in
1. But the more syncfirst packages, the more transaction interruption.
(In this logic, pacman will first upgrade all the package managers
installed to the system.) The conflict problem (sync303.py) is appears
with --noconfirm only, right?
3. sync305.py is a tougher bug. Only reversedeps resolution, "fallback
to original transaction" or a packager-trick could help here.


Summary of my opinion: We can live without SyncFirst, the code would
become simpler, but then we have to be careful with database/pacman upgrades.
And imho the developer->users communication needs some modernization,
too; maybe that is the simpler solution.


NG

------------------------------------------------------
SZTE Klebelsberg Konyvtar - http://www.bibl.u-szeged.hu
This message was sent using IMP: http://horde.org/imp/
 
Old 04-12-2012, 01:47 AM
Allan McRae
 
Default Remove SyncFirst option

The SyncFirst option has caused more trouble than it is worth. 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.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
doc/pacman.conf.5.txt | 9 ------
etc/pacman.conf.in | 2 --
src/pacman/conf.c | 3 --
src/pacman/conf.h | 1 -
src/pacman/sync.c | 47 -------------------------------
test/pacman/README | 1 -
test/pacman/tests/sync301.py | 27 ------------------
test/pacman/tests/sync302.py | 49 --------------------------------
test/pacman/tests/sync303.py | 35 -----------------------
test/pacman/tests/sync304.py | 25 -----------------
test/pacman/tests/sync305.py | 64 ------------------------------------------
11 files changed, 263 deletions(-)
delete mode 100644 test/pacman/tests/sync301.py
delete mode 100644 test/pacman/tests/sync302.py
delete mode 100644 test/pacman/tests/sync303.py
delete mode 100644 test/pacman/tests/sync304.py
delete mode 100644 test/pacman/tests/sync305.py

diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt
index 3913292..a9c5db3 100644
--- a/doc/pacman.conf.5.txt
+++ b/doc/pacman.conf.5.txt
@@ -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
diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in
index 7f9db1b..4c72724 100644
--- a/etc/pacman.conf.in
+++ b/etc/pacman.conf.in
@@ -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
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index b3e6f2c..2fffd92 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -73,7 +73,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);
@@ -453,8 +452,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) {
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 95b2305..7fc15b3 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -86,7 +86,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;
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 9c17f45..fd8df10 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -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;
@@ -1002,33 +982,6 @@ 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 :
"));
- list_display(" ", packages, getcols(fileno(stdout)));
- if(yesno(_(":: Do you want to cancel the current operation
"
- ":: and upgrade these packages now?"))) {
- FREELIST(targs);
- targs = packages;
- config->flags = 0;
- config->op_s_upgrade = 0;
- } else {
- FREELIST(packages);
- }
- printf("
");
- } else {
- pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog
");
- FREELIST(packages);
- }
- }
- }
-
int ret = sync_trans(targs);
FREELIST(targs);

diff --git a/test/pacman/README b/test/pacman/README
index a3c36fc..ae3303a 100644
--- a/test/pacman/README
+++ b/test/pacman/README
@@ -108,7 +108,6 @@ is not necessarily complete:
- HoldPkg
- IgnorePkg
- IgnoreGroup
- - SyncFirst
- NoExtract
- NoUpgrade
- XferCommand
diff --git a/test/pacman/tests/sync301.py b/test/pacman/tests/sync301.py
deleted file mode 100644
index 96402fc..0000000
--- a/test/pacman/tests/sync301.py
+++ /dev/null
@@ -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")
diff --git a/test/pacman/tests/sync302.py b/test/pacman/tests/sync302.py
deleted file mode 100644
index 78e45c3..0000000
--- a/test/pacman/tests/sync302.py
+++ /dev/null
@@ -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")
diff --git a/test/pacman/tests/sync303.py b/test/pacman/tests/sync303.py
deleted file mode 100644
index 9d7bab5..0000000
--- a/test/pacman/tests/sync303.py
+++ /dev/null
@@ -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")
diff --git a/test/pacman/tests/sync304.py b/test/pacman/tests/sync304.py
deleted file mode 100644
index 18058c9..0000000
--- a/test/pacman/tests/sync304.py
+++ /dev/null
@@ -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
diff --git a/test/pacman/tests/sync305.py b/test/pacman/tests/sync305.py
deleted file mode 100644
index 62005b5..0000000
--- a/test/pacman/tests/sync305.py
+++ /dev/null
@@ -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")
--
1.7.10
 

Thread Tools




All times are GMT. The time now is 01:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org