This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 6002cd3 switch from svnmucc to svn checkout; svn add; svn commit
6002cd3 is described below
commit 6002cd3bf62ac002e5d09103909eee1518832b84
Author: Sam Ruby <[email protected]>
AuthorDate: Mon Jun 5 14:30:30 2017 -0400
switch from svnmucc to svn checkout; svn add; svn commit
---
www/committers/Gemfile | 1 +
www/{committers => treasurer}/Gemfile | 1 +
www/treasurer/bill-upload.cgi | 26 ++++++++++++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/www/committers/Gemfile b/www/committers/Gemfile
index 588256f..65e7357 100644
--- a/www/committers/Gemfile
+++ b/www/committers/Gemfile
@@ -5,3 +5,4 @@ asf_version = File.read(File.expand_path("#{root}/asf.version",
__FILE__)).chomp
gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)
gem 'escape'
+gem 'wunderbar'
diff --git a/www/committers/Gemfile b/www/treasurer/Gemfile
similarity index 93%
copy from www/committers/Gemfile
copy to www/treasurer/Gemfile
index 588256f..65e7357 100644
--- a/www/committers/Gemfile
+++ b/www/treasurer/Gemfile
@@ -5,3 +5,4 @@ asf_version = File.read(File.expand_path("#{root}/asf.version",
__FILE__)).chomp
gem 'whimsy-asf', asf_version, path: File.expand_path(root, __FILE__)
gem 'escape'
+gem 'wunderbar'
diff --git a/www/treasurer/bill-upload.cgi b/www/treasurer/bill-upload.cgi
index 973fb7e..4c2d942 100755
--- a/www/treasurer/bill-upload.cgi
+++ b/www/treasurer/bill-upload.cgi
@@ -5,6 +5,8 @@ require 'wunderbar'
require 'wunderbar/bootstrap'
require 'wunderbar/jquery'
require 'whimsy/asf'
+require 'tmpdir'
+require 'escape'
user = ASF::Person.new($USER)
@@ -98,13 +100,25 @@ _html do
if @source and not @source.empty?
@message += "\n\nFunding source: #{@source}"
end
- # add file to svn (--revision 0 means it won't overwrite an
existing file)
_p 'Log of your upload/checkin follows:'
- _.system ['svnmucc', '--revision', '0', '--message', @message,
- ['--no-auth-cache', '--non-interactive'],
- (['--username', $USER, '--password', $PASSWORD] if $PASSWORD),
- '--', 'put', '-', File.join(bills, @dest, name)],
- stdin: @file
+
+ Dir.mktmpdir do |tmpdir|
+ tmpdir.untaint
+
+ _.system ['svn', 'checkout', File.join(bills, @dest), tmpdir,
+ '--depth=empty',
+ ['--no-auth-cache', '--non-interactive'],
+ (['--username', $USER, '--password', $PASSWORD] if $PASSWORD)]
+
+ Dir.chdir tmpdir do
+ File.write(name, @file.read)
+ _.system ['svn', 'add', name]
+
+ _.system ['svn', 'commit', name, '--message', @message,
+ ['--no-auth-cache', '--non-interactive'],
+ (['--username', $USER, '--password', $PASSWORD] if
$PASSWORD)]
+ end
+ end
end
end
end
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].