Skip to content
Merged
Changes from 3 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
34 changes: 33 additions & 1 deletion tools/migrate_gul14_to_gul17.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,29 @@ EOT
exit 1
fi

create_gul17_wrap_file() {
cat > "$1" << EOT
[wrap-git]
directory = gul17
url = https://github.com/gul-cpp/gul17.git
revision = main

[provide]
dependency_names = gul17
gul17 = libgul_dep
gul17_static = libgul_static_dep
gul17_shared = libgul_shared_dep
EOT
}

handle_control_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' \
-e 's/\[\s*'"'libgul14'"'\s*,\s*'"'libgul_dep'"'\s*\]/['"'gul17', 'gul17_dep']"'/g' \
-e "s/'libgul14'/'gul17'/g" \
"$1"
}

Expand Down Expand Up @@ -70,6 +89,19 @@ for dir in "$@"; do
\( -path "./${dir}/build*" -o -path "./${dir}/debian" -o -path "./${dir}/subprojects" \) -prune \
-o \( \( -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cpp" \) -print0 \) )

# Debian control file
if [ -f "${dir}/debian/control" ]; then
handle_control_file "${dir}/debian/control"
fi

# wrap file
if [ -d "${dir}/subprojects" ]; then
if [ ! -e "${dir}/subprojects/gul17.wrap" ]; then
echo "Creating gul17.wrap file in ${dir}/subprojects"
create_gul17_wrap_file "${dir}/subprojects/gul17.wrap"
fi
fi

fi
if [ "${mos_found}" = true ]; then
mos_subdirs+=${dir}
Expand Down
Loading