Skip to content

Commit

Permalink
DLPX-73651 [Backport of DLPX-73610 to 6.0.7.0] pin unzip package to v…
Browse files Browse the repository at this point in the history
…ersion 6.0-21ubuntu1 (#134)
  • Loading branch information
pzakha authored Jan 13, 2021
1 parent 39a3410 commit 91a3510
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 92 deletions.
21 changes: 20 additions & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,26 @@ function fetch_kernel_from_artifactory() {
url="$url/linux-pkg/linux-prebuilt/${artifactory_deb}"

logmust cd "$WORKDIR/artifacts"
logmust wget -nv "$url"
fetch_file_from_artifactory "$url"
}

function fetch_file_from_artifactory() {
local url="$1"
local sha256_expected="$2"
local file sha256_actual

[[ -n "$url" ]] || die "url argument is missing."
file="$(basename "$url")"

logmust wget -nv "$url" -O "$file"

if [[ -n "$sha256_expected" ]]; then
sha256_actual="$(sha256sum "$file" | awk '{print $1}')"
if [[ "$sha256_expected" != "$sha256_actual" ]]; then
die "SHA256 mismatch. Expected: $sha256_expected," \
"Actual: $sha256_actual"
fi
fi
}

#
Expand Down
2 changes: 1 addition & 1 deletion package-lists/build/main.pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ grub2
libkdumpfile
make-jpkg
makedumpfile
misc-debs
nfs-utils
performance-diagnostics
ptools
Expand All @@ -26,4 +27,3 @@ recovery-environment
savedump
sdb
targetcli-fb
td-agent-prebuilt
15 changes: 8 additions & 7 deletions packages/adoptopenjdk/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
DEFAULT_PACKAGE_GIT_URL=none
PACKAGE_DEPENDENCIES="make-jpkg"

tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u262b10.tar.gz"
jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u262b10.tar.gz"
_tarfile_sha256="733755fd649fad6ae91fc083f7e5a5a0b56410fb6ac1815cff29f744b128b1b1"
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"

function prepare() {
logmust install_pkgs "$DEPDIR"/make-jpkg/*.deb
Expand All @@ -29,15 +30,15 @@ function prepare() {
function fetch() {
logmust cd "$WORKDIR/"

local url="http://artifactory.delphix.com/artifactory"
local url="http://artifactory.delphix.com/artifactory/java-binaries/linux/jdk/8/$_tarfile"

logmust wget -nv "$url/java-binaries/linux/jdk/8/$tarfile" -O "$tarfile"
logmust fetch_file_from_artifactory "$url" "$_tarfile_sha256"
}

function build() {
logmust cd "$WORKDIR/"

logmust env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg "$tarfile" <<<y
logmust env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg "$_tarfile" <<<y

logmust mv ./*deb "$WORKDIR/artifacts/"
#
Expand All @@ -49,7 +50,7 @@ function build() {
# packages, such as the app-gate, decide to fetch and install Java from
# the Linux-pkg bundle.
#
logmust bash -c "echo $jdk_path >'$WORKDIR/artifacts/JDK_PATH'"
logmust bash -c "echo $_jdk_path >'$WORKDIR/artifacts/JDK_PATH'"

echo "Tar file: $tarfile" >"$WORKDIR/artifacts/BUILD_INFO"
echo "Tar file: $_tarfile" >"$WORKDIR/artifacts/BUILD_INFO"
}
50 changes: 0 additions & 50 deletions packages/java8/config.sh

This file was deleted.

81 changes: 81 additions & 0 deletions packages/misc-debs/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#
# Copyright 2021 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# shellcheck disable=SC2034

DEFAULT_PACKAGE_GIT_URL=none
SKIP_COPYRIGHTS_CHECK=true

#
# IMPORTANT NOTE
# --------------
#
# Debian packages (debs) that are not built from source by linux-pkg can be
# added to this "meta-package". As a general rule, pre-built debs should only
# be added here when they have been fetched from a trusted third-party
# package archive.
#
# Here are some valid reasons for adding new debs here:
# - There are bugs with a recent version of a package provided by Ubuntu and
# we want to pin an older version of that package.
# - Ubuntu provides a version of a package that is too old, and the package's
# maintainers provide a more recent version of the package. Note that in this
# case, you may also look into adding the maintainer's archive to the
# linux-package-mirror PPAs list.
#
# To add a new deb here, upload that deb to the linux-pkg/misc-debs directory
# in artifcatory and note the deb's SHA256. Be explicit on where this deb
# was fetched from and why it was added to this list.
#
# When removing debs from this list, you should not remove them from artifactory
# as they would used when rebuilding older releases.
#

function fetch() {
logmust cd "$WORKDIR/artifacts"

#
# Note about the debs being fetched:
# - td-agent was built by the "td-agent" linux-pkg package, but it
# now fails to build due to broken third party dependencies. See
# DLPX-69338 and DLPX-68211.
# - unzip was added as a temporary workaround to DLPX-73555.
#
local debs=(
"td-agent_3.5.0-delphix-2019.09.18.20_amd64.deb 84dfa2436039ff2a6312484bd7295ebaf570b5f59f100380b57e68b4800855c4"
"unzip_6.0-21ubuntu1_amd64.deb d46069c369ce88c8dd91c52abb8de8d6053606748ef18b3b9bc290fdd8ad2953"
)

local url="http://artifactory.delphix.com/artifactory/linux-pkg/misc-debs"

echo "Fetched debs:" >BUILD_INFO
local entry
for entry in "${debs[@]}"; do
local deb sha256
deb=$(echo "$entry" | awk '{print $1}')
sha256=$(echo "$entry" | awk '{print $2}')
[[ -n "$deb" && -n "$sha256" ]] || die "Invalid entry '$entry'"

logmust fetch_file_from_artifactory "$url/$deb" "$sha256"

echo "$entry" >>BUILD_INFO
done
}

function build() {
return
# Nothing to do, all the logic is done in fetch().
}
33 changes: 0 additions & 33 deletions packages/td-agent-prebuilt/config.sh

This file was deleted.

0 comments on commit 91a3510

Please sign in to comment.