Skip to content

Commit 70e99cc

Browse files
committed
Merge remote-tracking branch 'origin/6.0/release' into 6.0/patch
2 parents 83f84e3 + 11130e2 commit 70e99cc

33 files changed

Lines changed: 60 additions & 188 deletions

File tree

.github/scripts/verify-query-packages.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ done
6363
./query-packages.sh list build/main.pkgs >/dev/null
6464
./query-packages.sh list build/kernel-modules.pkgs >/dev/null
6565
./query-packages.sh list linux-kernel >/dev/null
66-
./query-packages.sh list update/main.pkgs >/dev/null
6766

6867
# Check that overriding TARGET_KERNEL_FLAVORS changes which kernel packages are
6968
# returned.
@@ -86,3 +85,5 @@ test "$(TARGET_KERNEL_FLAVORS="generic aws" ./query-packages.sh single -o depend
8685
# This redoes the "list all" test from above
8786
cd packages
8887
diff <(ls -1 | sort) <(../query-packages.sh list all 2>&1 | sort)
88+
89+
echo "All tests passed"

README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -346,30 +346,6 @@ Here is a list of variables that can be defined for a package:
346346
"dep" is the dependency's name. A special value can be passed for packages
347347
that target all the supported flavours of the linux-kernel: `@linux-kernel`.
348348

