[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#639008: Patch

On Sat, Apr 7, 2012 at 12:06, Julian Andres Klode <jak@debian.org> wrote:
> On Fri, Apr 06, 2012 at 01:40:43PM +0300, Bogdan Purcareata wrote:
>> Note to the developers: this patch is more of a proof of concept / personal
>> solution, without changing too much of the official developers' code.
>> Instead of trying to alter or manipulate the already defined objects , I
>> decided to create and use my own. The contributions to the algorithm
>> are minimal.
>> Thank you for your report and for your interest in improving Debian!
>> Bogdan Purcareata
> It would be helpful to include a useful subject rather than a number
> and patch. In any case, I don't see any reason why we should create
> code to sort one list in our output (the list of automatically
> removable packages) while all other lists are not sorted.

While i agree with the first part about a good subject line i disagree
with the sorting. The other lists are sorted as they iterate over a sorted
list of Packages (Cache.List of CacheFile class in cmdline/apt-get.cc).

DoAutoRemove() doesn't do this - but changing this solves only half
the problem: We still have packages we decide only later if they are
going to be removed - or not (or if they could be removed, if we would).

So the solution is to do the first pass in order, record all possible removes,
do whats needed to check if they can be autoremoved and at the end
print the list with all packages in the list which survived the check.

Attached patch should do this. Applies only to experimental as it
uses APT::PackageList to keep an ordered record of packages.

Thanks again Bogdan for the try. APT source includes a lot of stuff and
i think i haven't even told you that much about experimental at all, so
its mentally recorded as positive. After all you tried, produced something
working and even mentioned the disadvantage of the implementation!
The rest is "just" missing experience - something you will get by more
trying and during GSoC - in case your proposal is accepted - of course.
Very few experts fall out of the sky. (Usually they just fall out of bed. ;) )

Best regards

David Kalnischkies

Attachment: apt-639008-alpha-sort-autoremove.diff
Description: Binary data

Reply to: