Merge ~sespiros/ubuntu-security-tools/+git/ubuntu-security-tools:usn-util-fix into ubuntu-security-tools:master

Proposed by Spyros Seimenis
Status: Needs review
Proposed branch: ~sespiros/ubuntu-security-tools/+git/ubuntu-security-tools:usn-util-fix
Merge into: ubuntu-security-tools:master
Diff against target: 51 lines (+31/-5)
1 file modified
usn-tools/dot.usn-functions.sh (+31/-5)
Reviewer Review Type Date Requested Status
Ubuntu Security Team Pending
Review via email: mp+413945@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Spyros Seimenis (sespiros) wrote :

usn_create_usn_template function is a bash helper for step 3 of https://wiki.ubuntu.com/SecurityTeam/UpdatePublication#Announce_Publication.

It already covered the most common cases for a USN publication but didn't properly cover some cases for ESM.

a93df7f... by Spyros Seimenis

Fix command execution for bash and zsh

Unmerged commits

a93df7f... by Spyros Seimenis

Fix command execution for bash and zsh

52e9d64... by Spyros Seimenis

usn-tools: Fix ESM cases for usn_create_usn_template command

  - support for merge usn only for proposed and esm for now
  - upload to private repo needs explicit argument "private"
  - formatting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/usn-tools/dot.usn-functions.sh b/usn-tools/dot.usn-functions.sh
index ffb7392..cc2c27e 100644
--- a/usn-tools/dot.usn-functions.sh
+++ b/usn-tools/dot.usn-functions.sh
@@ -53,15 +53,41 @@ usn_create_usn_template() {
53 local PENDING_DIR="${_TMPDIR}/pending-${SRCPKG// /-}-usn-${USN}"53 local PENDING_DIR="${_TMPDIR}/pending-${SRCPKG// /-}-usn-${USN}"
54 local USN_SCRIPT="${USN_SCRIPT_DIR}/new-${SRCPKG// /-}-usn-${USN}.sh"54 local USN_SCRIPT="${USN_SCRIPT_DIR}/new-${SRCPKG// /-}-usn-${USN}.sh"
5555
56 sis_changes_cmd="$UCT/scripts/sis-changes --download ${PENDING_DIR} $SRCPKG"
57 sis_generate_usn_cmd="cd ${PENDING_DIR} && $UCT/scripts/sis-generate-usn --no-new-warn $USN ./*.changes > ${USN_SCRIPT}"
56 if [ -z "$1" ]; then58 if [ -z "$1" ]; then
57 "$UCT/scripts/sis-changes" --download "${PENDING_DIR}" $SRCPKG && cd "${PENDING_DIR}" && "$UCT/scripts/sis-generate-usn" --no-new-warn "$USN" ./*.changes > "${USN_SCRIPT}"59 echo "Usage: sis-changes [private/proposed/esm-infra/esm-apps/merge]"
60 return 1
61 elif [ "$1" = "private" ]; then
62 sis_changes_cmd="$sis_changes_cmd && $sis_generate_usn_cmd"
58 elif [ "$1" = "proposed" ]; then63 elif [ "$1" = "proposed" ]; then
59 "$UCT/scripts/sis-changes" --download "${PENDING_DIR}" $SRCPKG --ppa ubuntu-security-proposed/ppa && cd "${PENDING_DIR}" && "$UCT/scripts/sis-generate-usn" --no-new-warn "$USN" ./*.changes > "${USN_SCRIPT}"64 sis_changes_cmd="$sis_changes_cmd --ppa ubuntu-security-proposed/ppa && $sis_generate_usn_cmd"
60 elif [ "$1" = "esm" ]; then65 elif [ "$1" = "esm-infra" ]; then
61 "$UCT/scripts/sis-changes" --download "${PENDING_DIR}" $SRCPKG --ppa ubuntu-security/esm --include-eol && cd "${PENDING_DIR}" && "$UCT/scripts/sis-generate-usn" --no-new-warn "$USN" ./*.changes > "${USN_SCRIPT}"66 sis_changes_cmd="$sis_changes_cmd --ppa ubuntu-esm/esm-infra-security-staging --include-eol && $sis_generate_usn_cmd"
67 elif [ "$1" = "esm-apps" ]; then
68 sis_changes_cmd="$sis_changes_cmd --ppa ubuntu-esm/esm-apps-security-staging --include-eol && $sis_generate_usn_cmd"
69 elif [ "$1" = "merge" ]; then
70 sis_changes_cmd="$sis_changes_cmd --ppa ubuntu-security-proposed/ppa"
71 if [ -z "$2" ]; then
72 echo "Usage: sis-changes merge [esm-apps/esm-infra]"
73 return 1
74 elif [ "$2" = "esm-infra" ]; then
75 sis_changes_cmd="$sis_changes_cmd --esm-merge-ppa ubuntu-esm/esm-infra-security-staging --include-eol && $sis_generate_usn_cmd"
76 elif [ "$2" = "esm-apps" ]; then
77 sis_changes_cmd="$sis_changes_cmd --esm-merge-ppa ubuntu-esm/esm-apps-security-staging --include-eol && $sis_generate_usn_cmd"
78 else
79 echo "Usage: sis-changes merge [esm-apps/esm-infra]"
80 echo ""
81 echo "[!] merge option produces a combined USN for proposed and one of esm-apps/esm-infra"
82 echo "[!] For other cases please use sis-changes manually or consult"
83 echo "[!] https://wiki.ubuntu.com/SecurityTeam/UpdatePublication#Announce_Publication"
84 return 1
85 fi
62 else86 else
63 echo "Unknown PPA '$1'"87 echo "Usage: sis-changes [private/proposed/esm-infra/esm-apps/merge]"
88 return 1
64 fi89 fi
90 eval ${sis_changes_cmd}
65 cd "$OLD_DIR"91 cd "$OLD_DIR"
66 echo "Generated script ${USN_SCRIPT}"92 echo "Generated script ${USN_SCRIPT}"
67}93}

Subscribers

People subscribed via source and target branches