Bug 220251 - www/redmine: Outdated redmine port doesn't work with current mercurial version
Summary: www/redmine: Outdated redmine port doesn't work with current mercurial version
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Torsten Zuehlsdorff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-24 12:28 UTC by Alexander Ushakov
Modified: 2017-09-22 16:01 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments
Update to 3.2.7 (8.61 KB, patch)
2017-07-07 12:54 UTC, Torsten Zuehlsdorff
no flags Details | Diff
fixed patch to 3.2.7 (9.16 KB, patch)
2017-09-12 00:05 UTC, Miroslav Lachman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ushakov 2017-06-24 12:28:25 UTC
Currently there is redmine version 3.2.3 in ports which has known issue with mercurial version 4.1 and newer: http://www.redmine.org/issues/24999.
This bug is fixed in Redmine 3.2.6 at 4th of April but FreeBSD redmine port has not been updated yet. Consequently, current redmine port can't work with current mercurial port repos.

Bugfix: update redmine to 3.2.6 or newer
Comment 1 Torsten Zuehlsdorff freebsd_committer 2017-07-07 12:54:24 UTC
Created attachment 184155 [details]
Update to 3.2.7

Hello,

attached a patch which should bring redmine to 3.2.7. I did the last update, but its too long ago to remember all the specifics - so please be very careful when testing and have some backup!

If everything is fine i will commit the update.

Greetings,
Torsten
Comment 2 Miroslav Lachman 2017-08-23 08:14:39 UTC
Is there any problem with committing this update?
Comment 3 Torsten Zuehlsdorff freebsd_committer 2017-08-23 08:42:21 UTC
(In reply to Miroslav Lachman from comment #2)

> Is there any problem with committing this update?

Yes: missing feedback. I did the update "blindly" without having a possibility to test properly. So if someone can provide feedback i can commit it. Otherwise i need to find time for the test by myself, but my TODO list got big recently.
Comment 4 Miroslav Lachman 2017-08-23 09:01:17 UTC
(In reply to Torsten Zuehlsdorff from comment #3)
OK, I will prepare local package and will test it in our environment.
Comment 5 Miroslav Lachman 2017-09-05 12:58:02 UTC
(In reply to Torsten Zuehlsdorff from comment #3)
I am sorry for my late reply. Today I finally had time to test Redmine 3.2.7.
It builds fine but it cannot be run without these modifications:

1) when I run
# bundle exec rake generate_secret_token
I got this error about mysql2 gem

[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: mysql2 (~> 0.4.6) and mysql2 (~> 0.4.5). Bundler cannot continue.

 #  from /usr/local/www/redmine/Gemfile:98
 #  -------------------------------------------
 #  Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle|
 >    self.instance_eval(Bundler.read_file(bundle))
 #  end
 #  -------------------------------------------


There are two files with mysql2 definition

# grep -sn mysql2 Gemfile bundler.d/mysql.rb
Gemfile:60:      when 'mysql2'
Gemfile:61:        gem "mysql2", "~> 0.4.6", :platforms => [:mri, :mingw, :x64_mingw]
bundler.d/mysql.rb:1:gem "mysql2", "~> 0.4.5"


This fix was easy:

# sed -i '' 's/0\.4\.5/0.4.6/' bundler.d/mysql.rb


2) # bundle exec rake generate_secret_token
Could not find gem 'jquery-rails (~> 3.1.4)' in any of the gem sources listed in your Gemfile.

# vi Gemfile

#gem "jquery-rails", "~> 3.1.4"
gem "jquery-rails", "~> 4.3.0"


3) # bundle exec rake generate_secret_token
Could not find gem 'roadie-rails (~> 1.1.1)' in any of the gem sources listed in your Gemfile.

# vi Gemfile

#gem "roadie-rails", "~> 1.1.1"
gem "roadie-rails", "~> 1.2.0"


4) # bundle exec rake generate_secret_token
Could not find gem 'i18n (~> 0.7.0)' in any of the gem sources listed in your Gemfile.

# vi Gemfile

#gem "i18n", "~> 0.7.0"
gem "i18n", "~> 0.8.5"



And now everything works. I tested these commands:

# bundle exec rake generate_secret_token
# bundle exec rake db:migrate RAILS_ENV=production
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
Migrating redmine_checklists (Redmine Checklists plugin (Light version))...
Migrating redmine_custom_css (Redmine Custom CSS plugin)...
Migrating redmine_custom_js (Redmine Custom JS plugin)...
Migrating redmine_wiki_extensions (Redmine Wiki Extensions plugin)...
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production


# service redmine start

# service redmine status

# tail -f /usr/local/www/redmine/log/thin.log
Writing PID to tmp/pids/thin.pid
Changing process privilege to www:www
Using rack adapter
Thin web server (v1.7.2 codename Bachmanity)
Debugging ON
Maximum connections set to 1024
Listening on 0.0.0.0:8080, CTRL+C to stop



I don't know if my fixes are the right way because I don't know how Ruby gems work. 
I don't know how Gemfile and bundler.d/mysql is created (version numbers) but is should be changed to:

bundler.d/mysql.rb
  's/0.4.5/0.4.6/'

Gemfile
s/"jquery-rails", "~> 3.1.4"/"jquery-rails", "~> 4.3.0"/
s/"roadie-rails", "~> 1.1.1"/"roadie-rails", "~> 1.2.0"/
s/"i18n", "~> 0.7.0"/"i18n", "~> 0.8.5"/
Comment 6 Miroslav Lachman 2017-09-12 00:05:05 UTC
Created attachment 186283 [details]
fixed patch to 3.2.7

Patch with fixes for mentioned dependencies version problems
Comment 7 Miroslav Lachman 2017-09-12 00:08:54 UTC
I think my updated version can be committed. It builds fine in our Poudriere and pkg upgrade went fine too.
Comment 8 commit-hook freebsd_committer 2017-09-22 16:01:03 UTC
A commit references this bug:

Author: tz
Date: Fri Sep 22 16:00:06 UTC 2017
New revision: 450393
URL: https://svnweb.freebsd.org/changeset/ports/450393

Log:
  www/redmine: Update from 3.2.3 to 3.2.7

  Changelog: http://www.redmine.org/projects/redmine/wiki/Changelog_3_2

  PR:           220251
  Submitted by: Miroslav Lachman <000.fbsd@quip.cz>
  Reported by:  Alexander Ushakov <alexander@polyvizor.com>

Changes:
  head/www/redmine/Makefile
  head/www/redmine/distinfo
  head/www/redmine/files/mysql.rb
  head/www/redmine/files/patch-Gemfile
  head/www/redmine/pkg-plist
Comment 9 Torsten Zuehlsdorff freebsd_committer 2017-09-22 16:01:22 UTC
Committed, thanks! :)