Merge branch 'ecne' of git.cmxsl.org:CMXSL.org/package-helpers-cmxsl into ecne-cmxsl

This commit is contained in:
Ark74 2025-09-27 21:47:26 -06:00
commit 864e63539c
140 changed files with 4519 additions and 7721 deletions

View file

@ -81,12 +81,35 @@ pkgversion(){
replace(){
find ${@:3} -type f -not -iregex '.*changelog.*' -not -iregex '.*copyright.*' -execdir /bin/sed --follow-symlinks -i s^"$1"^"$2"^g {} \;
}
changelog_multiline() {
local msg="$1"
local version="${2:-$FULLVERSION}"
local dist="${3:-$REPO}"
# Iniciar changelog si la versión aún no está
if ! grep -q "$version" debian/changelog 2>/dev/null; then
dch -v "$version" -D "$dist" ""
fi
local count=0
while IFS= read -r line || [ -n "$line" ]; do
dch -a "$line"
count=$((count + 1))
done <<< "$msg"
if [ "$count" -gt 0 ]; then
dch -r ""
fi
}
changelog(){
head -n 1 debian/changelog | grep -q $UPSTREAM-security && REPO=$CODENAME-security || REPO=$CODENAME
[ "$SECURITY" = true ] && REPO=${CODENAME}-security
[ "$BACKPORT" = true ] || [ "$BACKPORTS" = true ] && REPO=${CODENAME}-backports
#Name convention issue "+" breaking packages build like console-setup, using "-" instead.
echo | dch -D $REPO -v $FULLVERSION "$1"
local msg="$1"
changelog_multiline "$msg" "$FULLVERSION" "$REPO"
# Make sure the changelog file is identical between archs
/bin/sed "/-- Desarrollo/s/.*/ -- Desarrollo CMXSL <devel@cmxsl.org> $DATE/" -i debian/changelog
@ -196,7 +219,7 @@ cd source
UPSTREAMVERSION=$(dpkg-parsechangelog --show-field Version)
export FULLVERSION=$(dpkg-parsechangelog --show-field Version)cmxsl${VERSION}
export FULLVERSION=$(dpkg-parsechangelog --show-field Version)trisquel${VERSION}cmxsl${CMXSLVER}
# Use 3.0 (native) deb source format
[ -f debian/source/format ] && echo "3 (native)" > debian/source/format
@ -209,7 +232,7 @@ package(){
# Make sure the series file is formated correctly after removals
if [ -f debian/patches/series ]; then
grep -q [a-z] debian/patches/series || echo -n > debian/patches/series
grep -q [a-z] debian/patches/series || : > debian/patches/series
fi
if [ 1$QUILT != 1skip ]; then
@ -280,6 +303,7 @@ fi
}
remove_patch(){
echo "> Removing patch $1 in progress..."
rm "$(find */patches -name "$1")"
sed -i "/$1/d" debian/patches/series
}