ref: refs/heads/master
commit 30333bdb0b24db7bfdc11fa7cecbf2341d8d880e
Author: Martin Kudlvasr
Date: Thu Oct 8 16:47:53 2009 +0200
fixing packaging ...
---
plugins/eulas/app/controllers/eulas_controller.rb | 8 ++-
plugins/eulas/app/models/license.rb | 4 +-
plugins/eulas/package/eula.yml | 3 -
plugins/eulas/package/eulas.yml | 3 +
.../eulas/package/yast2-webservice-eula.changes | 5 -
plugins/eulas/package/yast2-webservice-eula.spec | 84 --------------------
.../eulas/package/yast2-webservice-eulas.changes | 5 +
plugins/eulas/package/yast2-webservice-eulas.spec | 84 ++++++++++++++++++++
8 files changed, 100 insertions(+), 96 deletions(-)
diff --git a/plugins/eulas/app/controllers/eulas_controller.rb b/plugins/eulas/app/controllers/eulas_controller.rb
index a449bee..20bb8ae 100644
--- a/plugins/eulas/app/controllers/eulas_controller.rb
+++ b/plugins/eulas/app/controllers/eulas_controller.rb
@@ -14,9 +14,11 @@ class EulasController < ApplicationController
end
def show
+ raise InvalidParameters.new ({:id => 'MISSING'}) if params[:id].nil?
@id = params[:id].to_i
@license = License.find @id
- if not params[:lang].nil? then @license.load_text params[:lang] end
+ render ErrorResult.error(404, 1, "License not found") and return if @license.nil?
+ @license.load_text params[:lang] unless params[:lang].nil?
logger.debug @license.inspect
respond_to do |format|
format.html
@@ -26,8 +28,10 @@ class EulasController < ApplicationController
end
def update
+ raise InvalidParameters.new ({:id => 'MISSING'}) if params[:id].nil?
@license = License.find params[:id]
- @license.accept = params[:license][:accept]
+ render ErrorResult.error(404, 1, "License not found") and return if @license.nil?
+ @license.accept = params[:eula][:accept]
@license.save
render :show
end
diff --git a/plugins/eulas/app/models/license.rb b/plugins/eulas/app/models/license.rb
index 6024eb8..b5c2dea 100644
--- a/plugins/eulas/app/models/license.rb
+++ b/plugins/eulas/app/models/license.rb
@@ -13,8 +13,8 @@ class License
attr_accessor :name, :langs_hash, :langs_list, :accepted, :text, :text_lang, :only_show
- RESOURCES_DIR = File.join(File.dirname(__FILE__),"..","..","config","resources")
- VAR_DIR = File.join(File.dirname(__FILE__),"..","..","var")
+ VAR_DIR = File.join(File.dirname(__FILE__),"/var","lib","yastws","eulas")
+ RESOURCES_DIR = File.join(File.dirname(__FILE__),"/usr","share","yastws","eulas")
def dig_lang(line)
r = Regexp.new('license(?:\.(\w+))?\.txt')
diff --git a/plugins/eulas/package/eula.yml b/plugins/eulas/package/eula.yml
deleted file mode 100644
index aa09444..0000000
--- a/plugins/eulas/package/eula.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-licenses:
- - openSUSE-11.1
- - SLED-10-SP3
diff --git a/plugins/eulas/package/eulas.yml b/plugins/eulas/package/eulas.yml
new file mode 100644
index 0000000..aa09444
--- /dev/null
+++ b/plugins/eulas/package/eulas.yml
@@ -0,0 +1,3 @@
+licenses:
+ - openSUSE-11.1
+ - SLED-10-SP3
diff --git a/plugins/eulas/package/yast2-webservice-eula.changes b/plugins/eulas/package/yast2-webservice-eula.changes
deleted file mode 100644
index 595c470..0000000
--- a/plugins/eulas/package/yast2-webservice-eula.changes
+++ /dev/null
@@ -1,5 +0,0 @@
--------------------------------------------------------------------
-Wed Sep 30 17:34:07 CEST 2009 - mkudlvasr@novell.com
-
-- initial version 0.0.1
-
diff --git a/plugins/eulas/package/yast2-webservice-eula.spec b/plugins/eulas/package/yast2-webservice-eula.spec
deleted file mode 100644
index f99ba57..0000000
--- a/plugins/eulas/package/yast2-webservice-eula.spec
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# spec file for package yast2-webservice-eula (Version 0.0.1)
-#
-# Copyright (c) 2008-09 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
-#
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-
-
-Name: yast2-webservice-eula
-PreReq: yast2-webservice
-Provides: yast2-webservice:/srv/www/yastws/app/controllers/basesystem_controller.rb
-License: MIT
-Group: Productivity/Networking/Web/Utilities
-Autoreqprov: on
-Version: 0.0.2
-Release: 0
-Summary: YaST2 - Webservice - EULA
-Source: www.tar.bz2
-Source1: eula.yml
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
-BuildRequires: rubygem-mocha
-Requires: yast2-core > 2.18.14
-Requires: yast2-country >= 2.18.9
-
-#
-%define pkg_user yastws
-%define plugin_name eula
-#
-
-
-%description
-YaST2 - Webservice - REST based interface of YaST in order to handle user acceptation of EULAs.
-
-Authors:
---------
- Martin Kudlvasr
- Josef Reidinger
-
-%prep
-%setup -q -n www
-
-%build
-
-%install
-
-#
-# Install all web and frontend parts.
-#
-mkdir -p $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
-cp -a * $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
-#FIXME maybe location change in future
-
-mkdir -p $RPM_BUILD_ROOT/etc/YaST2/
-cp %SOURCE1 $RPM_BUILD_ROOT/etc/YaST2/
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%dir /srv/www/%{pkg_user}
-%dir /srv/www/%{pkg_user}/vendor
-%dir /srv/www/%{pkg_user}/vendor/plugins
-%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
-%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/doc
-%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/var
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/MIT-LICENSE
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/README
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/Rakefile
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/init.rb
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/install.rb
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/uninstall.rb
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/app
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/config
-#/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/tasks
-#/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/test
-/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/doc/README_FOR_APP
-%config /etc/YaST2/eula.yml
-
diff --git a/plugins/eulas/package/yast2-webservice-eulas.changes b/plugins/eulas/package/yast2-webservice-eulas.changes
new file mode 100644
index 0000000..595c470
--- /dev/null
+++ b/plugins/eulas/package/yast2-webservice-eulas.changes
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Wed Sep 30 17:34:07 CEST 2009 - mkudlvasr@novell.com
+
+- initial version 0.0.1
+
diff --git a/plugins/eulas/package/yast2-webservice-eulas.spec b/plugins/eulas/package/yast2-webservice-eulas.spec
new file mode 100644
index 0000000..48dbe67
--- /dev/null
+++ b/plugins/eulas/package/yast2-webservice-eulas.spec
@@ -0,0 +1,84 @@
+#
+# spec file for package yast2-webservice-eula (Version 0.0.1)
+#
+# Copyright (c) 2008-09 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+Name: yast2-webservice-eulas
+PreReq: yast2-webservice
+Provides: yast2-webservice:/srv/www/yastws/app/controllers/eulas_controller.rb
+License: MIT
+Group: Productivity/Networking/Web/Utilities
+Autoreqprov: on
+Version: 0.0.2
+Release: 0
+Summary: YaST2 - Webservice - EULA
+Source: www.tar.bz2
+Source1: eulas.yml
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+BuildRequires: rubygem-mocha
+Requires: yast2-core > 2.18.14
+Requires: yast2-country >= 2.18.9
+
+#
+%define pkg_user yastws
+%define plugin_name eulas
+#
+
+
+%description
+YaST2 - Webservice - REST based interface of YaST in order to handle user acceptation of EULAs.
+
+Authors:
+--------
+ Martin Kudlvasr
+ Josef Reidinger
+
+%prep
+%setup -q -n www
+
+%build
+
+%install
+
+#
+# Install all web and frontend parts.
+#
+mkdir -p $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+cp -a * $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+#FIXME maybe location change in future
+
+mkdir -p $RPM_BUILD_ROOT/etc/YaST2/
+cp %SOURCE1 $RPM_BUILD_ROOT/etc/YaST2/
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root)
+%dir /srv/www/%{pkg_user}
+%dir /srv/www/%{pkg_user}/vendor
+%dir /srv/www/%{pkg_user}/vendor/plugins
+%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/doc
+%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/var
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/MIT-LICENSE
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/README
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/Rakefile
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/init.rb
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/install.rb
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/uninstall.rb
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/app
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/config
+#/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/tasks
+#/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/test
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/doc/README_FOR_APP
+%config /etc/YaST2/eulas.yml
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org