Mailinglist Archive: opensuse-buildservice (50 mails)
| < Previous | Next > |
Re: [opensuse-buildservice] web client error when adding file to package
- From: Andreas Bauer <abauer@xxxxxxx>
- Date: Mon, 20 Mar 2006 16:14:19 +0100
- Message-id: <200603201614.19715.abauer@xxxxxxx>
On Monday, 20. March 2006 16:08, Andreas Bauer wrote:
> So the correct solution is to check if a file tag exists before calling the
>
> file method:
> > - if @package.file("@filename='#{filename}'")
> > - if @package.has_element?(:file) and
>
> @package.file("@filename='#{filename}'")
Quite unreadable, so here is the real patch...
Index: package_controller.rb
===================================================================
--- package_controller.rb (Revision 55)
+++ package_controller.rb (Revision 79)
@@ -107,7 +107,7 @@
end
filetype = params[:filetype]
- if @package.file("@filename='#{filename}'")
+ if @package.has_element? :file and @package.file("@filename='#{filename}'")
@package.remove_file filename
flash_message = "File '#{filename}' replaced successfully"
else
--
Andreas Bauer - Novell - SUSE Internal Tools
> So the correct solution is to check if a file tag exists before calling the
>
> file method:
> > - if @package.file("@filename='#{filename}'")
> > - if @package.has_element?(:file) and
>
> @package.file("@filename='#{filename}'")
Quite unreadable, so here is the real patch...
Index: package_controller.rb
===================================================================
--- package_controller.rb (Revision 55)
+++ package_controller.rb (Revision 79)
@@ -107,7 +107,7 @@
end
filetype = params[:filetype]
- if @package.file("@filename='#{filename}'")
+ if @package.has_element? :file and @package.file("@filename='#{filename}'")
@package.remove_file filename
flash_message = "File '#{filename}' replaced successfully"
else
--
Andreas Bauer - Novell - SUSE Internal Tools
| < Previous | Next > |