From 587876f79a64dffbdb82304d2ae76c7ff35f6046 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Mon, 20 Aug 2018 15:15:35 +0200 Subject: [PATCH] Adding sha256 update script for arch #304. --- .../update-pkgconfig-sha256-on-repo-change.sh | 38 +++++++++++++++++++ build/test-clean.sh | 14 +++++++ build/test-set-env-monster-history.sh | 14 +++++++ build/test-set-env-utf8-history.sh | 14 +++++++ 4 files changed, 80 insertions(+) create mode 100755 build/arch/update-pkgconfig-sha256-on-repo-change.sh diff --git a/build/arch/update-pkgconfig-sha256-on-repo-change.sh b/build/arch/update-pkgconfig-sha256-on-repo-change.sh new file mode 100755 index 0000000..153de57 --- /dev/null +++ b/build/arch/update-pkgconfig-sha256-on-repo-change.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Copyright (C) 2014-2018 Martin Dvorak +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script should be made Git hook to update Sha256 in ArchLinux PKGBUILD +# See also: https://github.com/dvorka/hstr/issues/304 + +fixPkgbuildSha256() { + cd ../.. + + if [ ! -f ./PKGBUILD ]; then + echo "No PKGBUILD in `pwd`" + return 1 + fi + + local sums + # calculate new md5sums + sums=$(makepkg -g) + # replace them in-place + sed -i "s/^md5sums=.*/%NEWSUMS%/;/'[a-z0-9]\{32\}'/d;s/%NEWSUMS%/$sums/" PKGBUILD + echo "PKGBUILD updated" +} + +fixPkgbuildSha256 + +# eof diff --git a/build/test-clean.sh b/build/test-clean.sh index 8e07c81..72a8763 100755 --- a/build/test-clean.sh +++ b/build/test-clean.sh @@ -1,4 +1,18 @@ #!/bin/bash +# +# Copyright (C) 2014-2018 Martin Dvorak +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. cd ../test && make clean && rm -vf _* hstr-unit-tests Makefile diff --git a/build/test-set-env-monster-history.sh b/build/test-set-env-monster-history.sh index 83bb601..6505f3b 100755 --- a/build/test-set-env-monster-history.sh +++ b/build/test-set-env-monster-history.sh @@ -1,4 +1,18 @@ #!/bin/bash +# +# Copyright (C) 2014-2018 Martin Dvorak +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. export HISTCONTROL=ignorespace export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_same diff --git a/build/test-set-env-utf8-history.sh b/build/test-set-env-utf8-history.sh index 0bb7926..3d6c910 100755 --- a/build/test-set-env-utf8-history.sh +++ b/build/test-set-env-utf8-history.sh @@ -1,4 +1,18 @@ #!/bin/bash +# +# Copyright (C) 2014-2018 Martin Dvorak +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. export HISTFILE=~/p/hstr/github/hstr/tests/resources/.bash_history_cz