Skip to content

Commit ab64a31

Browse files
committed
fix(guix-local-channel): preserve channel repo semantics during patching, readablity improvements(src_dir -> channel_repo)
1 parent ff99ac9 commit ab64a31

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

steps-guix/improve/guix-daemon-and-pull.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ prepare_local_channel_checkout() {
123123
rendered_patch="/tmp/guix-bootstrap-local-seeds.patch"
124124
rendered_mes_patch="/tmp/guix-bootstrap-local-mes-extra.patch"
125125
static_patch=""
126+
channel_patch_link=""
126127

127128
if [ ! -x "${guix_seed_helper}" ]; then
128129
echo "Missing Guix seed helper: ${guix_seed_helper}" >&2
@@ -161,12 +162,17 @@ prepare_local_channel_checkout() {
161162
fi
162163

163164
(
164-
cd "${src_dir}"
165+
channel_patch_link="$(dirname "${channel_repo}")/guix-1.5.0"
166+
trap 'rm -f "${channel_patch_link}"' EXIT HUP INT TERM
167+
168+
ln -s "$(basename "${channel_repo}")" "${channel_patch_link}"
169+
cd "${channel_repo}"
165170
for static_patch in "${guix_patch_dir}"/*.patch; do
166171
patch -d.. -Np0 < "${static_patch}"
167172
done
168173
patch -p1 < "${rendered_patch}"
169174
patch -p1 < "${rendered_mes_patch}"
175+
rm -f "${channel_patch_link}"
170176
git init -q
171177
git add -A
172178
git -c user.name='guix-local' -c user.email='guix-local@example.invalid' commit -q -m 'local guix channel snapshot'
@@ -266,10 +272,10 @@ if [ -z "${src_dir}" ]; then
266272
exit 1
267273
fi
268274

269-
prepare_local_channel_checkout
270-
271275
mv "${src_dir}" "${channel_repo}"
272276

277+
prepare_local_channel_checkout
278+
273279
channel_commit="$(git -C "${channel_repo}" rev-parse HEAD)"
274280
channel_branch="$(git -C "${channel_repo}" symbolic-ref --quiet --short HEAD)"
275281
if [ -z "${channel_branch}" ]; then

0 commit comments

Comments
 (0)