Hello community,

here is the log from the commit of package octave-forge-cgi for 
openSUSE:Factory checked in at 2015-06-30 10:18:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/octave-forge-cgi (Old)
 and      /work/SRC/openSUSE:Factory/.octave-forge-cgi.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "octave-forge-cgi"

Changes:
--------
--- /work/SRC/openSUSE:Factory/octave-forge-cgi/octave-forge-cgi.changes        
2015-06-16 15:10:23.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.octave-forge-cgi.new/octave-forge-cgi.changes   
2015-06-30 10:18:09.000000000 +0200
@@ -1,0 +2,6 @@
+Sat Jun 27 07:46:00 UTC 2015 - [email protected]
+
+- Update to version 0.1.1
+  * Implement semicolon as parameter separator
+
+-------------------------------------------------------------------

Old:
----
  cgi-0.1.0.tar.gz

New:
----
  cgi-0.1.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ octave-forge-cgi.spec ++++++
--- /var/tmp/diff_new_pack.txTWeJ/_old  2015-06-30 10:18:09.000000000 +0200
+++ /var/tmp/diff_new_pack.txTWeJ/_new  2015-06-30 10:18:09.000000000 +0200
@@ -18,7 +18,7 @@
 
 %define octpkg  cgi
 Name:           octave-forge-%{octpkg}
-Version:        0.1.0
+Version:        0.1.1
 Release:        0
 Summary:        Common Gataway Interface for Octave
 License:        GPL-2.0+
@@ -27,7 +27,7 @@
 Source0:        
http://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz
 BuildArch:      noarch
 BuildRequires:  octave-devel
-Requires:       octave-cli >= 3.4.0
+Requires:       octave-cli >= 3.8.0
 
 %description
 Common Gateway Interface for Octave.

++++++ cgi-0.1.0.tar.gz -> cgi-0.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/DESCRIPTION new/cgi/DESCRIPTION
--- old/cgi/DESCRIPTION 2012-11-20 20:57:24.000000000 +0100
+++ new/cgi/DESCRIPTION 2015-06-22 22:33:12.000000000 +0200
@@ -1,11 +1,11 @@
 Name: cgi
-Version: 0.1.0
-Date: 2012-11-20
+Version: 0.1.1
+Date: 2015-06-22
 Author: Alexander Barth <[email protected]>
 Maintainer: Alexander Barth <[email protected]>
 Title: cgi
 Description: Common Gatway Interface for Octave
 Categories: Web development
-Depends: octave (>= 3.4.0)
+Depends: octave (>= 3.8.0)
 License: GPLv2+
 Url: http://octave.sf.net, 
http://modb.oce.ulg.ac.be/mediawiki/index.php/CGI_programming_with_Octave
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/NEWS new/cgi/NEWS
--- old/cgi/NEWS        2012-11-20 20:23:59.000000000 +0100
+++ new/cgi/NEWS        2015-06-22 22:33:12.000000000 +0200
@@ -1,3 +1,8 @@
+Summary of important user-visible changes for cgi 0.1.1:
+-------------------------------------------------------------------
+
+ ** Implement semicolon as parameter separator
+
 Summary of important user-visible changes for cgi 0.1.0:
 -------------------------------------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/doc/test_cgi.sh new/cgi/doc/test_cgi.sh
--- old/cgi/doc/test_cgi.sh     2012-11-20 20:23:59.000000000 +0100
+++ new/cgi/doc/test_cgi.sh     2015-06-22 22:33:12.000000000 +0200
@@ -1,8 +1,35 @@
+
 export DOCUMENT_ROOT=/var/www 
 export REQUEST_METHOD=GET
 export QUERY_STRING="x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" 
 
+echo "Test GET request"
+octave -q <<EOF
+CGI = cgi();
+disp(CGI.form.y)
+assert(strcmp(CGI.form.y,'1,2,3'))
+assert(strcmp(CGI.form.field,'random_field'))
+disp('All tests passed');
+EOF
+
+echo "Test GET request (with semicolon)"
+
+export QUERY_STRING="x=50%2C1,2;y=1,2,3;len=10;name=test;field=random_field" 
+
 octave -q <<EOF
 CGI = cgi();
