From e654236db6b01d21cff7c850efedff183dd86b61 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 12 Jan 2008 14:51:01 +0100 Subject: don't send CHECKDEPS_DONE event when NODEPS is set. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/remove.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 2f027951..be7b3eda 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -146,7 +146,9 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) _alpm_recursedeps(db, trans->packages, 0); } - EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); + if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { + EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); + } return(0); } -- cgit v1.2.3-2-g168b From 633dbeac88316f71f0f5642b4b8b00cc6d262919 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Thu, 10 Jan 2008 15:33:09 +0100 Subject: small checkdeps speed-up In the old code 'alpm_list_diff(_alpm_db_get_pkgcache(db), dblist, _alpm_pkg_cmp);' was slow. Signed-off-by: Nagy Gabor [Xav: In my opinion, computing both dblist and modified in one for loop also makes the code clearer, besides being more efficient. Also renamed joined to targets since I also find that clearer.] Signed-off-by: Chantry Xavier --- lib/libalpm/deps.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 8d77fd46..8c302b69 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -226,7 +226,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps, alpm_list_t *remove, alpm_list_t *upgrade) { alpm_list_t *i, *j; - alpm_list_t *joined, *dblist; + alpm_list_t *targets, *dblist = NULL, *modified = NULL; alpm_list_t *baddeps = NULL; pmdepmissing_t *miss = NULL; @@ -236,9 +236,16 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps, return(NULL); } - joined = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade)); - dblist = alpm_list_diff(_alpm_db_get_pkgcache(db), joined, _alpm_pkg_cmp); - alpm_list_free(joined); + targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade)); + for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { + void *pkg = i->data; + if(alpm_list_find(targets, pkg, _alpm_pkg_cmp)) { + modified = alpm_list_add(modified, pkg); + } else { + dblist = alpm_list_add(dblist, pkg); + } + } + alpm_list_free(targets); /* look for unsatisfied dependencies of the upgrade list */ for(i = upgrade; i; i = i->next) { @@ -267,9 +274,6 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps, if(reversedeps) { /* reversedeps handles the backwards dependencies, ie, * the packages listed in the requiredby field. */ - - alpm_list_t *modified = alpm_list_diff(_alpm_db_get_pkgcache(db), dblist, _alpm_pkg_cmp); - for(i = dblist; i; i = i->next) { pmpkg_t *lp = i->data; for(j = alpm_pkg_get_depends(lp); j; j = j->next) { @@ -290,8 +294,8 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps, } } } - alpm_list_free(modified); } + alpm_list_free(modified); alpm_list_free(dblist); return(baddeps); -- cgit v1.2.3-2-g168b From 3de21473768c1801833a10a1872ce7612e8edb59 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 12 Jan 2008 21:49:04 +0100 Subject: Fix cvsmod typo in PKGBUILD man page. Fixes FS#9175. Signed-off-by: Chantry Xavier --- doc/PKGBUILD.5.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 86becf4e..3ef9d04e 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -270,7 +270,7 @@ from. *_svntrunk*;; The trunk of the SVN repository. - *_cvsmod*;; + *_svnmod*;; The SVN module to fetch. *Git*:: -- cgit v1.2.3-2-g168b From ab506f77c04a481782d9e53c6a285227f58f5cf7 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sun, 13 Jan 2008 01:55:08 +0100 Subject: util.c : fix segfault when the cachedir isn't usable. For example, if the cachedir is a broken symlink or a non writable directory, pacman fallbacks to /tmp/. Just before doing that, it freed the handle->cachedirs list twice ! once in _alpm_filecache_setup, and once in alpm_option_set_cachedirs. So the first one was removed. Fixes FS#9186. Signed-off-by: Chantry Xavier --- lib/libalpm/util.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 64006d1f..d09b9b14 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -582,9 +582,7 @@ const char *_alpm_filecache_setup(void) } /* we didn't find a valid cache directory. use /tmp. */ - i = alpm_option_get_cachedirs(); tmp = alpm_list_add(NULL, strdup("/tmp/")); - FREELIST(i); alpm_option_set_cachedirs(tmp); _alpm_log(PM_LOG_DEBUG, "using cachedir: %s", "/tmp/\n"); _alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n")); -- cgit v1.2.3-2-g168b From 78e7342c1625f9cba399b89ab58a20599ae12c5a Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sun, 13 Jan 2008 16:46:42 +0100 Subject: zsh_completion : minor fixes. -Qg was handled twice. --ignore completed on all installed packages instead of all packages. --ignoregroup had a special handling that seems unnecessary. It wasn't done for --ignore, and it apparently works fine without anyway. Signed-off-by: Chantry Xavier --- contrib/zsh_completion | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/contrib/zsh_completion b/contrib/zsh_completion index 5ea6c33b..8dec06df 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -49,7 +49,6 @@ _pacman_opts_query_modifiers=( '-c[List package changelog]' '-d[List packages installed as dependencies]' '-e[List packages explicitly installed]' - '-g[List all members of a package group]' '-i[View package information]' '-ii[View package information including backup files]' '-l[List package contents]' @@ -87,8 +86,10 @@ _pacman_opts_sync_modifiers=( '-u[Upgrade all out-of-date packages]' '-w[Download packages only]' '-y[Download fresh package databases]' - '*--ignore[Ignore a package upgrade]:package:_pacman_completions_installed_packages' - '*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups' + '*--ignore[Ignore a package upgrade]:package: + _pacman_completions_all_packages' + '*--ignoregroup[Ignore a group upgrade]:package group: + _pacman_completions_all_groups' '--asdeps[Install packages as non-explicitly installed]' ) @@ -288,17 +289,6 @@ _pacman_get_command() { # main dispatcher _pacman() { - # First check if --ignoregroup was the last command given. If so, complete - # all groups. - if [ "$words[-2]" = "--ignoregroup" ]; then - _arguments -s : \ - "$_pacman_opts_common[@]" \ - "$_pacman_opts_sync_modifiers[@]" \ - '*:package group:_pacman_completions_all_groups' - return 0 - fi - - # Otherwise, complete on the given command. case $words[2] in -A*) _pacman_action_add ;; -Q*g*) # ipkg groups @@ -307,7 +297,7 @@ _pacman() { "$_pacman_opts_query_modifiers[@]" \ '*:groups:_pacman_completions_installed_groups' ;; - -Q*o*) # file *.pkg.tar.gz + -Q*o*) # file _arguments -s : \ "$_pacman_opts_common[@]" \ "$_pacman_opts_query_modifiers[@]" \ -- cgit v1.2.3-2-g168b From 47e8dd0670f14ae2a1efe25fc920d1d46cdec586 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 1 Jan 2008 17:01:52 +1000 Subject: Notify of package replacements when using noconfirm Fixes FS#5179. Prints a notification of package replacements when updating the packages using the --noconfirm flag. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- src/pacman/callback.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index dddbc275..9742d7f0 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -278,11 +278,19 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2, *response = yesno(str); break; case PM_TRANS_CONV_REPLACE_PKG: - snprintf(str, LOG_STR_LEN, _(":: Replace %s with %s/%s? [Y/n] "), - alpm_pkg_get_name(data1), - (char *)data3, - alpm_pkg_get_name(data2)); - *response = yesno(str); + if(!config->noconfirm) { + snprintf(str, LOG_STR_LEN, _(":: Replace %s with %s/%s? [Y/n] "), + alpm_pkg_get_name(data1), + (char *)data3, + alpm_pkg_get_name(data2)); + *response = yesno(str); + } else { + printf(_("Replacing %s with %s/%s\n."), + alpm_pkg_get_name(data1), + (char *)data3, + alpm_pkg_get_name(data2)); + *response = 1; + } break; case PM_TRANS_CONV_CONFLICT_PKG: snprintf(str, LOG_STR_LEN, _(":: %s conflicts with %s. Remove %s? [Y/n] "), -- cgit v1.2.3-2-g168b From bbe02ec57fd56670dfe0bc08d981ce8a1aa31370 Mon Sep 17 00:00:00 2001 From: Travis Willard Date: Sun, 13 Jan 2008 07:42:40 -0500 Subject: Update Gensync and Updatesync to use new PKGEXT variable Previously, this caused both scripts to look for pkgname-pkgver-pkgrel-arch..pkg.tar.gz - extra period has been removed. Fixes FS#9190. Signed-off-by: Travis Willard Signed-off-by: Dan McGee --- scripts/gensync.sh.in | 6 +++--- scripts/updatesync.sh.in | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/gensync.sh.in b/scripts/gensync.sh.in index b49c26ee..04f80022 100644 --- a/scripts/gensync.sh.in +++ b/scripts/gensync.sh.in @@ -130,13 +130,13 @@ for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do CARCH='any' fi if [ "$pkgdir" != "" ]; then - pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-$CARCH.$PKGEXT" + pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}" else - pkgfile="$destdir/$pkgname-$pkgver-$pkgrel-$CARCH.$PKGEXT" + pkgfile="$destdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}" fi if [ ! -f "$pkgfile" ]; then - error "$(gettext "could not find %s-%s-%s-%s.%s - skipping")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT + error "$(gettext "could not find %s-%s-%s-%s%s - skipping")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT else if check_force; then forcepkgs="$forcepkgs $pkgfile" diff --git a/scripts/updatesync.sh.in b/scripts/updatesync.sh.in index 2e47ac94..900f11f3 100644 --- a/scripts/updatesync.sh.in +++ b/scripts/updatesync.sh.in @@ -127,10 +127,10 @@ if [ "$action" = "upd" ]; then # INSERT / UPDATE if [ "$arch" = 'any' ]; then CARCH='any' fi - pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-$CARCH.$PKGEXT" + pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}" if [ ! -f "$pkgfile" ]; then - die "$(gettext "could not find %s-%s-%s-%s.%s - aborting")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT + die "$(gettext "could not find %s-%s-%s-%s%s - aborting")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT fi if check_force; then -- cgit v1.2.3-2-g168b