Google Groups Home
Help | Sign in
a patch to fix webserver error for duplicate version upon upload
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
lecar_...@yahoo.com  
View profile
 More options Oct 17 2005, 1:13 pm
From: lecar_...@yahoo.com
Date: Mon, 17 Oct 2005 10:13:45 -0700
Local: Mon, Oct 17 2005 1:13 pm
Subject: a patch to fix webserver error for duplicate version upon upload
Hello Everyone,

Below is a patch (really a change from -- to section since I couldn't
figure out how to get TortoiseSVN to produce patches on windows), to
produce nicer error messages (instead of internal server errors from
apache) for duplicate uploaded package names. Current if you upload
'foobar-0.1.tar.gz' twice you receive a 500 error. This will roughly
try to figure out that it is a duplicate or display the internal mysql
error.

I cannot test this since I don't have the full openjsan app setup on a
local machine (or anything besides the source code).

Change:

$user->add_to_distributions({filename => "$file->{filename}"});

To:

## catch db error
eval { $user->add_to_distributions({filename => "$file->{filename}"});

};

my $err = $@;
## try to detect error (slightly) and create nicer one,
## if not dump db error
$err = sprintf("'%s' version already exists, please update version
number", $file->{filename}) if ($err =~ /duplicate entry/i);
return { error => $err } if $err;

Let me know if I'm way off base here. I couldn't quite figure out the
magic behind the 'add_to_distributions' but I kind of guessed it was
tied to 'Class::DBI::Loader' for the table 'distributions' related to
an 'author'.

Take Care,

Lee


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jerry gay  
View profile
 More options Oct 18 2005, 3:15 pm
From: jerry gay <jerry....@gmail.com>
Date: Tue, 18 Oct 2005 12:15:18 -0700
Local: Tues, Oct 18 2005 3:15 pm
Subject: Re: a patch to fix webserver error for duplicate version upon upload
On 10/17/05, lecar_...@yahoo.com <lecar_...@yahoo.com> wrote:

> Below is a patch (really a change from -- to section since I couldn't
> figure out how to get TortoiseSVN to produce patches on windows), to

tortoise svn allows you to use windows explorer to do this...
right click on the file, select the 'TortoiseSVN' submenu, and select
'Create Patch...'

it should be relatively straightforward from there.

i can't speak to the quality or correctness of the patch you've
supplied, as i don't have openjsan set up locally.

hope that helps.
~jerry


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lee Carmichael  
View profile
 More options Oct 19 2005, 1:44 pm
From: Lee Carmichael <lecar_...@yahoo.com>
Date: Wed, 19 Oct 2005 10:44:55 -0700 (PDT)
Local: Wed, Oct 19 2005 1:44 pm
Subject: Re: a patch to fix webserver error for duplicate version upon upload

> tortoise svn allows you to use windows explorer to
> do this...
> right click on the file, select the 'TortoiseSVN'
> submenu, and select
> 'Create Patch...'

Actually, you need to do this on the folder instead of
file. I feel like less of a moron now... Thanks for
pointing me in the correct direction.

Please see attached patch for duplicate release error
patch.

Take Care,

Lee

__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

  serverpm.patch
1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google