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

Remove .length from variable $pin_release in app #754

Merged
merged 5 commits into from
Jun 21, 2018
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions templates/pin.pref.epp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<%- | $name, $pin_release, $release, $codename, $release_version, $component, $originator, $label, $version, $origin, $explanation, $packages_string, $priority | -%>
<%-
$pin =
if $pin_release.length > 0 {
if $pin_release {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be better
if $pin_release and $pin_release.length > 0
Following the logic of the rest of the template.
Many thanks for the code !!! @paladox

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be != ''?

$options = [
if $release { "a=${release}" },
if $codename { "n=${codename}" },
if $release_version { "v=${release_version}"},
if $component { "c=${component}" },
if $originator { "o=${originator}" },
if $label { "l=${label}" },
if $release != '' { "a=${release}" },
if $codename != '' { "n=${codename}" },
if $release_version != '' { "v=${release_version}"},
if $component != '' { "c=${component}" },
if $originator != '' { "o=${originator}" },
if $label != '' { "l=${label}" },
].filter |$x| { $x != undef }
"release ${options.join(', ')}" }

Expand Down