Skip to content

Commit 0a4372c

Browse files
committed
Turn duplicate files into relative symlinks
1 parent 99aaa0b commit 0a4372c

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ You can replicate the commands executed by CI locally, from the rosdistro reposi
166166
```
167167
create_recipes --recipes config/recipes.yaml --recipes-dir ~/workspace/recipes --release-label hotdog --release-track hotdog --debian-version 0.0.0
168168
pull_distro_repositories --src-dir ~/workspace/src --github-key $GITHUB_KEY --rosdistro-index rosdistro/index.yaml --recipes config/recipes.yaml --clean
169-
generate_bundle_templates --src-dir ~/workspace/src --template-dir ~/workspace/templates --recipe ~/workspace/recipes/dev-bionic-hotdog.yaml
169+
generate_bundle_templates --src-dir ~/workspace/src --template-dir ~/workspace/debian --recipe ~/workspace/recipes/dev-bionic-hotdog.yaml
170170
```
171171

172172

Diff for: tailor_distro/debian_templates/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ENV DEBIAN_FRONTEND noninteractive
1414
ENV PYTHONUNBUFFERED 1
1515

1616
RUN apt-get update && apt-get install --no-install-recommends -y \
17-
locales curl gnupg sudo ccache software-properties-common expect
17+
locales curl gnupg sudo software-properties-common expect rdfind
1818
RUN locale-gen en_US.UTF-8
1919
ENV LANG en_US.UTF-8
2020

Diff for: tailor_distro/debian_templates/rules.j2

+16-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,21 @@ override_dh_strip:
7272
# We don't really care about calculating shlibdeps
7373
override_dh_shlibdeps:
7474

75+
# Fixup absolute and relative paths for installation target into /opt, don't touch .so libs
76+
# Remove all python bytecode
77+
# Find duplicate files, turn into relative symlinks
7578
override_dh_installdeb:
76-
# Fixup absolute and relative paths for installation target into /opt, don't touch .so libs
77-
find . -type f -exec grep -I -q . {} \; -print0 | xargs -0 sed -ri "s|($(CURDIR)/)?debian/tmp/opt|/opt|g" && \
78-
find . -name '*.pyc' -delete && \
79+
find $(INSTALL_DIR) -type f -exec grep -I -q . {} \; -print0 | xargs -0 sed -ri "s|($(CURDIR)/)?debian/tmp/opt|/opt|g" && \
80+
find $(INSTALL_DIR) -name '*.pyc' -delete && \
81+
rdfind -makesymlinks true $(INSTALL_DIR) && \
82+
find $(INSTALL_DIR) -type l -exec sh -c ' \
83+
for link do \
84+
target=$$(readlink "$$link"); \
85+
case "$$target" in \
86+
/*) \
87+
dir=$$(dirname "$$link"); \
88+
reltarget=$$(realpath --relative-to="$$dir" "$$target"); \
89+
ln -sfn "$$reltarget" "$$link";; \
90+
esac; \
91+
done' sh {} + && \
7992
dh_installdeb

0 commit comments

Comments
 (0)