Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-24 11:04:07 +0200
committerErich Eckner <git@eckner.net>2017-10-24 11:04:07 +0200
commit342b9e7ed96df0229c0217e421da9bcded7218d4 (patch)
tree58a8266b9900956567c411f858a721ea6b845efa /bin
parent706472f53bcd91e0307ec03c0ce5dd5c6679eba8 (diff)
bin/build-packages, bin/common-functions: namcap-smoothening: remove haskell hashes and architecture specific stuff, too
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-packages4
-rwxr-xr-xbin/common-functions22
2 files changed, 23 insertions, 3 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 4d38ee0..b06a1c7 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -343,9 +343,7 @@ while [ "${count}" -ne 0 ]; do
# now we generate diffs from the namcap.logs
find . "${tar_content_dir}/" -maxdepth 1 -type f -name '*.pkg.tar.xz-namcap.log' -printf '%p\n' | \
while read -r log; do
- sort_square_bracket_content "${log}" | \
- sort | \
- sponge "${log}"
+ smoothen_namcap_log "${log}"
done
find "${tar_content_dir}/" -maxdepth 1 -type f -name '*.pkg.tar.xz-namcap.log' -printf '%f\n' | \
sed '
diff --git a/bin/common-functions b/bin/common-functions
index 0845c74..1d0a6a5 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -1095,3 +1095,25 @@ sort_square_bracket_content() {
done < \
"${file}"
}
+
+# smoothen_namcap_log $file
+# remove unneccesary differences from namcap-logs:
+# - remove architecture specific information
+# - sort lines
+# - sort content of square brackets
+
+smoothen_namcap_log() {
+ local file
+ file="$1"
+ # shellcheck disable=SC2016
+ sort_square_bracket_content "${file}" | \
+ sed '
+ # normalize architecture specific information
+ s|i[34567]86|$ARCH|g
+ s|x86\([-_]64\)\?|$ARCH|g
+ # remove haskell hashes
+ '"s|\('[^']*-[0-9.]\+\)-[a-zA-Z0-9]\{1,22\}\(-ghc[^']*'\)|\1\2|g"'
+ ' | \
+ sort | \
+ sponge "${file}"
+}