From c7c4ec19a3f9e5bc3d2b351ed18e87427895d095 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 2 Aug 2013 22:56:48 +1200 Subject: [PATCH] Capture the repositories from source-repositories. We try to expose metadata to users about what dib included in the image and source-repositories was not doing that, so this fixes it. It also permits easy introspection from other elements (such as an upcoming PyPI cache layer). Change-Id: I1e48e65f69ebe1f4556cc3bf35ccf195e99bcc76 --- elements/source-repositories/README.md | 4 ++++ .../source-repositories/extra-data.d/98-source-repositories | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/elements/source-repositories/README.md b/elements/source-repositories/README.md index fefa1bfe..cdde51c8 100644 --- a/elements/source-repositories/README.md +++ b/elements/source-repositories/README.md @@ -38,3 +38,7 @@ it will be renamed to \ If mulitple elements register a source location with the same then source-repositories will exit with an error. Care should therefore be taken to only use elements together that download source to different locations. + +The repository paths built into the image are stored in +etc/dib-source-repositories, one repository per line. This permits later review +of the repositories (by users or by other elements). diff --git a/elements/source-repositories/extra-data.d/98-source-repositories b/elements/source-repositories/extra-data.d/98-source-repositories index 40c41792..75b372f3 100755 --- a/elements/source-repositories/extra-data.d/98-source-repositories +++ b/elements/source-repositories/extra-data.d/98-source-repositories @@ -88,7 +88,9 @@ function get_repos_for_element(){ return 1 ;; esac - + # Capture the in-instance repository path for later review / other + # elements (like a pypi dependency cache). + echo "$REPOPATH" | sudo dd of=$TMP_MOUNT_PATH/etc/dib-source-repositories oflag=append conv=notrunc else echo "Couldn't parse '$line' as a source repository" return 1