[packages/git-core] convert hardlinks to symlinks
glen
glen at pld-linux.org
Wed Apr 13 22:25:23 CEST 2016
commit 698b79f92d5ea3321f9ec831b080d692fa927d3b
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Apr 13 23:24:04 2016 +0300
convert hardlinks to symlinks
workaround for https://bugs.launchpad.net/pld-linux/+bug/1176337
as it's still untouched 3 years later
git-core.spec | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/git-core.spec b/git-core.spec
index ce8ad72..4d75658 100644
--- a/git-core.spec
+++ b/git-core.spec
@@ -14,7 +14,7 @@ Summary: Distributed version control system focused on speed, effectivity and us
Summary(pl.UTF-8): Rozproszony system śledzenia treści skupiony na szybkości, wydajności i użyteczności
Name: git-core
Version: 2.8.0
-Release: 1
+Release: 2
License: GPL v2
Group: Development/Tools
Source0: http://www.kernel.org/pub/software/scm/git/git-%{version}.tar.xz
@@ -593,11 +593,27 @@ install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/git-daemon
sed -e 's, at libdir@/git-core,%{gitcoredir},g' -i $RPM_BUILD_ROOT/etc/rc.d/init.d/git-daemon
sed -e 's, at libdir@/git-core,%{gitcoredir},g' -i $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/git-daemon
-# hardlink
-ln -f $RPM_BUILD_ROOT%{_bindir}/{git,git-receive-pack}
-ln -f $RPM_BUILD_ROOT%{_bindir}/{git,git-upload-archive}
-ln -f $RPM_BUILD_ROOT{%{gitcoredir},%{_bindir}}/git-shell
-ln -f $RPM_BUILD_ROOT{%{gitcoredir},%{_bindir}}/git-upload-pack
+# same file, link
+ln -sf git $RPM_BUILD_ROOT%{_bindir}/git-receive-pack
+ln -sf git $RPM_BUILD_ROOT%{_bindir}/git-upload-archive
+ln -sf ../../%{gitcoredir}/git-shell $RPM_BUILD_ROOT%{_bindir}/git-shell
+ln -sf ../../%{gitcoredir}/git-upload-pack $RPM_BUILD_ROOT%{_bindir}/git-upload-pack
+
+# convert all hardlinks to symlinks, as rpm fails to calculate it properly
+# requiring excessive free space when it may not be available
+# https://bugs.launchpad.net/pld-linux/+bug/1176337
+find $RPM_BUILD_ROOT%{gitcoredir} -samefile $RPM_BUILD_ROOT%{gitcoredir}/git > files
+for f in $(cat files); do
+ f=${f#$RPM_BUILD_ROOT%{gitcoredir}/}
+ test $f = git && continue
+ ln -snf git $RPM_BUILD_ROOT%{gitcoredir}/$f
+done
+
+# few others
+ln -snf git-gui $RPM_BUILD_ROOT%{gitcoredir}/git-citool
+ln -snf git-remote-http $RPM_BUILD_ROOT%{gitcoredir}/git-remote-https
+ln -snf git-remote-http $RPM_BUILD_ROOT%{gitcoredir}/git-remote-ftp
+ln -snf git-remote-http $RPM_BUILD_ROOT%{gitcoredir}/git-remote-ftps
# remove unneeded files
%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/git-core.git/commitdiff/698b79f92d5ea3321f9ec831b080d692fa927d3b
More information about the pld-cvs-commit
mailing list