mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-09-21 21:51:34 +02:00
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
See https://github.com/anatol/booster/pull/134
|
|
|
|
From 555ae6bdb8143c5a0800265b134218623a302b09 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
|
Date: Thu, 17 Feb 2022 07:51:29 +0100
|
|
Subject: [PATCH] generator: when creating compatibility symlinks ensure target
|
|
exists
|
|
|
|
Otherwise, the symlinks may point to non-existend target directories
|
|
if we only install files from /bin and /lib. For example, on Alpine
|
|
BusyBox is located in /bin/busybox and hence the /usr/bin directory
|
|
is not created without this commit.
|
|
---
|
|
generator/generator.go | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/generator/generator.go b/generator/generator.go
|
|
index 4fec956..456b839 100644
|
|
--- a/generator/generator.go
|
|
+++ b/generator/generator.go
|
|
@@ -223,6 +223,12 @@ func appendCompatibilitySymlinks(img *Image) error {
|
|
}
|
|
|
|
for _, l := range symlinks {
|
|
+ // Ensure that target always exist which may not be the
|
|
+ // case if we only install files from /lib or /bin.
|
|
+ if err := img.AppendDirEntry(l.target); err != nil {
|
|
+ return err
|
|
+ }
|
|
+
|
|
mode := cpio.FileMode(0777) | cpio.ModeSymlink
|
|
if err := img.AppendEntry(l.src, mode, []byte(l.target)); err != nil {
|
|
return err
|