[pacman-dev] [PATCH] alpm_list_add == alpm_list_add_last I: recursedeps clean-up
Hi! Patch attached. See the patch description for details. Bye, ngaba ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
On Nov 14, 2007 6:18 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
Hi! Patch attached. See the patch description for details. Bye, ngaba
Seems OK to me, anyone else see anything weird here? I've applied it locally. <http://code.toofishes.net/gitweb.cgi?p=pacman.git;a=commitdiff;h=64bab41ecc1f795433fd1a3e5e74e7d018565ffa> Nagy- two small favors to ask of you for future patches. And this is really for anyone on the list, but I just noticed it here: 1. git-am likes it a lot better if you format your commit message with the subject, then a *blank line* (not just a newline), and then the commit message. 2. Can you please try to use punctuation where it seems appropritate? I'm fine with having to fix up some English usage stuff, but punctuation makes it easier for us all to read the first time around. This applies to both commit messages and comments in the code (such as the doxygen comment in this patch). -Dan
On Wed, Nov 14, 2007 at 08:01:50AM -0600, Dan McGee wrote:
On Nov 14, 2007 6:18 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
Hi! Patch attached. See the patch description for details. Bye, ngaba
Seems OK to me, anyone else see anything weird here? I've applied it locally. <http://code.toofishes.net/gitweb.cgi?p=pacman.git;a=commitdiff;h=64bab41ecc1f795433fd1a3e5e74e7d018565ffa>
I made two little comments (about comments, not code), you already fixed one of them.
On Wed, Nov 14, 2007 at 01:18:28PM +0100, Nagy Gabor wrote:
Subject: [PATCH] alpm_list_add == alpm_list_add_last I: recursedeps clean-up It's time to _define_ that alpm_list_add(list, foo) adds 'foo' to the end of 'list' and returns with 'list', because: 1. list is a list, not a set 2. sortbydeps _needs_ an alpm_list_add _definition_ to work properly
As a first step, I used this definition in recursedeps
There are several other places where this assumption is made, so I guess it's alright.. The last one I saw is in the groups handling of the -S operation, in src/pacman/sync.c , lines 500-520. So shouldn't it be commented in alpm_list.c itself?
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index cefffe5..5040fbf 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -596,12 +596,13 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets, * @brief Adds unneeded dependencies to an existing list of packages. * By unneeded, we mean dependencies that are only required by packages in the * target list, so they can be safely removed. + * If the input list was topo sorted, the output list will be topo sorted too * * @param db package database to do dependency tracing in * @param *targs pointer to a list of packages * @param include_explicit if 0, explicitly installed packages are not included */
And if it isn't topo sorted, then what happens? Shouldn't the comment rather be something like : The targets list must be topo sorted, and will stay topo sorted.
And if it isn't topo sorted, then what happens? Shouldn't the comment rather be something like : The targets list must be topo sorted, and will stay topo sorted. No. The input list _needn't_ be topo sorted; the algorithm works always (but of course if the input list is not topo sorted, then the output list won't be topo sorted neither). Bye
---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
On Wed, Nov 14, 2007 at 03:50:37PM +0100, Nagy Gabor wrote:
And if it isn't topo sorted, then what happens? Shouldn't the comment rather be something like : The targets list must be topo sorted, and will stay topo sorted. No. The input list _needn't_ be topo sorted; the algorithm works always
Ok, it looks like you are right. I don't know why I get always confused by this. Sorry.
participants (3)
-
Dan McGee
-
Nagy Gabor
-
Xavier