osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-dev/+/39819?usp=email )
Change subject: src/_update_src_copy: handle symlink projects
......................................................................
src/_update_src_copy: handle symlink projects
Handle projects that are symlinks to paths in other git repositories,
such as osmocom-bb_layer23 -> osmocom-bb/src/host/layer23.
Fix for:
_update_read_only_src_copy: find failed
Change-Id: Icfe701b8a237385597718374be50a8b81c6ac433
---
M src/_update_src_copy.sh
1 file changed, 41 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/19/39819/1
diff --git a/src/_update_src_copy.sh b/src/_update_src_copy.sh
index a0ea533..f13a357 100644
--- a/src/_update_src_copy.sh
+++ b/src/_update_src_copy.sh
@@ -61,6 +61,45 @@
done
}
+# Some project are symlinks to a path in another git repository (for example
+# osmocom-bb_layer23 -> osmocom-bb/src/host/layer23). For those we need to
+# add such a symlink to the src_copy dir and then run _update_src_copy.sh on
+# the main project (osmocom-bb in the example).
+handle_symlink_proj() {
+ local linkdest
+ local git_topdir
+ local proj_main
+ local relpath
+
+ if ! [ -L "$SRC_DIR/$PROJ" ]; then
+ return
+ fi
+
+ linkdest="$(realpath "$SRC_DIR/$PROJ")"
+ git_topdir="$(cd "$linkdest" && git rev-parse
--show-toplevel)"
+
+ if [ -z "$git_topdir" ]; then
+ "_update_src_copy: getting git topdir failed: $linkdest"
+ exit 1
+ fi
+
+ proj_main="$(basename "$git_topdir")"
+
+ # Create the symlink in src_copy
+ if ! [ -L "$DEST_DIR_PROJ" ]; then
+ relpath="$(realpath -s --relative-to="$git_topdir"
"$linkdest")"
+ if [ -z "$relpath" ]; then
+ "_update_src_copy: getting relpath failed: $linkdest"
+ exit 1
+ fi
+ ln -s "$proj_main/$relpath" "$DEST_DIR_PROJ"
+ fi
+
+ # Copy the original project files to src_copy
+ exec sh -e "$0" "$SRC_DIR" "$proj_main"
"$TIME_START"
+ # Not continuing below (exec)
+}
+
MAKE_DIR="$PWD"
SRC_DIR="$1"
PROJ="$2"
@@ -73,6 +112,8 @@
fi
DEST_DIR_PROJ="$MAKE_DIR/src_copy/$PROJ"
+handle_symlink_proj
+
COPY_LIST="$(mktemp --suffix=-osmo-dev-rsync-copylist)"
cd "$SRC_DIR/$PROJ"
--
To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/39819?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Icfe701b8a237385597718374be50a8b81c6ac433
Gerrit-Change-Number: 39819
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>