Skip to content

Commit

Permalink
Merge pull request #43 from gardenlinux/fix/42-version-with-epoch
Browse files Browse the repository at this point in the history
Handle version with epoch.
  • Loading branch information
alee-ntap authored Dec 5, 2023
2 parents 7ae2d03 + fe5399a commit 0750e60
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions container/bin/build_archdep
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ main() (
cd src
pkg="$(dpkg-parsechangelog --show-field Source)"
version="$(dpkg-parsechangelog --show-field Version)"
# Use package's version name without epoch
pkg_version="${version#*:}"
dpkg-buildpackage --no-sign --build=any
cd ..
rm -rf src
ls -lah

if [ -d "/output" ]; then
{ echo "${pkg}_${version}_${dpkg_arch}.changes"; get_files < "${pkg}_${version}_${dpkg_arch}.changes"; } | while read file; do
{ echo "${pkg}_${pkg_version}_${dpkg_arch}.changes"; get_files < "${pkg}_${pkg_version}_${dpkg_arch}.changes"; } | while read file; do
sudo cp -d "$file" "/output/$file"
done
fi

echo "${pkg}_${version}_${dpkg_arch}" >&3
echo "${pkg}_${pkg_version}_${dpkg_arch}" >&3
)

get_files() (
Expand Down
6 changes: 4 additions & 2 deletions container/bin/build_indep
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ main() (
cd src
pkg="$(dpkg-parsechangelog --show-field Source)"
version="$(dpkg-parsechangelog --show-field Version)"
# Use package's version name without epoch
pkg_version="${version#*:}"
dpkg-buildpackage --no-sign --build=all
cd ..
rm -rf src
ls -lah

if [ -d "/output" ]; then
{ echo "${pkg}_${version}_all.changes"; get_files < "${pkg}_${version}_all.changes"; } | while read file; do
{ echo "${pkg}_${pkg_version}_all.changes"; get_files < "${pkg}_${pkg_version}_all.changes"; } | while read file; do
sudo cp -d "$file" "/output/$file"
done
fi

echo "${pkg}_${version}_all" >&3
echo "${pkg}_${pkg_version}_all" >&3
)

get_files() (
Expand Down
13 changes: 9 additions & 4 deletions container/bin/build_source
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ main() (

pkg="$(dpkg-parsechangelog --show-field Source)"
version="$(dpkg-parsechangelog --show-field Version)"
# Version for the orig tarball should not contains epoch
version="${version#*:}"
# Version for the orig tarball should not contains revision
version_orig="${version%-*}"
if [ -f ../orig.tar ]; then
xz < ../orig.tar > "../${pkg}_${version_orig}.orig.tar.xz"
Expand All @@ -70,18 +73,20 @@ main() (
echo "$DEB_BUILD_OPTIONS" > .build_options
echo "$DEB_BUILD_PROFILES" > .build_profiles
echo "${pkg}" > .source_name
echo "${version}" > .source_version
ln -s "${pkg}_${version}.dsc" .source
# The package version should not contains epoch
pkg_version="${version#*:}"
echo "${pkg_version}" > .source_version
ln -s "${pkg}_${pkg_version}.dsc" .source

# Copy all artifacts to the dedicated output directory
if [ -d "/output" ]; then
{ echo .build_options; echo .build_profiles; echo .source_name; echo .source_version; echo .source; echo "${pkg}_${version}.dsc"; get_files < "${pkg}_${version}.dsc"; } | while read file; do
{ echo .build_options; echo .build_profiles; echo .source_name; echo .source_version; echo .source; echo "${pkg}_${pkg_version}.dsc"; get_files < "${pkg}_${pkg_version}.dsc"; } | while read file; do
sudo cp -d "$file" "/output/$file"
done
fi

# Finally, print the package name and version
echo "${pkg}_${version}" >&3
echo "${pkg}_${pkg_version}" >&3
)

apt_source() (
Expand Down

0 comments on commit 0750e60

Please sign in to comment.