diff mbox

[devtools] makechrootpkg: Fix broken symlinks because of chroot SRCPKGDEST /srcpkgdest

Message ID 20170512235705.8996-1-lukeshu@parabola.nu
State Accepted
Headers show

Commit Message

Luke Shumaker May 12, 2017, 11:57 p.m. UTC
Commit 58968cf fixed symlinks for package products in $startdir in
light of the simplified chroot setup.  However, a similar change needs
to be made for source-package products.  This was an easy omission to
make because makechrootpkg does not produce source-pakcages by
default.
---
 makechrootpkg.in | 5 +++++
 1 file changed, 5 insertions(+)

Comments

NicoHood May 13, 2017, 8:39 a.m. UTC | #1
On 05/13/2017 01:57 AM, Luke Shumaker wrote:
> Commit 58968cf fixed symlinks for package products in $startdir in
> light of the simplified chroot setup.  However, a similar change needs
> to be made for source-package products.  This was an easy omission to
> make because makechrootpkg does not produce source-pakcages by
> default.
> ---
>  makechrootpkg.in | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/makechrootpkg.in b/makechrootpkg.in
> index ffe6e42..246774a 100644
> --- a/makechrootpkg.in
> +++ b/makechrootpkg.in
> @@ -313,6 +313,11 @@ move_products() {
>  	for s in "$copydir"/srcpkgdest/*; do
>  		chown "$src_owner" "$s"
>  		mv "$s" "$SRCPKGDEST"
> +
> +		# Fix broken symlink because of temporary chroot SRCPKGDEST /srcpkgdest
> +		if [[ "$PWD" != "$SRCPKGDEST" && -L "$PWD/${s##*/}" ]]; then
> +			ln -sf "$SRCPKGDEST/${s##*/}"
> +		fi
>  	done
>  }
>  # }}}
> 

Hi Luke,
is this the same fix as this one? I remember that I've fixed a similar
thing already.

https://git.archlinux.org/devtools.git/commit/?id=58968cfaa239c2c4658b86a0fa81cfa1cd33f9cb
Luke Shumaker May 13, 2017, 4:08 p.m. UTC | #2
On Sat, 13 May 2017 04:39:06 -0400,
NicoHood wrote:
> 
> On 05/13/2017 01:57 AM, Luke Shumaker wrote:
> > Commit 58968cf fixed symlinks for package products in $startdir in
> > light of the simplified chroot setup.  However, a similar change needs
> > to be made for source-package products.  This was an easy omission to
> > make because makechrootpkg does not produce source-pakcages by
> > default.
> 
> Hi Luke,
> is this the same fix as this one? I remember that I've fixed a similar
> thing already.
> 
> https://git.archlinux.org/devtools.git/commit/?id=58968cfaa239c2c4658b86a0fa81cfa1cd33f9cb

Yes, that is the commit that I referenced in the commit message.  This
is the same fix, but for $SRCPKGDEST instead of $PKGDEST.
diff mbox

Patch

diff --git a/makechrootpkg.in b/makechrootpkg.in
index ffe6e42..246774a 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -313,6 +313,11 @@  move_products() {
 	for s in "$copydir"/srcpkgdest/*; do
 		chown "$src_owner" "$s"
 		mv "$s" "$SRCPKGDEST"
+
+		# Fix broken symlink because of temporary chroot SRCPKGDEST /srcpkgdest
+		if [[ "$PWD" != "$SRCPKGDEST" && -L "$PWD/${s##*/}" ]]; then
+			ln -sf "$SRCPKGDEST/${s##*/}"
+		fi
 	done
 }
 # }}}