From e5f2697c7126cc65ff494279e616541fe8fda0b4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 13 Dec 2021 14:45:16 +0100 Subject: Merging upstream version 20211213. Signed-off-by: Daniel Baumann --- CHANGELOG.txt | 8 +++++ VERSION.txt | 2 +- git/bin/git-checkout-branches | 7 +--- vim/Makefile | 80 +++++++++++++++++++++++++++++++++++++++++++ vim/bin/vim-mtime | 34 ++++++++++++++++++ 5 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 vim/Makefile create mode 100755 vim/bin/vim-mtime diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cf850f3..5b2fd5c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,11 @@ +2021-12-13 Daniel Baumann + + * Releasing version 20211213. + + [ Daniel Baumann ] + * Correcting current and default branch handling in git-checkout-branches. + * Adding vim-tools. + 2021-09-28 Daniel Baumann * Releasing version 20210928. diff --git a/VERSION.txt b/VERSION.txt index fbdb929..6fc1d23 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -20210928 +20211213 diff --git a/git/bin/git-checkout-branches b/git/bin/git-checkout-branches index f1aa862..e98345d 100755 --- a/git/bin/git-checkout-branches +++ b/git/bin/git-checkout-branches @@ -29,16 +29,11 @@ do BRANCH="$(echo "${REMOTE_BRANCH}" | cut -d/ -f 2-)" case "${BRANCH}" in - HEAD) + HEAD|${CURRENT_BRANCH}) continue ;; esac - if git branch | grep -Eq "^ *${BRANCH}$" - then - continue - fi - git checkout -b "${BRANCH}" "${REMOTE_BRANCH}" done diff --git a/vim/Makefile b/vim/Makefile new file mode 100644 index 0000000..3a2e4b9 --- /dev/null +++ b/vim/Makefile @@ -0,0 +1,80 @@ +# Open Infrastructure: service-tools + +# Copyright (C) 2014-2021 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +SHELL := sh -e + +SCRIPTS = bin/* + +all: build + +test: + @echo -n "Checking for syntax errors with sh... " + @for SCRIPT in $(SCRIPTS); \ + do \ + sh -n $${SCRIPT}; \ + echo -n "."; \ + done + @echo " done." + + @echo -n "Checking for bashisms... " + @if [ -x /usr/bin/checkbashisms ]; \ + then \ + for SCRIPT in $(SCRIPTS); \ + do \ + checkbashisms -f -x $${SCRIPT}; \ + echo -n "."; \ + done; \ + else \ + echo "Note: devscripts not installed, skipping checkbashisms."; \ + fi + @echo " done." + + @echo -n "Checking with shellcheck... " + @if [ -x /usr/bin/shellcheck ]; \ + then \ + for SCRIPT in $(SCRIPTS); \ + do \ + shellcheck -e SC2039 $${SCRIPT}; \ + echo -n "."; \ + done; \ + else \ + echo "Note: shellcheck not installed, skipping shellcheck."; \ + fi + @echo " done." + +build: + +install: build + mkdir -p $(DESTDIR)/usr/bin + cp -r bin/* $(DESTDIR)/usr/bin + +uninstall: + for FILE in bin/*; \ + do \ + rm -f $(DESTDIR)/usr/bin/$$(basename $${FILE}); \ + done + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/bin || true + + rmdir --ignore-fail-on-non-empty --parents $(DESTDIR) || true + +clean: + +distclean: + +reinstall: uninstall install diff --git a/vim/bin/vim-mtime b/vim/bin/vim-mtime new file mode 100755 index 0000000..d04e8ee --- /dev/null +++ b/vim/bin/vim-mtime @@ -0,0 +1,34 @@ +#!/bin/sh + +# Open Infrastructure: service-tools + +# Copyright (C) 2014-2021 Daniel Baumann +# +# SPDX-License-Identifier: GPL-3.0+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -e + +for FILE in "${@}" +do + TMPFILE="$(tmpfile vi-mtime.XXXX)" + + touch -r "${FILE}" "${TMPFILE}" + + vi "${FILE}" + + touch -r "${TMPFILE}" "${FILE}" + rm -f "${TMPFILE}" +done -- cgit v1.2.3