Skip to content

Commit

Permalink
attempt to ignore epoch from version string before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
joshschmelzle authored Feb 14, 2025
1 parent 0328d9f commit 357ceb7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ build_packages()

# Get upstream version. E.g. version 1.2.3-4wlanpi1 will be 1.2.3
current_version="$(cd ${package_path}; dpkg-parsechangelog --show-field Version)"
current_upstream_version=${current_version%%-*}

current_version_no_epoch=${current_version#*:}
current_upstream_version=${current_version_no_epoch%%-*}

# Debian build version. E.g. 1.2.3-4wlanpi1 will be 4
current_deb_version=${current_version%wlanpi*}
current_deb_version=${current_deb_version#*-}
Expand All @@ -180,10 +181,10 @@ build_packages()
log "info" "current_upstream_version: ${current_upstream_version}"

deb_version="1"
if $(dpkg --compare-versions "${package_version}" eq "${current_upstream_version}"); then
if $(dpkg --compare-versions "${package_version}" eq "${current_upstream_version#*:}"); then
log "warn" "Upstream version is the same as last built. Incrementing debian build number."
deb_version=$((current_deb_version+1))
elif $(dpkg --compare-versions "${package_version}" lt "${current_upstream_version}"); then
elif $(dpkg --compare-versions "${package_version}" lt "${current_upstream_version#*:}"); then
log "warn" "Trying to build an old version of upstream source. Please check version information. Skipping build."
continue
fi
Expand Down

0 comments on commit 357ceb7

Please sign in to comment.