Compare commits
No commits in common. "a5faddf900eedd6864e09080df601fe16cb42c1d" and "be5369c1957374c7f2614c7f8a18cd13f3e29ade" have entirely different histories.
a5faddf900
...
be5369c195
1 changed files with 33 additions and 94 deletions
|
|
@ -69,104 +69,43 @@ echo_info " beast-dump: $(file "$DEB_DIR/usr/bin/beast-dump")"
|
||||||
chmod +x "$DEB_DIR/usr/bin/skyview"
|
chmod +x "$DEB_DIR/usr/bin/skyview"
|
||||||
chmod +x "$DEB_DIR/usr/bin/beast-dump"
|
chmod +x "$DEB_DIR/usr/bin/beast-dump"
|
||||||
|
|
||||||
# Generate incremental changelog from git history
|
# Generate changelog from git history
|
||||||
echo_info "Generating incremental changelog from git history..."
|
echo_info "Generating changelog from git history..."
|
||||||
CHANGELOG_DIR="$DEB_DIR/usr/share/doc/skyview-adsb"
|
CHANGELOG_DIR="$DEB_DIR/usr/share/doc/skyview-adsb"
|
||||||
mkdir -p "$CHANGELOG_DIR"
|
mkdir -p "$CHANGELOG_DIR"
|
||||||
|
|
||||||
# Function to generate incremental changelog
|
# Get the current version and previous version
|
||||||
generate_incremental_changelog() {
|
CURRENT_VERSION=$(git describe --tags --always)
|
||||||
local changelog_file="$1"
|
PREV_VERSION=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
# Get all tags in reverse chronological order
|
if [ -n "$PREV_VERSION" ]; then
|
||||||
local tags
|
echo_info "Generating changelog from $PREV_VERSION to $CURRENT_VERSION"
|
||||||
tags=$(git tag -l --sort=-version:refname)
|
# Create changelog with proper Debian format
|
||||||
|
|
||||||
# If no tags exist, create a single entry for current state
|
|
||||||
if [ -z "$tags" ]; then
|
|
||||||
local current_version
|
|
||||||
current_version=$(git describe --tags --always)
|
|
||||||
echo_info "No tags found, generating initial changelog for $current_version"
|
|
||||||
{
|
{
|
||||||
echo "skyview-adsb ($current_version) unstable; urgency=medium"
|
echo "skyview-adsb ($CURRENT_VERSION) unstable; urgency=medium"
|
||||||
|
echo ""
|
||||||
|
echo " Changes since $PREV_VERSION:"
|
||||||
|
git log --pretty=format:" * %s" "$PREV_VERSION..HEAD" | head -20
|
||||||
|
echo ""
|
||||||
|
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
|
||||||
|
echo ""
|
||||||
|
} > "$CHANGELOG_DIR/changelog"
|
||||||
|
else
|
||||||
|
echo_info "No previous version found, generating initial changelog"
|
||||||
|
# Create initial changelog
|
||||||
|
{
|
||||||
|
echo "skyview-adsb ($CURRENT_VERSION) unstable; urgency=medium"
|
||||||
echo ""
|
echo ""
|
||||||
echo " * Initial release"
|
echo " * Initial release"
|
||||||
echo " * Multi-source ADS-B aircraft tracker with Beast format support"
|
echo " * Multi-source ADS-B aircraft tracker with Beast format support"
|
||||||
echo ""
|
echo ""
|
||||||
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
|
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
|
||||||
echo ""
|
echo ""
|
||||||
} > "$changelog_file"
|
} > "$CHANGELOG_DIR/changelog"
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create empty changelog
|
# Compress changelog as per Debian standards
|
||||||
: > "$changelog_file"
|
gzip -9 "$CHANGELOG_DIR/changelog"
|
||||||
|
|
||||||
# Add entry for current development version if there are commits after the last tag
|
|
||||||
local latest_tag
|
|
||||||
latest_tag=$(echo "$tags" | head -n1)
|
|
||||||
local commits_since_tag
|
|
||||||
commits_since_tag=$(git rev-list "$latest_tag"..HEAD --count 2>/dev/null || echo 0)
|
|
||||||
|
|
||||||
if [ "$commits_since_tag" -gt 0 ]; then
|
|
||||||
local current_version
|
|
||||||
current_version=$(git describe --tags --always)
|
|
||||||
echo_info "Adding entry for current development version: $current_version"
|
|
||||||
{
|
|
||||||
echo "skyview-adsb ($current_version) unstable; urgency=medium"
|
|
||||||
echo ""
|
|
||||||
git log --pretty=format:" * %s" "$latest_tag"..HEAD | head -20
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
echo " -- $(git config user.name) <$(git config user.email)> $(date -R)"
|
|
||||||
echo ""
|
|
||||||
} >> "$changelog_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Process all tags to create incremental changelog
|
|
||||||
local prev_tag=""
|
|
||||||
for tag in $tags; do
|
|
||||||
echo_info "Processing version $tag"
|
|
||||||
|
|
||||||
# Get tag date and author info
|
|
||||||
local tag_date
|
|
||||||
tag_date=$(git log -1 --format=%aD "$tag")
|
|
||||||
local tag_author
|
|
||||||
tag_author=$(git log -1 --format='%an <%ae>' "$tag")
|
|
||||||
|
|
||||||
# Add version header
|
|
||||||
{
|
|
||||||
echo "skyview-adsb ($tag) unstable; urgency=medium"
|
|
||||||
echo ""
|
|
||||||
} >> "$changelog_file"
|
|
||||||
|
|
||||||
# Add changes for this version
|
|
||||||
if [ -n "$prev_tag" ]; then
|
|
||||||
# Show changes between this tag and the previous one
|
|
||||||
git log --pretty=format:" * %s" "$tag..$prev_tag" | head -20 >> "$changelog_file"
|
|
||||||
else
|
|
||||||
# For the oldest tag, show changes from the beginning
|
|
||||||
git log --pretty=format:" * %s" "$tag" | head -20 >> "$changelog_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add footer
|
|
||||||
{
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
echo " -- $tag_author $tag_date"
|
|
||||||
echo ""
|
|
||||||
} >> "$changelog_file"
|
|
||||||
|
|
||||||
prev_tag="$tag"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Generate the incremental changelog
|
|
||||||
generate_incremental_changelog "$CHANGELOG_DIR/changelog"
|
|
||||||
echo_info "Generated incremental changelog with $(grep -c '^skyview-adsb (' "$CHANGELOG_DIR/changelog") version entries"
|
|
||||||
|
|
||||||
# Compress changelog as per Debian standards (force overwrite if exists)
|
|
||||||
gzip -9f "$CHANGELOG_DIR/changelog"
|
|
||||||
echo_info "Generated changelog: $CHANGELOG_DIR/changelog.gz"
|
echo_info "Generated changelog: $CHANGELOG_DIR/changelog.gz"
|
||||||
|
|
||||||
# Get package info
|
# Get package info
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue