Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

winterheart
Copy link
Contributor

Fixed slot dependencies, startup script, added myself to proxied maintainers (Bug #590646)

Package-Manager: Portage-2.3.3, Repoman-2.3.1

@gentoo-repo-qa-bot gentoo-repo-qa-bot added maintainer-needed There is at least one affected package with no maintainer. Review it if you can. assigned PR successfully assigned to the package maintainer(s). labels May 6, 2017
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull Request assignment

Areas affected: ebuilds
Packages affected: www-apps/redmine

www-apps/redmine: @gentoo/proxy-maint (maintainer needed)

Copy link
Member

@mgorny mgorny left a 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}"
Copy link
Member

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:"
Copy link
Member

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}"
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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"
Copy link
Member

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
Copy link
Member

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%/}...

@winterheart
Copy link
Contributor Author

@mgorny done.

Copy link
Member

@mgorny mgorny left a 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

Copy link
Member

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
Copy link
Member

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} \
Copy link
Member

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.

@@ -3,7 +3,16 @@
<pkgmetadata>
<longdescription lang="en">
Copy link
Member

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
Copy link
Member

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"
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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"
Copy link
Member

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 ;-).

@winterheart
Copy link
Contributor Author

@mgorny done.

}

start_pre() {
if [[ ! -e "${REDMINE_DIR}/config/initializers/secret_token.rb" ]] ; then
Copy link
Member

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" ]]; \
Copy link
Member

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.

@winterheart
Copy link
Contributor Author

@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"
Copy link
Member

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 ||dieing here?

pkg_postinst() {
einfo
if [[ -e "${EROOT%/}${REDMINE_DIR}/config/initializers/session_store.rb" \
|| -e "${EROOT%/}${REDMINE_DIR}/config/initializers/secret_token.rb" ]];
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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} \
Copy link
Member

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?

@winterheart
Copy link
Contributor Author

@mgorny done

Copy link
Member

@mgorny mgorny left a 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).

@mgorny
Copy link
Member

mgorny commented Jul 5, 2017

(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
@winterheart
Copy link
Contributor Author

@mgorny done.
I decided to bump to all supported versions - 3.2.7, 3.3.4, 3.4.0, according to upstream release policy.

@mgorny
Copy link
Member

mgorny commented Jul 14, 2017

I'm going to trust you it's all okay now. I can't stand looking at it anymore ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). maintainer-needed There is at least one affected package with no maintainer. Review it if you can.
Projects
None yet
3 participants