FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-25-2011, 09:16 PM
Dan McGee
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
> There were not added to the end of the list as that would mean
> splitting the single gettext string that contains -f and the
> "see the man page" message, and I wanted to do as little string
> damage as possible.

Do string damage, it is a major release. But more importantly,
repo-remove --help is going to show these and we might want to try and
avoid that- I think the reason they weren't added here.

> Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
> ---
> *scripts/repo-add.sh.in | * *5 +++++
> *1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
> index 9b57ba7..3d6d0c7 100644
> --- a/scripts/repo-add.sh.in
> +++ b/scripts/repo-add.sh.in
> @@ -74,6 +74,11 @@ repo-remove will update a package database by removing the package name

> *specified on the command line from the given repo database. Multiple

> *packages to remove can be specified on the command line.

")"
> * * * *printf "$(gettext "
> +Use the -s/--sign flag to sign the database with GnuPG after updating.

")"
> + * * * printf "$(gettext "
> +Use the -v/--verify flag to verify the GnuPG signature of the database

> +before updating.

")"
> + * * * printf "$(gettext "
> *Use the -q/--quiet flag to minimize output to basic messages, warnings,

> *and errors.

")"
> * * * *printf "$(gettext "
> --
> 1.7.4.1
>
>
>
 
Old 03-25-2011, 09:31 PM
Ray Kohler
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 6:16 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
>> There were not added to the end of the list as that would mean
>> splitting the single gettext string that contains -f and the
>> "see the man page" message, and I wanted to do as little string
>> damage as possible.
>
> Do string damage, it is a major release. But more importantly,
> repo-remove --help is going to show these and we might want to try and
> avoid that- I think the reason they weren't added here.

The -d and -f flags already suffer from the same problem of showing up
is repo-remove --help, when they don't apply there. Maybe I should put
conditionals in usage() to tailor it to the right invocation. Really,
this usage message is a bit off anyway, as it looks nothing like that
of pacman, pacman-key, or makepkg. Thoughts?
 
Old 03-25-2011, 09:33 PM
Dan McGee
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 5:31 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 6:16 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
>>> There were not added to the end of the list as that would mean
>>> splitting the single gettext string that contains -f and the
>>> "see the man page" message, and I wanted to do as little string
>>> damage as possible.
>>
>> Do string damage, it is a major release. But more importantly,
>> repo-remove --help is going to show these and we might want to try and
>> avoid that- I think the reason they weren't added here.
>
> The -d and -f flags already suffer from the same problem of showing up
> is repo-remove --help, when they don't apply there. Maybe I should put
> conditionals in usage() to tailor it to the right invocation. Really,
> this usage message is a bit off anyway, as it looks nothing like that
> of pacman, pacman-key, or makepkg. Thoughts?

Making it unified and correct for the command it is invoked for is
more than welcome- +1 from me.

-Dan
 
Old 03-25-2011, 09:38 PM
Allan McRae
 
Default Add -s --sign and -v --verify to repo-add usage message.

On 26/03/11 08:16, Dan McGee wrote:

On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> wrote:

There were not added to the end of the list as that would mean
splitting the single gettext string that contains -f and the
"see the man page" message, and I wanted to do as little string
damage as possible.


Do string damage, it is a major release. But more importantly,
repo-remove --help is going to show these and we might want to try and
avoid that- I think the reason they weren't added here.



I think these options are still relevant to repo-remove.

Allan
 
Old 03-25-2011, 09:45 PM
Dan McGee
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
> On 26/03/11 08:16, Dan McGee wrote:
>>
>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>
>>> There were not added to the end of the list as that would mean
>>> splitting the single gettext string that contains -f and the
>>> "see the man page" message, and I wanted to do as little string
>>> damage as possible.
>>
>> Do string damage, it is a major release. But more importantly,
>> repo-remove --help is going to show these and we might want to try and
>> avoid that- I think the reason they weren't added here.
>>
>
> I think these options are still relevant to repo-remove.

-d and -f? If you remove an entry, the whole darn thing goes,
regardless of whether there are deltas or files ...files in there.

-Dan
 
Old 03-25-2011, 09:54 PM
Ray Kohler
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 6:45 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
>> On 26/03/11 08:16, Dan McGee wrote:
>>>
>>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>>
>>>> There were not added to the end of the list as that would mean
>>>> splitting the single gettext string that contains -f and the
>>>> "see the man page" message, and I wanted to do as little string
>>>> damage as possible.
>>>
>>> Do string damage, it is a major release. But more importantly,
>>> repo-remove --help is going to show these and we might want to try and
>>> avoid that- I think the reason they weren't added here.
>>>
>>
>> I think these options are still relevant to repo-remove.
>
> -d and -f? If you remove an entry, the whole darn thing goes,
> regardless of whether there are deltas or files ...files in there.

