|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Copyright 2021 Delphix |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | +# shellcheck disable=SC2034 |
| 18 | + |
| 19 | +DEFAULT_PACKAGE_GIT_URL=none |
| 20 | +SKIP_COPYRIGHTS_CHECK=true |
| 21 | + |
| 22 | +# |
| 23 | +# IMPORTANT NOTE |
| 24 | +# -------------- |
| 25 | +# |
| 26 | +# Debian packages (debs) that are not built from source by linux-pkg can be |
| 27 | +# added to this "meta-package". As a general rule, pre-built debs should only |
| 28 | +# be added here when they have been fetched from a trusted third-party |
| 29 | +# package archive. |
| 30 | +# |
| 31 | +# Here are some valid reasons for adding new debs here: |
| 32 | +# - There are bugs with a recent version of a package provided by Ubuntu and |
| 33 | +# we want to pin an older version of that package. |
| 34 | +# - Ubuntu provides a version of a package that is too old, and the package's |
| 35 | +# maintainers provide a more recent version of the package. Note that in this |
| 36 | +# case, you may also look into adding the maintainer's archive to the |
| 37 | +# linux-package-mirror PPAs list. |
| 38 | +# |
| 39 | +# To add a new deb here, upload that deb to the linux-pkg/misc-debs directory |
| 40 | +# in artifcatory and note the deb's SHA256. Be explicit on where this deb |
| 41 | +# was fetched from and why it was added to this list. |
| 42 | +# |
| 43 | +# When removing debs from this list, you should not remove them from artifactory |
| 44 | +# as they would used when rebuilding older releases. |
| 45 | +# |
| 46 | + |
| 47 | +function fetch() { |
| 48 | + logmust cd "$WORKDIR/artifacts" |
| 49 | + |
| 50 | + # |
| 51 | + # Note about the debs being fetched: |
| 52 | + # - td-agent was built by the "td-agent" linux-pkg package, but it |
| 53 | + # now fails to build due to broken third party dependencies. See |
| 54 | + # DLPX-69338 and DLPX-68211. |
| 55 | + # - unzip was added as a temporary workaround to DLPX-73555. |
| 56 | + # |
| 57 | + local debs=( |
| 58 | + "td-agent_3.5.0-delphix-2019.09.18.20_amd64.deb 84dfa2436039ff2a6312484bd7295ebaf570b5f59f100380b57e68b4800855c4" |
| 59 | + "unzip_6.0-21ubuntu1_amd64.deb d46069c369ce88c8dd91c52abb8de8d6053606748ef18b3b9bc290fdd8ad2953" |
| 60 | + ) |
| 61 | + |
| 62 | + local url="http://artifactory.delphix.com/artifactory/linux-pkg/misc-debs" |
| 63 | + |
| 64 | + echo "Fetched debs:" >BUILD_INFO |
| 65 | + local entry |
| 66 | + for entry in "${debs[@]}"; do |
| 67 | + local deb sha256 |
| 68 | + deb=$(echo "$entry" | awk '{print $1}') |
| 69 | + sha256=$(echo "$entry" | awk '{print $2}') |
| 70 | + [[ -n "$deb" && -n "$sha256" ]] || die "Invalid entry '$entry'" |
| 71 | + |
| 72 | + logmust fetch_file_from_artifactory "$url/$deb" "$sha256" |
| 73 | + |
| 74 | + echo "$entry" >>BUILD_INFO |
| 75 | + done |
| 76 | +} |
| 77 | + |
| 78 | +function build() { |
| 79 | + return |
| 80 | + # Nothing to do, all the logic is done in fetch(). |
| 81 | +} |
0 commit comments