[pacman-dev] [PATCH 3/3] repo-add: do not allow pkgnames to start with a minus

Allan McRae allan at archlinux.org
Tue May 19 01:23:13 EDT 2009


Dan McGee wrote:
> On Tue, May 12, 2009 at 4:02 AM, Cedric Staniewski <cedric at gmx.ca> wrote:
>   
>> Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
>> ---
>>  scripts/repo-add.sh.in |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
>> index eb8837c..2133fed 100644
>> --- a/scripts/repo-add.sh.in
>> +++ b/scripts/repo-add.sh.in
>> @@ -216,8 +216,8 @@ db_write_entry()
>>        md5sum="$(openssl dgst -md5 "$pkgfile" | awk '{print $NF}')"
>>        csize=$(@SIZECMD@ "$pkgfile")
>>
>> -       # ensure $pkgname and $pkgver variables were found
>> -       if [ -z "$pkgname" -o -z "$pkgver" ]; then
>> +       # ensure $pkgname and $pkgver variables were found and pkgname does not start with a minus
>> +       if [ -z "$pkgname" -o "${pkgname:0:1}" == "-" -o -z "$pkgver" ]; then
>>     
>
> Isn't this a bit late to be catching this? Shouldn't we be doing this
> in makepkg instead?
>   

I agree makepkg should be doing this.  But what is the reason for this 
patch?  As Dan and I discussed earlier, pkgnames are allowed to have 
hyphens in them, so why not at the start?

Allan





More information about the pacman-dev mailing list