That's what checking the code bears out to me as well, but I think
Allan's point is that -s and -v actually do apply to repo-remove.

While reading through this code, I noticed what looks like a bug -
when using repo-remove to remove the very last package ("zip up some
emptyness"), the repo won't be signed even if -s was given. Want me to
fix that once I'm done with the usage message?
 
Old 03-25-2011, 09:58 PM
Dan McGee
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 5:54 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 6:45 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>> On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
>>> On 26/03/11 08:16, Dan McGee wrote:
>>>>
>>>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>>>
>>>>> There were not added to the end of the list as that would mean
>>>>> splitting the single gettext string that contains -f and the
>>>>> "see the man page" message, and I wanted to do as little string
>>>>> damage as possible.
>>>>
>>>> Do string damage, it is a major release. But more importantly,
>>>> repo-remove --help is going to show these and we might want to try and
>>>> avoid that- I think the reason they weren't added here.
>>>>
>>>
>>> I think these options are still relevant to repo-remove.
>>
>> -d and -f? If you remove an entry, the whole darn thing goes,
>> regardless of whether there are deltas or files ...files in there.
>
> That's what checking the code bears out to me as well, but I think
> Allan's point is that -s and -v actually do apply to repo-remove.
>
> While reading through this code, I noticed what looks like a bug -
> when using repo-remove to remove the very last package ("zip up some
> emptyness"), the repo won't be signed even if -s was given. Want me to
> fix that once I'm done with the usage message?

Yes, it would make sense to do that. Thanks for the QA you're giving this.

-Dan
 
Old 03-25-2011, 10:16 PM
Ray Kohler
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 6:54 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 6:45 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>> On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
>>> On 26/03/11 08:16, Dan McGee wrote:
>>>>
>>>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>>>
>>>>> There were not added to the end of the list as that would mean
>>>>> splitting the single gettext string that contains -f and the
>>>>> "see the man page" message, and I wanted to do as little string
>>>>> damage as possible.
>>>>
>>>> Do string damage, it is a major release. But more importantly,
>>>> repo-remove --help is going to show these and we might want to try and
>>>> avoid that- I think the reason they weren't added here.
>>>>
>>>
>>> I think these options are still relevant to repo-remove.
>>
>> -d and -f? If you remove an entry, the whole darn thing goes,
>> regardless of whether there are deltas or files ...files in there.
>
> That's what checking the code bears out to me as well, but I think
> Allan's point is that -s and -v actually do apply to repo-remove.

How's this for usage output?

ataraxia@asenath:~/code/pacman/scripts $ ./repo-add -h
repo-add (pacman) 3.5.1-73-g72775-dirty

Usage: repo-add [-d] [-f] [-q] [-s] [-v] <path-to-db> <package|delta> ...
repo-add will update a package database by reading a package file.
Multiple packages to add can be specified on the command line.

Options:
-d, --delta generate and add delta for package update
-f, --files update database's file list
-q, --quiet minimize output
-s, --sign sign database with GnuPG after update
-v, --verify verify database's signature before update

See repo-add(8) for more details and descriptions of the available options.

Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz

ataraxia@asenath:~/code/pacman/scripts $ ./repo-remove -h
repo-remove (pacman) 3.5.1-73-g72775-dirty

Usage: repo-remove [-q] [-s] [-v] <path-to-db> <packagename> ...

repo-remove will update a package database by removing the package name
specified on the command line from the given repo database. Multiple
packages to remove can be specified on the command line.

Options:
-q, --quiet minimize output
-s, --sign sign database with GnuPG after update
-v, --verify verify database's signature before update

See repo-remove(8) for more details and descriptions of the available options.

Example: repo-remove /path/to/repo.db.tar.gz kernel26
 
Old 03-25-2011, 10:26 PM
Dan McGee
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 6:16 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 6:54 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
>> On Fri, Mar 25, 2011 at 6:45 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>>> On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
>>>> On 26/03/11 08:16, Dan McGee wrote:
>>>>>
>>>>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>>>>
>>>>>> There were not added to the end of the list as that would mean
>>>>>> splitting the single gettext string that contains -f and the
>>>>>> "see the man page" message, and I wanted to do as little string
>>>>>> damage as possible.
>>>>>
>>>>> Do string damage, it is a major release. But more importantly,
>>>>> repo-remove --help is going to show these and we might want to try and
>>>>> avoid that- I think the reason they weren't added here.
>>>>>
>>>>
>>>> I think these options are still relevant to repo-remove.
>>>
>>> -d and -f? If you remove an entry, the whole darn thing goes,
>>> regardless of whether there are deltas or files ...files in there.
>>
>> That's what checking the code bears out to me as well, but I think
>> Allan's point is that -s and -v actually do apply to repo-remove.
>
> How's this for usage output?
>
> ataraxia@asenath:~/code/pacman/scripts $ ./repo-add -h
> repo-add (pacman) 3.5.1-73-g72775-dirty
>
> Usage: repo-add [-d] [-f] [-q] [-s] [-v] <path-to-db> <package|delta> ...
> repo-add will update a package database by reading a package file.
> Multiple packages to add can be specified on the command line.
>
> Options:
> *-d, --delta * generate and add delta for package update
> *-f, --files * update database's file list
> *-q, --quiet * minimize output
> *-s, --sign * *sign database with GnuPG after update
> *-v, --verify *verify database's signature before update
>
> See repo-add(8) for more details and descriptions of the available options.
>
> Example: *repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz
>
> ataraxia@asenath:~/code/pacman/scripts $ ./repo-remove -h
> repo-remove (pacman) 3.5.1-73-g72775-dirty
>
> Usage: repo-remove [-q] [-s] [-v] <path-to-db> <packagename> ...
>
> repo-remove will update a package database by removing the package name
> specified on the command line from the given repo database. Multiple
> packages to remove can be specified on the command line.
>
> Options:
> *-q, --quiet * minimize output
> *-s, --sign * *sign database with GnuPG after update
> *-v, --verify *verify database's signature before update
>
> See repo-remove(8) for more details and descriptions of the available options.
>
> Example: *repo-remove /path/to/repo.db.tar.gz kernel26

At quick glance, looks great to me.

The manpage might be the next thing to tackle- find a good way to
delineate the two sets of options, as it isn't that clear right now.
-v is also missing it appears.

-Dan
 
Old 03-25-2011, 10:36 PM
Ray Kohler
 
Default Add -s --sign and -v --verify to repo-add usage message.

On Fri, Mar 25, 2011 at 7:26 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Fri, Mar 25, 2011 at 6:16 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
>> On Fri, Mar 25, 2011 at 6:54 PM, Ray Kohler <ataraxia937@gmail.com> wrote:
>>> On Fri, Mar 25, 2011 at 6:45 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>>>> On Fri, Mar 25, 2011 at 5:38 PM, Allan McRae <allan@archlinux.org> wrote:
>>>>> On 26/03/11 08:16, Dan McGee wrote:
>>>>>>
>>>>>> On Fri, Mar 25, 2011 at 5:14 PM, Ray Kohler<ataraxia937@gmail.com> *wrote:
>>>>>>>
>>>>>>> There were not added to the end of the list as that would mean
>>>>>>> splitting the single gettext string that contains -f and the
>>>>>>> "see the man page" message, and I wanted to do as little string
>>>>>>> damage as possible.
>>>>>>
>>>>>> Do string damage, it is a major release. But more importantly,
>>>>>> repo-remove --help is going to show these and we might want to try and
>>>>>> avoid that- I think the reason they weren't added here.
>>>>>>
>>>>>
>>>>> I think these options are still relevant to repo-remove.
>>>>
>>>> -d and -f? If you remove an entry, the whole darn thing goes,
>>>> regardless of whether there are deltas or files ...files in there.
>>>
>>> That's what checking the code bears out to me as well, but I think
>>> Allan's point is that -s and -v actually do apply to repo-remove.
>>
>> How's this for usage output?
>>
>> ataraxia@asenath:~/code/pacman/scripts $ ./repo-add -h
>> repo-add (pacman) 3.5.1-73-g72775-dirty
>>
>> Usage: repo-add [-d] [-f] [-q] [-s] [-v] <path-to-db> <package|delta> ...
>> repo-add will update a package database by reading a package file.
>> Multiple packages to add can be specified on the command line.
>>
>> Options:
>> *-d, --delta * generate and add delta for package update
>> *-f, --files * update database's file list
>> *-q, --quiet * minimize output
>> *-s, --sign * *sign database with GnuPG after update
>> *-v, --verify *verify database's signature before update
>>
>> See repo-add(8) for more details and descriptions of the available options.
>>
>> Example: *repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz
>>
>> ataraxia@asenath:~/code/pacman/scripts $ ./repo-remove -h
>> repo-remove (pacman) 3.5.1-73-g72775-dirty
>>
>> Usage: repo-remove [-q] [-s] [-v] <path-to-db> <packagename> ...
>>
>> repo-remove will update a package database by removing the package name
>> specified on the command line from the given repo database. Multiple
>> packages to remove can be specified on the command line.
>>
>> Options:
>> *-q, --quiet * minimize output
>> *-s, --sign * *sign database with GnuPG after update
>> *-v, --verify *verify database's signature before update
>>
>> See repo-remove(8) for more details and descriptions of the available options.
>>
>> Example: *repo-remove /path/to/repo.db.tar.gz kernel26
>
> At quick glance, looks great to me.
>
> The manpage might be the next thing to tackle- find a good way to
> delineate the two sets of options, as it isn't that clear right now.
> -v is also missing it appears.

Ok, here's the second rev of this patch. Hopefully the code is as nice
as the output it produces. I'll give the manpage a look as well.

From 4f8b33a5dcde821f843be2989afa5507621ad1eb Mon Sep 17 00:00:00 2001
From: Ray Kohler <ataraxia937@gmail.com>
Date: Fri, 25 Mar 2011 18:11:15 -0400
Subject: [PATCH] Clean up repo-add usage message

This now includes -s and -v, tailors itself to the current command,
and is formatted more like that of other pacman commands.

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
---
scripts/repo-add.sh.in | 43 +++++++++++++++++++++++++------------------
1 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index bd2d90b..568f628 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -63,32 +63,39 @@ error() {

# print usage instructions
usage() {
- printf "repo-add, repo-remove (pacman) %s

" "$myver"
- printf "$(gettext "Usage: repo-add [-d] [-f] [-q] [-s] [-v]
<path-to-db> <package|delta> ...
")"
- printf "$(gettext "Usage: repo-remove [-q] <path-to-db>
<packagename|delta> ...

")"
- printf "$(gettext "
+ cmd="$(basename $0)"
+ printf "%s (pacman) %s

" "$cmd" "$myver"
+ if [[ $cmd == "repo-add" ]] ; then
+ printf "$(gettext "Usage: repo-add [-d] [-f] [-q] [-s] [-v]
<path-to-db> <package|delta> ...
")"
+ printf "$(gettext "
repo-add will update a package database by reading a package file.

Multiple packages to add can be specified on the command line.

")"
- printf "$(gettext "
+ printf "$(gettext "Options:
")"
+ printf "$(gettext " -d, --delta generate and add delta for
package update
")"
+ printf "$(gettext " -f, --files update database's file list
")"
+ elif [[ $cmd == "repo-remove" ]] ; then
+ printf "$(gettext "Usage: repo-remove [-q] [-s] [-v] <path-to-db>
<packagename|delta> ...

")"
+ printf "$(gettext "
repo-remove will update a package database by removing the package name

specified on the command line from the given repo database. Multiple

packages to remove can be specified on the command line.

")"
- printf "$(gettext "
-Use the -q/--quiet flag to minimize output to basic messages, warnings,

-and errors.

")"
- printf "$(gettext "
-Use the -d/--delta flag to automatically generate and add a delta file

-between the old entry and the new one, if the old package file is found

-next to the new one.

")"
- printf "$(gettext "
-Use the -f/--files flag to update a database including file entries.


-See repo-add(8) for more details and descriptions of the available
options.

")"
- echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz
pacman-3.0.0.pkg.tar.gz")"
- echo "$(gettext "Example: repo-remove /path/to/repo.db.tar.gz kernel26")"
+ printf "$(gettext "Options:
")"
+ fi
+ printf "$(gettext " -q, --quiet minimize output
")"
+ printf "$(gettext " -s, --sign sign database with GnuPG after update
")"
+ printf "$(gettext " -v, --verify verify database's signature
before update
")"
+ printf "$(gettext "

+See %s(8) for more details and descriptions of the available
options.

")" $cmd
+ if [[ $cmd == "repo-add" ]] ; then
+ echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz
pacman-3.0.0.pkg.tar.gz")"
+ elif [[ $cmd == "repo-remove" ]] ; then
+ echo "$(gettext "Example: repo-remove /path/to/repo.db.tar.gz kernel26")"
+ fi
}

version() {
- printf "repo-add, repo-remove (pacman) %s

" "$myver"
+ cmd="$(basename $0)"
+ printf "%s (pacman) %s

" "$cmd" "$myver"
printf "$(gettext "
Copyright (C) 2006-2008 Aaron Griffin <aaron@archlinux.org>.

Copyright (c) 2007-2008 Dan McGee <dan@archlinux.org>.


--
1.7.4.1
 

Thread Tools




All times are GMT. The time now is 04:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org