[pacman-dev] [PATCH] Combine repo-add and repo-remove into one script

Xavier shiningxc at gmail.com
Sat Jun 14 17:04:21 EDT 2008


Dan McGee wrote:
> On Sat, Jun 14, 2008 at 2:10 PM, Xavier<shiningxc at gmail.com>  wrote:
>> Dan McGee wrote:
>>> They shared about 75% of their code, so there is no real reason we should
>>> maintain them separately. Merge the differences accordingly and add a check
>>> based on the basename of the command used to decide what behavior to follow.
>>>
>>> Signed-off-by: Dan McGee<dan at archlinux.org>
>> I loved that idea, but it turned out to be more complicated than I
>> expected and hoped. Especially the fact that we need to do the check
>> (repo-add or repo-remove) several times.
>
> The number of small differences could probably be reduced, but the
> main intention of this patch was just to get it in one script. I would
> guess we could do some things a bit differently, notably the
> test_repo_db_file() part which should not really need to know which
> script is being called. The only other part which might be changeable
> is the "all packages removed" section, which I am not too keen on
> anyway- we are counting on a failure code from ls to get us there.
>

Indeed, reading the script again, these are basically the two places 
that I didn't like much.




More information about the pacman-dev mailing list