From efe47381c599b07e4c7bbdb2e91e8090a541c887 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:53:52 +0200 Subject: Adding upstream version 2.23.4+deb12u1. Signed-off-by: Daniel Baumann --- scripts/list-unreleased.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 scripts/list-unreleased.sh (limited to 'scripts/list-unreleased.sh') diff --git a/scripts/list-unreleased.sh b/scripts/list-unreleased.sh new file mode 100755 index 0000000..05ed06b --- /dev/null +++ b/scripts/list-unreleased.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +# Script searches for packages with pending changes (UNRELEASED) and +# either lists them or displays the relevant changelog entry. + +# Usage: list-unreleased [-cR] +# -c : display pending changes +# -R : don't recurse + +# Copyright: Frans Pop , 2007 +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. + +PATHS="" +DO_CL="" +RECURSE=1 + +while true; do + case "$1" in + "") + break ;; + -c) + DO_CL=1 + ;; + -R) + RECURSE= + ;; + -*) + echo "unrecognized argument '$1'" + exit 1 + ;; + *) + PATHS="${PATHS:+$PATHS }$1" + ;; + esac + shift +done + +[ "$PATHS" ] || PATHS=. + +vcs_dirs='\(\.\(svn\|hg\|git\|bzr\)\|_darcs\|_MTN\|CVS\)' +get_list() { + local path="$1" + + for dir in $( + if [ "$RECURSE" ]; then + find "$path" -type d ! -regex "$vcs_dirs" + else + find "$path" -maxdepth 1 -type d ! -regex "$vcs_dirs" + fi + ); do + changelog="$dir/debian/changelog" + if [ -f "$changelog" ] ; then + if head -n1 "$changelog" | grep -q UNRELEASED; then + echo $dir + fi + fi + done | sort +} + +print_cl() { + local package="$1" + changelog="$package/debian/changelog" + + # Check if more than one UNRELEASED entry at top of changelog + Ucount=$(grep "^[^ ]" $changelog | \ + head -n2 | grep -c UNRELEASED) + if [ $Ucount -eq 1 ]; then + sed -n "1,/^ --/p" $changelog + else + echo "ERROR: changelog has more than one UNRELEASED entry!" + # Second sed is to add back a blank line between entries + sed -n "/^[^ ].*UNRELEASED/,/^ --/p" $changelog | \ + sed '2,$s/^\([^ ]\)/\n\1/' + fi +} + +first="" +for path in $PATHS; do + if [ -z "$DO_CL" ]; then + echo "$(get_list "$path" | sed "s:^\./::")" + else + for package in $(get_list "$path"); do + [ -z "$first" ] || echo -e "\n====================\n" + first=1 + + print_cl "$package" + done + fi +done -- cgit v1.2.3