Skip to content

Commit

Permalink
create_dockerfile.sh: detect mismatch at package version in repositor…
Browse files Browse the repository at this point in the history
…y [skip ci]

(cherry picked from commit db68abb)
  • Loading branch information
linuxmaniac committed Jan 23, 2024
1 parent 535c3a7 commit 3e270cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion create_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ kam_packages() {
wget -q -O /tmp/Packages "${KAM_REPO}/dists/${dist}/main/binary-amd64/Packages"
fi
repo_version=$(awk '/Version:/ { print $2 }' /tmp/Packages| head -1)
awk -vver="${repo_version}" '/Package:/ { print $2"="ver}' /tmp/Packages | xargs
if [[ ${repo_version} =~ ^${version} ]] ; then
awk -vver="${repo_version}" '/Package:/ { print $2"="ver}' /tmp/Packages | xargs
else
echo "packages in repository \"deb ${KAM_REPO} ${dist} main\" doesn't match version: [${version}]" >&2
echo "version in repository: [${repo_version}]" >&2
fi
}

create_dockerfile() {
Expand Down Expand Up @@ -96,6 +101,7 @@ esac

KAM_REPO=$(get_kam_repo)
PKGS=$(kam_packages)
[ -n "${PKGS}" ] || exit 1
mkdir -p "${dist}"
DOCKERFILE="${dist}/Dockerfile"
create_dockerfile

0 comments on commit 3e270cb

Please sign in to comment.