Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tools/migrate_gul14_to_gul17.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Usage: $0 <directories>

This script will update C++ source files and meson.build files in the
given directories to migrate from GUL14 to GUL17. The given directories
are searched recursively.
should be the root directories of the projects, i.e. those that contain
the main meson.build file, the debian/ directory, and the src/ folder.

The migration happens in place, so make sure to have a backup (or a
recent git commit) of your files.
Expand Down Expand Up @@ -37,6 +38,10 @@ handle_control_file() {
sed -i -E -e 's/dev-doocs-libgul14/gul17-dev/g' "$1"
}

handle_gitlab_ci_file() {
sed -i -E -e 's/dev-doocs-libgul14/gul17-dev/g' "$1"
}

handle_meson_file() {
sed -i -E \
-e 's/(dependency\s*\(\s*)'"'libgul14'/\1'gul17'"'/g' \
Expand All @@ -50,6 +55,7 @@ handle_source_file() {
-e 's/(#include\s*)["<]gul17\/string_view.h[">]/\1<string_view>/g' \
-e 's/(#include\s*)["<]gul17\/optional.h[">]/\1<optional>/g' \
-e 's/(#include\s*)["<]gul17\/variant.h[">]/\1<variant>/g' \
-e 's/(#include\s*["<])gul17\/catch.h([">])/\1gul14\/catch.h\2/g' \
-e 's/gul14::/gul17::/g' \
-e 's/gul17::string_view/std::string_view/g' \
-e 's/gul17::optional/std::optional/g' \
Expand Down Expand Up @@ -93,6 +99,11 @@ for dir in "$@"; do
handle_control_file "${dir}/debian/control"
fi

# Gitlab CI file
if [ -f "${dir}/.gitlab-ci.yml" ]; then
handle_gitlab_ci_file "${dir}/.gitlab-ci.yml"
fi

# wrap file
if [ -d "${dir}/subprojects" ]; then
if [ ! -e "${dir}/subprojects/gul17.wrap" ]; then
Expand Down
Loading