Commit 0d81f4b8 authored by Tony Mancill's avatar Tony Mancill

add --priority <PRIORITY> option (Closes: #820857)

This option allows the user to override the default computed
priority considered by update-alternatives.

Internally, it changes the priority written to the .jinfo files
as well as sets priority for update-alternatives in the postinst.
parent 47952fa7
......@@ -126,7 +126,7 @@ if [ "\$1" = configure ]; then
for program in \$*; do
if [[ -f "\$program_base/\$program" ]]; then
update-alternatives \\
--install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
--install "/usr/bin/\$program" "\$program" "\$program_base/\$program" ${priority_override:-$j2se_priority} \\
--slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
fi
done
......@@ -138,7 +138,7 @@ if [ "\$1" = configure ]; then
shift
for program in \$*; do
if [[ -f "\$program_base/\$program" ]]; then
update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" ${priority_override:-$j2se_priority}
fi
done
}
......@@ -151,7 +151,7 @@ if [ "\$1" = configure ]; then
local plugin="\$4"
[ -d "\$link_path" ] || install -d -m 755 "\$link_path"
if [[ -f "\$plugin" ]]; then
update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" ${priority_override:-$j2se_priority}
fi
}
EOF
......
......@@ -163,7 +163,7 @@ EOF
oracle_j2sdk_jinfo() {
cat << EOF
name=$j2se_name
priority=$j2se_priority
priority=${priority_override:-$j2se_priority}
section=main
EOF
jinfos "hl" $jvm_base$j2se_name/jre/bin/ $oracle_jre_bin_hl
......
......@@ -126,7 +126,7 @@ EOF
oracle_j2re_jinfo() {
cat << EOF
name=$j2se_name
priority=$j2se_priority
priority=${priority_override:-$j2se_priority}
section=main
EOF
jinfos "hl" $jvm_base$j2se_name/bin/ $oracle_jre_bin_hl
......
......@@ -114,7 +114,7 @@ EOF
oracle_server_j2re_jinfo() {
cat << EOF
name=$j2se_name
priority=$j2se_priority
priority=${priority_override:-$j2se_priority}
section=main
EOF
jinfos "hl" $jvm_base$j2se_name/bin/ $oracle_jre_bin_hl
......
......@@ -82,7 +82,8 @@ The following options are recognized:
--full-name NAME full name used in the maintainer field of the package
--email EMAIL email address used in the maintainer field of the package
--distribution Define the distribution to use in the changelog
--distribution DIST Define the distribution to use in the changelog
--priority PRIORITY Override default package priority
--changes create a .changes file
--revision add debian revision
--source build a source package instead of a binary deb package
......@@ -135,6 +136,10 @@ while [[ $# -gt 0 && "x$1" == x--* ]]; do
[ $# -le 1 ] && missing_argument "$1"
shift
distribution="$1"
elif [[ "x$1" == x--priority ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
priority_override="$1"
elif [[ "x$1" == x--revision ]]; then
[ $# -le 1 ] && missing_argument "$1"
shift
......
......@@ -46,6 +46,12 @@ email address used in the maintainer field of the package
.B --distribution \fIDISTRIBUTION\fR
distribution to use in the debian changelog for the resulting package
.TP
.B --priority \fIPRIORITY\fR
numeric priority for use by \fBupdate-alternatives\fP. This overrides the default
priority, which is intentionally lower than that of the Debian-provided OpenJDK
packages. Only use this option if the generated package should be considered higher
priority by \fBupdate-alternatives\fP.
.TP
.B --changes
create a .changes file
.TP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment