Skip to content

when publishing, use relative symbolic links #783

@pfelecan

Description

@pfelecan

When publishing a snapshot, the pool contains the packages tree, with a absolute symbolic link toward the mirror's pool.

Is it possible to use relative symbolic links instead of absolute ones?

This is useful when moving the aptly tree to another system and/or directory tree.

My use case is the following:

  1. mirror/snapshot/publish on a system having internet access, /A/aptly
  2. rsyncing the corresponding subtree to a external disk
  3. rsyncing from the external disk on another system, which is a server for an isolated network; as it happens, the target system has a different tree in which the subtree is inserted /B/aptly

Currently, I'm doing the following, before the step 2:

# rectify symbolic links: absolute to relative:
publishDirectory="/mirrors/debian/published"
while read symlink
do
{
	target="$(ls -l "${symlink}" | sed --expression='s/^.*-> //' --expression 's:^/mirrors/debian/:../../../../../../../:')"
	ln --symbolic --force "${target}" "${symlink}" ||
		Error "cannot create symbolic link toward '${target}'!"
}
done < <(find "${publishDirectory}" -type l | sort)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions