summaryrefslogtreecommitdiff
path: root/keyboard-leds-trayicons/debian/make-dsc-for-obs.sh
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-03-20 21:16:50 +0000
committerB Stack <bgstack15@gmail.com>2020-03-20 21:16:50 +0000
commit0e36a26fb2bbde0eb2cda69bd2e6435903804285 (patch)
treedfd7778291d9496922b89028f4763b3cf0456a0e /keyboard-leds-trayicons/debian/make-dsc-for-obs.sh
parentMerge branch 'mime_types_editor-bump' into 'master' (diff)
parentkeyboard-leds-trayicons 0.0.2: upstream Makefile (diff)
downloadstackrpms-0e36a26fb2bbde0eb2cda69bd2e6435903804285.tar.gz
stackrpms-0e36a26fb2bbde0eb2cda69bd2e6435903804285.tar.bz2
stackrpms-0e36a26fb2bbde0eb2cda69bd2e6435903804285.zip
Merge branch 'keyboard-leds-trayicons-bump' into 'master'
keyboard-leds-trayicons 0.0.2: upstream Makefile See merge request bgstack15/stackrpms!142
Diffstat (limited to 'keyboard-leds-trayicons/debian/make-dsc-for-obs.sh')
-rw-r--r--keyboard-leds-trayicons/debian/make-dsc-for-obs.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/keyboard-leds-trayicons/debian/make-dsc-for-obs.sh b/keyboard-leds-trayicons/debian/make-dsc-for-obs.sh
new file mode 100644
index 0000000..088b548
--- /dev/null
+++ b/keyboard-leds-trayicons/debian/make-dsc-for-obs.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Goal: convert the fresh dsc file to a generic one for obs that omits version and checksum info on filenames
+# Use in debian/rules:
+# APPNAME=name-of-binary-package
+# override_dh_auto_build:
+# dh_auto_build
+# sh debian/make-dsc-for-obs.sh
+tf="../$( find .. -maxdepth 1 -name "${APPNAME}_*dsc" -printf '%T@ %f\n' | sort | tail -n1 | awk '{print $NF}' )"
+of="debian/$( basename "$( readlink -f "${tf}" )" | sed -r -e 's/_[0-9_\.]+[0-9_](-[0-9])?//;' )"
+sed -r -e '/Checksums-.{0,8}:\s*$/,/^Files/{/Files/!{d};}' -e 's/^ [^\s]{32}/ 00000000000000000000000000000000/;' "${tf}" | awk 'BEGIN{a=0;cmd="tr -d '[0-9_+]'"} a > 0 {$2="1";gsub(/_[0-9_\.]+[0-9_](-[0-9])?/,"");} /^Files/{a=1} {print}' > "${of}"
bgstack15