-disp(cgi.form.y)
-EOF
\ No newline at end of file
+assert(strcmp(CGI.form.y,'1,2,3'))
+assert(strcmp(CGI.form.field,'random_field'))
+disp('All tests passed');
+EOF
+
+echo "Test POST request"
+
+export DOCUMENT_ROOT=/var/www 
+export REQUEST_METHOD=POST 
+export CONTENT_TYPE=application/x-www-form-urlencoded
+export CONTENT_LENGTH=54
+
+echo "x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" | \
+    octave -qH --eval "CGI = cgi(); assert(strcmp(CGI.form.y,'1,2,3')); 
disp('All tests passed');";
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/doc/test_cgi_post.m new/cgi/doc/test_cgi_post.m
--- old/cgi/doc/test_cgi_post.m 2012-11-20 20:23:59.000000000 +0100
+++ new/cgi/doc/test_cgi_post.m 1970-01-01 01:00:00.000000000 +0100
@@ -1,5 +0,0 @@
-#!/usr/bin/octave -qH
-
-
-CGI = cgi();
-CGI.form.y
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/doc/test_cgi_post.sh new/cgi/doc/test_cgi_post.sh
--- old/cgi/doc/test_cgi_post.sh        2012-11-20 20:23:59.000000000 +0100
+++ new/cgi/doc/test_cgi_post.sh        1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-export DOCUMENT_ROOT=/var/www 
-export REQUEST_METHOD=POST 
-export CONTENT_TYPE=application/x-www-form-urlencoded
-export CONTENT_LENGTH=54
-
-echo "x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" | 
./test_cgi_post.m 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/doc/test_cgi_upload.m 
new/cgi/doc/test_cgi_upload.m
--- old/cgi/doc/test_cgi_upload.m       1970-01-01 01:00:00.000000000 +0100
+++ new/cgi/doc/test_cgi_upload.m       2015-06-22 22:33:12.000000000 +0200
@@ -0,0 +1,3 @@
+CGI = cgi(); 
+assert(strcmp(getfirst(CGI,'submit-name'),'Larry')); 
+disp('All tests passed');
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/doc/test_cgi_upload.sh 
new/cgi/doc/test_cgi_upload.sh
--- old/cgi/doc/test_cgi_upload.sh      1970-01-01 01:00:00.000000000 +0100
+++ new/cgi/doc/test_cgi_upload.sh      2015-06-22 22:33:12.000000000 +0200
@@ -0,0 +1,23 @@
+export DOCUMENT_ROOT=/var/www 
+export REQUEST_METHOD=POST 
+export CONTENT_TYPE=multipart/form-data
+
+# from http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
+
+octave -q --eval test_cgi_upload <<EOF
+Content-Type: multipart/form-data; boundary=AaB03x
+
+--AaB03x
+Content-Disposition: form-data; name="submit-name"
+
+Larry
+--AaB03x
+Content-Disposition: form-data; name="files"; filename="file1.txt"
+Content-Type: text/plain
+
+... contents of file1.txt ...
+--AaB03x--
+EOF
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/inst/@cgi/cgi.m new/cgi/inst/@cgi/cgi.m
--- old/cgi/inst/@cgi/cgi.m     2012-11-19 22:43:21.000000000 +0100
+++ new/cgi/inst/@cgi/cgi.m     2015-06-22 22:33:12.000000000 +0200
@@ -25,24 +25,51 @@
   % POST request
   content_type = getenv('CONTENT_TYPE');
   content_length = str2double(getenv('CONTENT_LENGTH'));
-  assert(content_type,'application/x-www-form-urlencoded');
-  self.query_string = fscanf(stdin,'%c',content_length);
+
+  if strcmp(content_type,'application/x-www-form-urlencoded')
+    self.query_string = fscanf(stdin,'%c',content_length);
+
+  % elseif strcmp(content_type,'multipart/form-data')
+  %   % Content-Type: multipart/form-data; boundary=AaB03x
+  %   line = fgetl(stdin)
+
+  %   [header_type,header_value,attrib] = parseline(line);
+  %   assert(header_type,'Content-Type');
+  %   assert(header_value,'multipart/form-data')
+
+  %   line = fgetl(stdin)
+  %   line = fgetl(stdin)
+  %   line = fgetl(stdin)
+  %   [header_type,header_value,attrib] = parseline(line)
+  %   line = fgetl(stdin)
+  %   line = fgetl(stdin)
+  %   self.params{end+1} = attrib.name;
+  %   self.vals{end+1} = line;
+
+  %   self.query_string = '';
+    
+  else     
+    error('unsupported content_type %s',content_type);
+  end
   %fprintf(stderr,'query_string "%s" "%s" 
"%d"',self.query_string,content_type,content_length);
 else
-  error('unsupported requested method',self.request_method);
+  error('unsupported requested method %s',self.request_method);
 end
 
 
-% should also split at ";"
-p = strsplit(self.query_string,'&');
+% split at & and ;
+p = strsplit(self.query_string,{'&',';'});
 
 for i=1:length(p)
   pp = strsplit(p{i},'=');
-  
-  self.params{end+1} = unquote(pp{1});
-  self.vals{end+1} = unquote(pp{2});
+
+  if length(pp) == 2
+    self.params{end+1} = unquote(pp{1});
+    self.vals{end+1} = unquote(pp{2});
+  end
 end
 
+
 retval = class(self,'cgi');
 
 % replace strings like 'abc%20def' to 'abc def'
@@ -78,4 +105,4 @@
 % GNU General Public License for more details.
 %
 % You should have received a copy of the GNU General Public License
-% along with this program; If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
+% along with this program; If not, see <http://www.gnu.org/licenses/>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cgi/inst/@cgi/private/parseline.m 
new/cgi/inst/@cgi/private/parseline.m
--- old/cgi/inst/@cgi/private/parseline.m       1970-01-01 01:00:00.000000000 
+0100
+++ new/cgi/inst/@cgi/private/parseline.m       2015-06-22 22:33:12.000000000 
+0200
@@ -0,0 +1,17 @@
+% Content-Type: multipart/form-data; boundary=AaB03x
+% todo: handle quotes
+
+function [header_type,header_value,attrib] = parseline(line)
+
+parts = strsplit(line,':');
+header_type = parts{1};
+
+parts2 = strsplit(parts{2},';');
+
+header_value = strtrim(parts2{1});
+
+
+for i = 2:length(parts2)
+    parts3 = strsplit(strtrim(parts2{i}),'=');
+    attrib.(strtrim(parts3{1})) = parts3{2};
+end


Reply via email to