-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
www-apps/redmine: New version 3.3.3 #4550
Conversation
Pull Request assignment Areas affected: ebuilds www-apps/redmine: @gentoo/proxy-maint (maintainer needed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gentoo/ruby, could you also take a look?
|
||
start() { | ||
ebegin "Starting redmine" | ||
cd "${REDMINE_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling. You can just add &&
here.
|
||
start_pre() { | ||
if [ ! -e "${REDMINE_DIR}/config/initializers/secret_token.rb" ] ; then | ||
eerror "Execute the following command to initlize environment:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
|
||
rm Gemfile || die | ||
|
||
echo "CONFIG_PROTECT=\"${EPREFIX}${REDMINE_DIR}/config\"" > "${T}/50${PN}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ||die. Also, I think the heredoc syntax would be more readable here (less escapes, shorter lines).
use ldap || rm app/models/auth_source_ldap.rb || die | ||
|
||
# Make it work | ||
sed -i -e "1irequire 'request_store'" app/controllers/application_controller.rb || die |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all those changes still required? They really ought to be carried via a patch. This sed will never fail, even if upstream changed the relevant code — either fixing the issue, or breaking the fix.
all_ruby_install() { | ||
dodoc doc/{CHANGELOG,INSTALL,README_FOR_APP,RUNNING_TESTS,UPGRADING} | ||
rm -r doc || die | ||
dodoc README.rdoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to combine this into a single dodoc and rm? ;-)
rm README.rdoc || die | ||
|
||
keepdir /var/log/${PN} | ||
dosym /var/log/${PN}/ "${REDMINE_DIR}/log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a relative symlink here. Since REDMINE_DIR is unconditionally defined in the ebuild, you can do that safely.
|
||
pkg_postinst() { | ||
einfo | ||
if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/session_store.rb" -o -e "${EPREFIX}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't ye-ol-sh syntax in bash. Also this ought to use EROOT, i.e.:
if [[ -e ${EROOT%/}... || -e ${EROOT%/}...
@mgorny done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor nits.
# Place log-files to /var/log/redmine | ||
config.logger = Logger.new(Rails.root.join("/var/log/redmine",Rails.env + ".log"), 0, 10485760) | ||
config.log_level= :info | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray empty line!
eerror | ||
return 1 | ||
fi | ||
if [ ! -d /var/run/redmine ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gentoo/openrc, can't checkpath
be run unconditionally in this context?
|
||
start() { | ||
ebegin "Starting redmine" | ||
start-stop-daemon --start --quiet --user ${REDMINE_USER}:${REDMINE_GROUP} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be reasonable to quote user&group too, at least for consistency.
www-apps/redmine/metadata.xml
Outdated
@@ -3,7 +3,16 @@ | |||
<pkgmetadata> | |||
<longdescription lang="en"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you drop empty longdesc, please?
# bug #406605 | ||
rm .{git,hg}ignore || die | ||
|
||
cat > ${T}/50${PN} <<-EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
||die
# remove ldap staff module if disabled to avoid #413779 | ||
use ldap || rm app/models/auth_source_ldap.rb || die | ||
|
||
epatch "${FILESDIR}/${P}_requires.patch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use eapply in EAPI 6.
|
||
pkg_postinst() { | ||
einfo | ||
if [ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" ] || [ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use [[ ... ]] in bash, and then you can put || inside. Also, line wrapping would probably be beneficial to the reader ;-).
} | ||
|
||
pkg_config() { | ||
if [ ! -e "${EROOT%/}${REDMINE_DIR}/config/database.yml" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[ ... ]] everywhere.
|
||
pkg_config() { | ||
if [ ! -e "${EROOT%/}${REDMINE_DIR}/config/database.yml" ]; then | ||
eerror "Copy ${EROOT%/}${REDMINE_DIR}/config/database.yml.example to ${EROOT%/}${REDMINE_DIR}/config/database.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line can end up veery long. I'd suggest wrapping at 80, or approximate 80 ;-).
@mgorny done. |
} | ||
|
||
start_pre() { | ||
if [[ ! -e "${REDMINE_DIR}/config/initializers/secret_token.rb" ]] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init.d scripts are POSIX-ish sh, so you can't use [[ ... ]]
.
pkg_postinst() { | ||
einfo | ||
if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" \ | ||
|| -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pro-tip: ;
is equivalent to newline, so really no point in doing ; \
when you can leave it out.
@mgorny Done |
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die | ||
einfo "Populating database with default configuration data." | ||
RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die | ||
chown redmine:redmine "${EROOT%/}var/log/redmine/*.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you're not ||die
ing here?
pkg_postinst() { | ||
einfo | ||
if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" \ | ||
|| -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semicolon at end of the line is redundant ;-).
passenger? ( www-apache/passenger ) | ||
" | ||
|
||
#ruby_add_bdepend ">=dev-ruby/rdoc-2.4.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment explaining why this is commented out.
# >=dev-ruby/shoulda-3.3.2 | ||
# >=dev-ruby/mocha-0.13.3 | ||
# >=dev-ruby/capybara-2.0.0 | ||
# <dev-ruby/nokogiri-1.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this can't happen considering the above >= dep… so is this outdated or…?
#IUSE="ldap openid imagemagick postgres sqlite mysql fastcgi passenger" | ||
IUSE="imagemagick fastcgi ldap markdown passenger" | ||
|
||
# nokogiri ruby 2.1 >= 1.7.0, else 1.6.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering we don't support ruby < 2.1, time to bump the dep?
--user "${REDMINE_USER}:${REDMINE_GROUP}" \ | ||
--pidfile "${REDMINE_PIDFILE}" \ | ||
--exec /usr/bin/ruby "${REDMINE_DIR}"/bin/rails server -- \ | ||
--daemon --environment=${RAILS_ENV} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to quote this and the two variables below?
@mgorny done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still didn't address two of my comments (GitHub shows them in 'files changed' section).
Also, please update it for 3.3.4 (or 3.4.0).
(and rebase) |
Fixed slot dependencies, startup script (Bug #603452), added new log location and logrotate, added myself to proxied maintainers (Bug #590646). Package-Manager: Portage-2.3.3, Repoman-2.3.1
@mgorny done. |
I'm going to trust you it's all okay now. I can't stand looking at it anymore ;-). |
Fixed slot dependencies, startup script, added myself to proxied maintainers (Bug #590646)
Package-Manager: Portage-2.3.3, Repoman-2.3.1