aboutsummaryrefslogtreecommitdiff
path: root/brep/handler
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-10-02 21:00:10 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-10-03 10:54:08 +0300
commit7a802970ae3ad01db83b9d7b30d5e35be8f1317e (patch)
tree63e41b8fd9fc302e32bd0040acbfb9dc0d00c411 /brep/handler
parent2e96f91a4c3a0e10e68ce19fb8fc3008b5aa795c (diff)
Relax constraint in upload-bindist by only forbidding leading dots in package-config manifest values
Diffstat (limited to 'brep/handler')
-rw-r--r--brep/handler/upload/upload-bindist.in23
1 files changed, 13 insertions, 10 deletions
diff --git a/brep/handler/upload/upload-bindist.in b/brep/handler/upload/upload-bindist.in
index 913b35a..05d0bcf 100644
--- a/brep/handler/upload/upload-bindist.in
+++ b/brep/handler/upload/upload-bindist.in
@@ -230,13 +230,13 @@ if [[ -z "$target" ]]; then
error "target manifest value expected"
fi
-# Let's disallow dots in the package-config manifest value since the latter
-# serves as the package configuration symlink name and the dot can be
-# misinterpreted by brep as an extension separator, which the implementation
-# relies upon.
+# Let's disallow the leading dot in the package-config manifest value since
+# the latter serves as the package configuration symlink name and brep skips
+# symlinks with the leading dots assuming them as hidden (see
+# mod/mod-package-version-details.cxx for details).
#
-if [[ "$package_config" == *"."* ]]; then
- exit_with_manifest 400 "package-config manifest value may not contain dot"
+if [[ "$package_config" == "."* ]]; then
+ exit_with_manifest 400 "package-config manifest value may not start with dot"
fi
# Extract the CPU component from the target triplet and deduce the binary
@@ -454,7 +454,8 @@ fi
# Create parent (doesn't fail if directory exists).
#
-run mkdir -p "$(dirname "$config_dir")"
+config_parent_dir="$(dirname "$config_dir")"
+run mkdir -p "$config_parent_dir"
created=
@@ -520,10 +521,12 @@ done
trace "+ (cd $config_dir && exec sha256sum -b ${package_file_paths[@]} >.packages.sha256)"
(cd "$config_dir" && exec sha256sum -b "${package_file_paths[@]}" >".packages.sha256")
-# Create the new package configuration symlink.
+# Create the new package configuration "hidden" symlink. Construct its name by
+# prepending the configuration directory name with a dot.
#
-config_link_new="$config_dir.symlink"
-run ln -s $(basename "$config_dir") "$config_link_new"
+config_dir_name="$(basename "$config_dir")"
+config_link_new="$config_parent_dir/.$config_dir_name"
+run ln -s "$config_dir_name" "$config_link_new"
# Switch the package configuration symlink atomically. But first, cache the
# previous package configuration symlink target if the --keep-previous option