diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-09-11 19:36:48 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-09-11 19:47:19 -0400 |
commit | 43f8ba8f90bfd2bae7b779da0aeabfbb50038798 (patch) | |
tree | a1ef92976b9cb3df178bed673b6a9cc956fd50c5 /tools/notsd-move | |
parent | 6eb4ef32385e786ec1910f274b1749dcfc623eee (diff) |
sync tools/ from postmove
Diffstat (limited to 'tools/notsd-move')
-rwxr-xr-x | tools/notsd-move | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/tools/notsd-move b/tools/notsd-move index a65d29e946..5ae639fe26 100755 --- a/tools/notsd-move +++ b/tools/notsd-move @@ -475,7 +475,6 @@ move_files() ( mkdir src/grp-journal.d mv -t src/grp-journal.d tmpfiles.d/journal-nocow.* mv -t src/grp-remote.d tmpfiles.d/systemd-remote.* - mv -T tmpfiles.d/systemd{,-journald}.tmpfiles.m4 mv -t src/systemd tmpfiles.d/systemd-tmpfs.tmpfiles* mv -t src/systemd xorg/??-systemd-user.*; rmdir xorg mv -t src/systemd-vconsole-setup man/vconsole.conf.xml @@ -660,7 +659,6 @@ move_files() ( ) breakup_makefile() ( - set -x mkdir -p build-aux/Makefile.{once,each}.{head,tail} touch .tmp.move.all @@ -740,43 +738,50 @@ breakup_zshcompletion() ( rm _systemd ) +run() ( + local tmp + tmp="$(mktemp --tmpdir)" + trap 'rm -f -- "$tmp"' EXIT + "$0" "$@" |& tail -n20 > "$tmp" || { r=$?; cat "$tmp"; return $r; } + return 0 +) + move() ( find . \( -name Makefile -o -name '*.mk' \) -delete >&2 echo ' => breakup_zshcompletion' - breakup_zshcompletion + run breakup_zshcompletion >&2 echo ' => move_files' - move_files + run move_files >&2 echo ' => breakup_makefile' - "$0" breakup_makefile |& tail -n20 > .tmp.log || { r=$?; cat .tmp.log; exit $r; } - rm .tmp.log + run breakup_makefile >&2 echo ' => ./tools/notsd-fixup' ./tools/notsd-fixup ) main() { - set -e - set -o pipefail - - if [[ $# -gt 0 ]]; then - "$@" - else - if [[ -n "$(git status -s)" ]] || [[ -n "$(git clean -xdn)" ]]; then - echo 'There are changes in the current directory.' >&2 - exit 1 - fi + if [[ -n "$(git status -s)" ]] || [[ -n "$(git clean -xdn)" ]]; then + echo 'There are changes in the current directory.' >&2 + exit 1 + fi - git checkout -b tmp/postmove + git checkout -b tmp/postmove - move + move - git add . - git commit -m './tools/notsd-move' - git merge -s ours notsystemd/postmove - git checkout notsystemd/postmove - git merge tmp/postmove - git branch -d tmp/postmove - fi + git add . + git commit -m './tools/notsd-move' + git merge -s ours notsystemd/postmove + git checkout notsystemd/postmove + git merge tmp/postmove + git branch -d tmp/postmove } -main "$@" +set -e +set -o pipefail +if [[ $# -gt 0 ]]; then + set -x; +else + set -- main +fi +"$@" |