[pacman-dev] [PATCH 4/4] CLI args: update --help and manpage

Xavier Chantry chantry.xavier at gmail.com
Mon Oct 11 07:34:54 EDT 2010

On Mon, Oct 11, 2010 at 3:30 AM, Allan McRae <allan at archlinux.org> wrote:
> On 11/10/10 05:06, Xavier Chantry wrote:
>> The three parts (help, manpage and code) are now organized in the same
>> way and much easier to compare :
>> - specific options
>> - install/upgrade options for -S and -U
>> - transaction options for -S -R and -U
>> - global options
>> After this re-organization, it was easy to update and sync the three
>> components together. Duplication is also avoided.
>> Signed-off-by: Xavier Chantry<chantry.xavier at gmail.com>
> This had actually been on my TODO list for a while so it is good to see it
> fixed.  Overall, I think these look good.  One small point:
>> ./src/pacman/pacman -D --help
> usage:  lt-pacman {-D --database} <options> <package(s)>
> options:
>      --asdeps         mark packages as non-explicitly installed
>      --asexplicit     mark packages as explicitly installed
>  -b, --dbpath <path>  set an alternate database location
>  -r, --root <path>    set an alternate installation root
>  -v, --verbose        be verbose
>      --arch <arch>    set an alternate architecture
>      --cachedir <dir> set an alternate package cache location
>      --config <path>  set an alternate configuration file
>      --debug          display debug messages
>      --logfile <path> set an alternate log file
>      --noconfirm      do not ask for any confirmation
> On my TODO list, I had also had removing --arch and --cachedir from -D and
> -Q as they are useless options there as far as I can tell.  And --cachedir
> from -U.

I hesitated about arch, but it looked like a general configuration
option that would not hurt even for ops where it is not used.
Same for cachedir.
But also same for ignore, which is also specified in pacman.conf

Jakob actually moved Ignore from just -S operation to global, which is
also specified in pacman.conf
I believe there is a difference between ignore and arch/cachedir :
- arch/cachedir clearly have no impact on -D or -Q, they are just
useless but can be mentioned
- ignore/ignoregroup could have an impact on -D, -Q or -R but they
don't have any, which might not be obvious

That said, I am fine with moving stuff around, I will let Dan have the
final vote on where arch cachedir and ignore should be.

> Slightly related, I wonder if we can shorten the description of "-k,
> --dbonly" and "--print" so they do not loop on an 80 width terminal.  Or
> maybe add some line wrapping.

Well I was looking at french translation, where half the description
do not even fit a 100width terminal, so I don't really care :p

But now that you mention dbonly, is this behavior really fine :
       -k, --dbonly
           Adds/Removes the database entry only, leaves all files in
place. On an
           upgrade operation, the existing package and all files will
be removed and
           the database entry for the new package will be added.

I.E. when -S and -U are upgrade and not install, and they remove the
existing local package, dbonly does not apply to the removal. files
are actually deleted. This is quite weird for a 'dbonly' option, isn't
it ?
What if you want to use 'dbonly' because you modified all the package
files (for example manual make install), but you just want to use and
update the db entry with an arch package. There might be one case
where I could actually need that.
But as it is, dbonly looks quite weird and useless.

the patch would just be 3 lines :

diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index dfaba03..e0099fb 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -311,6 +311,9 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg,
pmpkg_t *newpkg, pmtrans_t *tra
 	_alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)\n",
 			oldpkg->name, oldpkg->version);

+	if(trans->flags & PM_TRANS_FLAG_DBONLY)
+		goto db;
 	/* copy the remove skiplist over */
 	skip_remove =
@@ -345,6 +348,7 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg,
pmpkg_t *newpkg, pmtrans_t *tra

 	/* remove the package from the database */
 	_alpm_log(PM_LOG_DEBUG, "updating database\n");
 	_alpm_log(PM_LOG_DEBUG, "removing database entry '%s'\n", pkgname);

then the help and the description would also be shorter :)

More information about the pacman-dev mailing list