Skip to content

Commit 203e593

Browse files
DLPX-79631 Decide on a way to retain more of the Ubuntu revision information so that we can more easily determine what's in the package (#269)
* DLPX-79631 Decide on a way to retain more of the Ubuntu revision information so that we can more easily determine what's in the package PR URL: https://www.github.com/delphix/linux-pkg/pull/269
1 parent 2d6be93 commit 203e593

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

buildpkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ check_env DEFAULT_GIT_BRANCH
7373
# DEFAULT_REVISION & DEFAULT_GIT_BRANCH will be set if called from buildlist.sh.
7474
# If the script is called manually, we set it here.
7575
#
76-
DEFAULT_REVISION="${DEFAULT_REVISION:-$(default_revision)}"
76+
DEFAULT_REVISION="${DEFAULT_REVISION:-$(delphix_revision)}"
7777

7878
echo ""
7979
echo_bold "===================================================================="

checkupdates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ logmust check_package_exists "$PACKAGE"
5252
#
5353
# If the script is called manually, we set it here.
5454
#
55-
DEFAULT_REVISION="${DEFAULT_REVISION:-$(default_revision)}"
55+
DEFAULT_REVISION="${DEFAULT_REVISION:-$(delphix_revision)}"
5656

5757
logmust load_package_config "$PACKAGE"
5858
logmust create_workdir

lib/common.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ function create_workdir() {
446446
function install_pkgs() {
447447
for attempt in {1..3}; do
448448
echo "Running: sudo env DEBIAN_FRONTEND=noninteractive " \
449-
"apt-get install -y $*"
449+
"apt-get install -y --allow-downgrades $*"
450450

451451
sudo env DEBIAN_FRONTEND=noninteractive apt-get install \
452-
-y "$@" && return
452+
-y --allow-downgrades "$@" && return
453453

454454
echo "apt-get install failed, retrying."
455455
sleep 10
@@ -596,10 +596,11 @@ function install_kernel_headers() {
596596
done
597597
}
598598

599-
function default_revision() {
599+
function delphix_revision() {
600600
#
601601
# We use "delphix" in the default revision to make it easy to find all
602-
# packages built by delphix installed on an appliance.
602+
# packages built by delphix installed on an appliance. This will be used
603+
# along with DEFAULT_REVISION to get the full revision.
603604
#
604605
# We choose a timestamp as the second part since we want each package
605606
# built to have a unique value for its full version, as new packages
@@ -611,7 +612,7 @@ function default_revision() {
611612
# Delphix Appliance upgrades, however we prefer keeping things in-line
612613
# with the established conventions.
613614
#
614-
echo "delphix-$(date '+%Y.%m.%d.%H')"
615+
echo "delphix.$(date '+%Y.%m.%d.%H.%M')"
615616
}
616617

617618
function determine_dependencies_base_url() {
@@ -1004,6 +1005,7 @@ function push_to_remote() {
10041005
function set_changelog() {
10051006
check_env PACKAGE_REVISION
10061007
local src_package="${1:-$PACKAGE}"
1008+
local final_version
10071009

10081010
#
10091011
# If PACKAGE_VERSION hasn't been set already, then retrieve it from
@@ -1013,21 +1015,32 @@ function set_changelog() {
10131015
#
10141016
if [[ -z "$PACKAGE_VERSION" ]]; then
10151017
if [[ -f debian/changelog ]]; then
1016-
PACKAGE_VERSION="$(logmust dpkg-parsechangelog -S Version | awk -F'-' '{print $1}')"
1018+
PACKAGE_VERSION="$(logmust dpkg-parsechangelog -S Version)"
10171019
else
10181020
PACKAGE_VERSION=1.0.0
10191021
fi
10201022
fi
10211023

10221024
logmust export DEBEMAIL="Delphix Engineering <eng@delphix.com>"
1025+
if [[ "${PACKAGE_VERSION}" =~ '-' ]]; then
1026+
final_version="${PACKAGE_VERSION}+${PACKAGE_REVISION}"
1027+
else
1028+
final_version="${PACKAGE_VERSION}-1${PACKAGE_REVISION}"
1029+
fi
10231030
if [[ -f debian/changelog ]]; then
10241031
# update existing changelog
1025-
logmust dch -b -v "${PACKAGE_VERSION}-${PACKAGE_REVISION}" \
1032+
# We use a + or - to easily visualize the separation
1033+
# of the delphix revision. If there is no debian revision
1034+
# then we add a debian revision using - as the separator,
1035+
# If there is already a debian revision, we use + as the
1036+
# separator and update the revision.
1037+
1038+
logmust dch -b -v "$final_version" \
10261039
"Automatically generated changelog entry."
10271040
else
10281041
# create new changelog
10291042
logmust dch --create --package "$src_package" \
1030-
-v "${PACKAGE_VERSION}-${PACKAGE_REVISION}" \
1043+
-v "$final_version" \
10311044
"Automatically generated changelog entry."
10321045
fi
10331046
}

packages/zfs/config.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ function build() {
9595

9696
local hash
9797
logmust eval hash="$(git rev-parse --short HEAD)"
98-
logmust sed -i "s/^Release:.*/Release: $PACKAGE_REVISION-$hash/" \
99-
META || die "failed to set version"
98+
logmust sed -i "s/^Version:.*/Version: $PACKAGE_VERSION/" \
99+
META || die "failed to set Version"
100+
logmust sed -i "s/^Release:.*/Release: 1$PACKAGE_REVISION-$hash/" \
101+
META || die "failed to set Release"
100102
logmust set_changelog
101103

102104
#

push-merge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fi
5656

5757
logmust check_package_exists "$PACKAGE"
5858

59-
DEFAULT_REVISION="${DEFAULT_REVISION:-$(default_revision)}"
59+
DEFAULT_REVISION="${DEFAULT_REVISION:-$(delphix_revision)}"
6060
logmust load_package_config "$PACKAGE"
6161

6262
if [[ ! -d "$WORKDIR/repo" ]]; then

0 commit comments

Comments
 (0)