diff --git a/.gitmodules b/.gitmodules index 49f4726..dab3bb5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -247,3 +247,6 @@ [submodule "pkg/forklift-git"] path = pkg/forklift-git url = https://aur.archlinux.org/forklift-git.git +[submodule "pkg/dotfiles"] + path = pkg/dotfiles + url = https://git.privacy1st.de/langfingaz/dotfiles.git diff --git a/README.md b/README.md index 74b6e8f..485e5c5 100644 --- a/README.md +++ b/README.md @@ -21,27 +21,11 @@ To initialize the submodules, run git submodule init ``` -To update all submodules and print a list of those who received an update, run +To update all submodules and add those who received an update to +[build-pkg/pkglist.tmp](build-pkg/pkglist.tmp), run ```shell -if output="$(git submodule update --remote 2>&1)"; then - # We capture only the part after "pkg" until the next "'" using sed - # Source: https://unix.stackexchange.com/a/165590/315162 - sed 's|^Submodule path '\''pkg/\([^'\'']*\).*|\1|' <<< "$output" -else - echo "$output" -fi -``` - -It may happen that some submodules have a detached HEAD (due to local changes, etc.) -and do not get updated with the above command. One can list those submodules as follows: - -```shell -git submodule status | grep --invert-match '(heads/master)$' - -# One could then reset them to master with e.g. -# git reset --hard -# git checkout master +git submodule foreach 'if git pull | grep '\''^Updating'\''; then printf " %s" "$(basename $sm_path)" >> $toplevel/build-pkg/pkglist.tmp; fi' ```