-
-
Notifications
You must be signed in to change notification settings - Fork 402
Open
Labels
Description
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:
- mirror/snapshot/publish on a system having internet access,
/A/aptly - rsyncing the corresponding subtree to a external disk
- 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)
FelicianoTech and PhilippWendler