summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcreate_tarball7
-rwxr-xr-xmisc/replace_includehints59
2 files changed, 63 insertions, 3 deletions
diff --git a/create_tarball b/create_tarball
index 62abb6d..166cf0d 100755
--- a/create_tarball
+++ b/create_tarball
@@ -152,13 +152,14 @@ if [ ! -e $TARBALL_DIR/$package.tar$TAR_SUFFIX ]; then
echo "Revision: $branch-$(git rev-parse HEAD)" >> .tdescminfo
date +"DateTime: %m/%d/%Y %H:%M" -u -d "@$(git log -1 --pretty=format:"%ct")" >> .tdescminfo
trap "rm $TARBALL_DIR/tar-$$; rm .tdescminfo; exit 1" INT
- find ./ -print0 | LC_ALL=C sort -z | \
+ find ./ | LC_ALL=C sort | \
+ egrep -v '(^|/)(\.git|\.gitmodules)(/|$)' | tr "\n" "\0" | \
tar c --no-recursion --null -T - \
--mode=u+rw,go=rX,a-s \
+ --owner=root --group=users \
--mtime "@$(git log -1 --pretty=format:"%ct")" \
- --owner=root --group=users --exclude .git --exclude .gitmodules \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
- --transform "s|^\.\(/\|$\)|$package\1|" ./ | \
+ --transform "s|^\.\(/\|$\)|$package\1|" | \
$COMPRESS -9 >$TARBALL_DIR/tar-$$ && \
mv $TARBALL_DIR/tar-$$ $TARBALL_DIR/$package.tar$TAR_SUFFIX || \
rm $TARBALL_DIR/tar-$$
diff --git a/misc/replace_includehints b/misc/replace_includehints
new file mode 100755
index 0000000..edccc89
--- /dev/null
+++ b/misc/replace_includehints
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# This script replaces <includehints> in TQt designer UI files
+# with global <include>'s, removing duplicate includes.
+#
+# The reasons for this is that includehints are not well supported
+# and can cause FTBFS.
+#
+# Copyright (C) 2022 Mavridis Philippe <mavridisf@gmail.com>
+# for the Trinity Desktop Project
+#
+# Licensed under GNU GPLv2 or later.
+#
+
+# Find files needing update
+TO_REPLACE=$(find * -name \*.ui -exec grep -l includehint '{}' \;)
+
+if [[ ${#TO_REPLACE} == 0 ]]
+then
+ echo "No files need to be modified."
+ exit 0
+fi
+
+echo "Files that will be modified:"
+for f in $TO_REPLACE
+do
+ echo " - $f"
+done
+
+echo
+echo "Press any key to continue to ^C to cancel."
+read
+
+# Start replacing
+declare -a headers
+for f in $TO_REPLACE
+do
+ echo "Updating file '$f'..."
+
+ # Replace containing tag
+ sed -Ei 's!<(\/?)includehints>!<\1includes>!g' $f
+
+ # Replace includes themselves while avoiding duplicates (a simple
+ # sed -Ei 's/<includehint>([[:alnum:]\/.]*)</includehint>/<include location="global" impldecl="in implementation">\1</include>/g' $f
+ # would leave duplicates behind).
+ headers=()
+ for h in $(grep -o "<includehint>[[:alnum:]\/.]*</includehint>" $f | sed -E 's/<\/?includehint>//g')
+ do
+ if [[ ! "${headers[*]}" =~ $h ]] # if this is a unique header
+ then
+ echo " - $h"
+ sed -i "0,/<includehint>$h<\/includehint>/{s//<include location=\"global\" impldecl=\"in implementation\">$h<\/include>/}" $f
+ headers+=($h)
+ fi
+ done
+
+ # Remove leftover duplicate includehints
+ sed -Ei '/<includehint>([[:alnum:]\/.]*)<\/includehint>/d' $f
+done