349-
* **DEFAULT_PACKAGE_GIT_BRANCH**: (DEPRECATED) Default git branch to use when
350-
fetching from or pushing to `DEFAULT_PACKAGE_GIT_URL`. This should be
351-
typically left unset. The branch to fetch the package from defaults
352-
to the value of the environment variable `DEFAULT_BRANCH`, which itself
353-
defaults to "master".
354-
WARNING: do not set this parameter unless you know exactly what you are doing,
355-
as our current versioning convention is to use DEFAULT_BRANCH for each
356-
package. This parameter may be removed in the future.
357-
358-
* **DEFAULT_PACKAGE_VERSION**: (Optional) The version of the package is set to
359-
this value when it is built. **Note:** If this field is not set, then you
360-
should provide a mechanism in the [build](#build-hook) hook to auto-determine
361-
the version from the source code.
362-
WARNING: This parameter will be removed in the near future, as we will rely on
363-
the changelog contained in the package's repository to get the package version
364-
in the future.
365-
366-
* **DEFAULT_PACKAGE_REVISION**: (Optional) The revision of the package is set to
367-
this value when it is built (note that the full version of a package is
368-
"_VERSION-REVISION_"). If unset, it defaults to value of environment variable
369-
DEFAULT_REVISION.
370-
WARNING: This parameter is currently unused and will be removed in the near
371-
future.
372-
373349
* **UPSTREAM_SOURCE_PACKAGE**: (Optional) Third-party packages that have an
374350
[update_upstream](#update-upstream-hook) hook and are updated from an Ubuntu
375351
source package should set this to the name of the source package.
@@ -644,15 +620,6 @@ use the `install_pkgs()` lib function to install packages.
644620
Next step is to add a [build()](#build) hook. It is recommended to use the
645621
`dpkg_buildpackage_default()` function.
646622

647-
Then you'll need to provide the version of the package. For packages created
648-
from an Ubuntu source package, it is advised to use the same version as was set
649-
in the source package. For other packages you can use any version you like (e.g.
650-
`1.0.0`). The version must be provided with:
651-
652-
```
653-
DEFAULT_PACKAGE_VERSION="<version>"
654-
```
655-
656623
Note that if you are using an Ubuntu source package, you should now be ready to
657624
build the package.
658625

@@ -717,14 +684,10 @@ In `config.sh`, you'll need to define two variables:
717684
* `DEFAULT_PACKAGE_GIT_URL`: the `https://` git URL for the source code of the
718685
package.
719686

720-
* `DEFAULT_PACKAGE_VERSION`: the version of the package. If unsure, just
721-
use `1.0.0`.
722-
723687
e.g.:
724688

725689
```
726690
DEFAULT_PACKAGE_GIT_URL="https://delphix.gitlab.com/<user>/<package>"
727-
DEFAULT_PACKAGE_VERSION="1.0.0"
728691
```
729692

730693
#### Step 2. Add package hooks

buildpkg.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright 2018, 2020 Delphix
3+
# Copyright 2018, 2021 Delphix
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ logmust check_running_system
2323
function usage() {
2424
[[ $# != 0 ]] && echo "$(basename "$0"): $*"
2525
echo "Usage: $(basename "$0") [-ch] [-g pkg_git_url]"
26-
echo " [-b pkg_git_branch] [-v pkg_version] [-r pkg_revision]"
26+
echo " [-b pkg_git_branch] [-r pkg_revision]"
2727
echo " package"
2828
echo ""
2929
echo " This script builds a package based on its config.sh. If '-u'"
@@ -36,7 +36,6 @@ function usage() {
3636
echo " -g override default git url for the package."
3737
echo " -b override default git branch for the package."
3838
echo " -c also run package's checkstyle hook."
39-
echo " -v override default version for package."
4039
echo " -r override default revision for package."
4140
echo " -h display this message and exit."
4241
echo ""
@@ -45,15 +44,13 @@ function usage() {
4544

4645
unset PARAM_PACKAGE_GIT_URL
4746
unset PARAM_PACKAGE_GIT_BRANCH
48-
unset PARAM_PACKAGE_VERSION
4947
unset PARAM_PACKAGE_REVISION
5048

5149
do_checkstyle=false
52-
while getopts ':b:cg:hr:v:' c; do
50+
while getopts ':b:cg:hr:' c; do
5351
case "$c" in
5452
g) export PARAM_PACKAGE_GIT_URL="$OPTARG" ;;
5553
b) export PARAM_PACKAGE_GIT_BRANCH="$OPTARG" ;;
56-
v) export PARAM_PACKAGE_VERSION="$OPTARG" ;;
5754
r) export PARAM_PACKAGE_REVISION="$OPTARG" ;;
5855
c) do_checkstyle=true ;;
5956
h) usage >&2 ;;

lib/common.sh

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,9 @@ function reset_package_config_variables() {
223223
local vars="
224224
PACKAGE_GIT_URL
225225
PACKAGE_GIT_BRANCH
226-
PACKAGE_GIT_VERSION
227-
PACKAGE_GIT_REVISION
226+
PACKAGE_VERSION
227+
PACKAGE_REVISION
228228
DEFAULT_PACKAGE_GIT_URL
229-
DEFAULT_PACKAGE_GIT_BRANCH
230-
DEFAULT_PACKAGE_GIT_VERSION
231-
DEFAULT_PACKAGE_GIT_REVISION
232229
PACKAGE_DEPENDENCIES
233230
UPSTREAM_SOURCE_PACKAGE
234231
UPSTREAM_GIT_URL
@@ -364,7 +361,7 @@ function load_package_config() {
364361

365362
#
366363
# Use different config sources to determine the values for:
367-
# PACKAGE_GIT_URL, PACKAGE_GIT_BRANCH, PACKAGE_VERSION, PACKAGE_REVISION
364+
# PACKAGE_GIT_URL, PACKAGE_GIT_BRANCH, PACKAGE_REVISION
368365
#
369366
# The sources for the config, in decreasing order of priority, are:
370367
# 1. Command line parameters passed to build script.
@@ -401,39 +398,20 @@ function get_package_config_from_env() {
401398
elif [[ -n "${!var}" ]]; then
402399
PACKAGE_GIT_BRANCH="${!var}"
403400
echo "PACKAGE_GIT_BRANCH set to value of ${var}"
404-
elif [[ -n "$DEFAULT_PACKAGE_GIT_BRANCH" ]]; then
405-
PACKAGE_GIT_BRANCH="$DEFAULT_PACKAGE_GIT_BRANCH"
406-
echo "PACKAGE_GIT_BRANCH set to value of" \
407-
"DEFAULT_PACKAGE_GIT_BRANCH"
408401
fi
409402

410403
if [[ -z "$PACKAGE_GIT_BRANCH" ]]; then
411404
PACKAGE_GIT_BRANCH="$DEFAULT_GIT_BRANCH"
412405
echo "PACKAGE_GIT_BRANCH set to value of DEFAULT_GIT_BRANCH"
413406
fi
414407

415-
var="${PACKAGE_PREFIX}_VERSION"
416-
if [[ -n "$PARAM_PACKAGE_VERSION" ]]; then
417-
PACKAGE_VERSION="$PARAM_PACKAGE_VERSION"
418-
echo "PACKAGE_VERSION passed from '-v'"
419-
elif [[ -n "${!var}" ]]; then
420-
PACKAGE_VERSION="${!var}"
421-
echo "PACKAGE_VERSION set to value of ${var}"
422-
elif [[ -n "$DEFAULT_PACKAGE_VERSION" ]]; then
423-
PACKAGE_VERSION="$DEFAULT_PACKAGE_VERSION"
424-
echo "PACKAGE_VERSION set to value of DEFAULT_PACKAGE_VERSION"
425-
fi
426-
427408
var="${PACKAGE_PREFIX}_REVISION"
428409
if [[ -n "$PARAM_PACKAGE_REVISION" ]]; then
429410
PACKAGE_REVISION="$PARAM_PACKAGE_REVISION"
430411
echo "PACKAGE_REVISION passed from '-r'"
431412
elif [[ -n "${!var}" ]]; then
432413
PACKAGE_REVISION="${!var}"
433414
echo "PACKAGE_REVISION set to value of ${var}"
434-
elif [[ -n "$DEFAULT_PACKAGE_REVISION" ]]; then
435-
PACKAGE_REVISION="$DEFAULT_PACKAGE_REVISION"
436-
echo "PACKAGE_REVISION set to value of DEFAULT_PACKAGE_REVISION"
437415
fi
438416

439417
if [[ -z "$PACKAGE_REVISION" ]]; then
@@ -443,13 +421,11 @@ function get_package_config_from_env() {
443421

444422
export PACKAGE_GIT_URL
445423
export PACKAGE_GIT_BRANCH
446-
export PACKAGE_VERSION
447424
export PACKAGE_REVISION
448425

449426
echo_bold "------------------------------------------------------------"
450427
echo_bold "PACKAGE_GIT_URL: $PACKAGE_GIT_URL"
451428
echo_bold "PACKAGE_GIT_BRANCH: $PACKAGE_GIT_BRANCH"
452-
echo_bold "PACKAGE_VERSION: $PACKAGE_VERSION"
453429
echo_bold "PACKAGE_REVISION: $PACKAGE_REVISION"
454430
echo_bold "------------------------------------------------------------"
455431
}
@@ -971,9 +947,23 @@ function push_to_remote() {
971947
# If no changelog file exists, source package name can be passed in first arg.
972948
#
973949
function set_changelog() {
974-
check_env PACKAGE_VERSION PACKAGE_REVISION
950+
check_env PACKAGE_REVISION
975951
local src_package="${1:-$PACKAGE}"
976952

953+
#
954+
# If PACKAGE_VERSION hasn't been set already, then retrieve it from
955+
# The changelog file. If the changelog file doesn't exist, which
956+
# could be the case for in-house packages where we do not care about
957+
# the version, then default to "1.0.0".
958+
#
959+
if [[ -z "$PACKAGE_VERSION" ]]; then
960+
if [[ -f debian/changelog ]]; then
961+
PACKAGE_VERSION="$(logmust dpkg-parsechangelog -S Version | awk -F'-' '{print $1}')"
962+
else
963+
PACKAGE_VERSION=1.0.0
964+
fi
965+
fi
966+
977967
logmust export DEBEMAIL="Delphix Engineering <eng@delphix.com>"
978968
if [[ -f debian/changelog ]]; then
979969
# update existing changelog

package-lists/build/main.pkgs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ bcc
77
bpftrace
88
challenge-response
99
cloud-init
10-
crash
1110
crash-python
1211
crypt-blowfish
1312
delphix-platform
1413
delphix-sso-app
1514
drgn
15+
docker-python-image
1616
gdb-python
1717
grub2
18+
host-jdks
1819
libkdumpfile
1920
make-jpkg
2021
makedumpfile

package-lists/update/main.pkgs

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/bpftrace/config.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# shellcheck disable=SC2034
1818

1919
DEFAULT_PACKAGE_GIT_URL="https://github.com/delphix/bpftrace.git"
20-
DEFAULT_PACKAGE_VERSION=1.0.0
2120
PACKAGE_DEPENDENCIES="bcc"
2221

2322
UPSTREAM_GIT_URL="https://github.com/iovisor/bpftrace.git"

packages/challenge-response/config.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# shellcheck disable=SC2034
1818

1919
DEFAULT_PACKAGE_GIT_URL="https://gitlab.delphix.com/os-platform/linux-dlpx-pkgs.git"
20-
DEFAULT_PACKAGE_VERSION="1.0.0"
2120

2221
function prepare() {
2322
logmust install_pkgs \

packages/cloud-init/config.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# shellcheck disable=SC2034
1818

1919
DEFAULT_PACKAGE_GIT_URL="https://github.com/delphix/cloud-init.git"
20-
# Note: we get the package version programatically in build()
2120

2221
UPSTREAM_SOURCE_PACKAGE=cloud-init
2322

@@ -31,10 +30,6 @@ function checkstyle() {
3130
}
3231

3332
function build() {
34-
logmust cd "$WORKDIR/repo"
35-
if [[ -z "$PACKAGE_VERSION" ]]; then
36-
logmust eval PACKAGE_VERSION="$(python3 tools/read-version)"
37-
fi
3833
logmust dpkg_buildpackage_default
3934
}
4035

packages/connstat/config.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# shellcheck disable=SC2034
1818

1919
DEFAULT_PACKAGE_GIT_URL="https://github.com/delphix/connstat.git"
20-
DEFAULT_PACKAGE_VERSION="1.0.0"
2120
PACKAGE_DEPENDENCIES="@linux-kernel"
2221

2322
function prepare() {

0 commit comments

Comments
 (0)