diff --git a/build/resources/_common/applications/sourcegit.desktop b/build/resources/_common/applications/sourcegit.desktop index bcf9c813..42b1bcf5 100644 --- a/build/resources/_common/applications/sourcegit.desktop +++ b/build/resources/_common/applications/sourcegit.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=SourceGit Comment=Open-source & Free Git GUI Client -Exec=/opt/sourcegit/sourcegit +Exec=/usr/bin/sourcegit Icon=/usr/share/icons/sourcegit.png Terminal=false Type=Application diff --git a/build/resources/_common/sourcegit b/build/resources/_common/sourcegit new file mode 100644 index 00000000..0ff93d3a --- /dev/null +++ b/build/resources/_common/sourcegit @@ -0,0 +1,4 @@ +#!/bin/bash + +eval `ssh-agent -s` +/opt/sourcegit/sourcegit $@ diff --git a/build/resources/appimage/sourcegit b/build/resources/appimage/sourcegit new file mode 100644 index 00000000..b0f9ee31 --- /dev/null +++ b/build/resources/appimage/sourcegit @@ -0,0 +1,4 @@ +#!/bin/bash + +eval `ssh-agent -s` +"$APPDIR/opt/sourcegit/sourcegit" $@ diff --git a/build/resources/appimage/sourcegit.png b/build/resources/appimage/sourcegit.png deleted file mode 100644 index 8cdcd3a8..00000000 Binary files a/build/resources/appimage/sourcegit.png and /dev/null differ diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index 2a684837..0deab37a 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -21,11 +21,12 @@ mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/usr/share/applications mkdir -p %{buildroot}/usr/share/icons cp -f ../../../SourceGit/* %{buildroot}/opt/sourcegit/ -ln -rsf %{buildroot}/opt/sourcegit/sourcegit %{buildroot}/%{_bindir} +cp -f ../../_common/sourcegit %{buildroot}/%{_bindir} cp -r ../../_common/applications %{buildroot}/%{_datadir} cp -r ../../_common/icons %{buildroot}/%{_datadir} chmod 755 -R %{buildroot}/opt/sourcegit chmod 755 %{buildroot}/%{_datadir}/applications/sourcegit.desktop +chmod 755 %{buildroot}/%{_bindir}/sourcegit %files %dir /opt/sourcegit/ diff --git a/build/scripts/package.linux.sh b/build/scripts/package.linux.sh index 1b4adbdc..51e1e194 100755 --- a/build/scripts/package.linux.sh +++ b/build/scripts/package.linux.sh @@ -41,8 +41,9 @@ cp -r SourceGit SourceGit.AppDir/opt/sourcegit desktop-file-install resources/_common/applications/sourcegit.desktop --dir SourceGit.AppDir/usr/share/applications \ --set-icon com.sourcegit_scm.SourceGit --set-key=Exec --set-value=AppRun mv SourceGit.AppDir/usr/share/applications/{sourcegit,com.sourcegit_scm.SourceGit}.desktop -cp resources/appimage/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png -ln -rsf SourceGit.AppDir/opt/sourcegit/sourcegit SourceGit.AppDir/AppRun +cp resources/_common/icons/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png +cp -f resources/appimage/sourcegit SourceGit.AppDir/AppRun +chmod 755 SourceGit.AppDir/AppRun ln -rsf SourceGit.AppDir/usr/share/applications/com.sourcegit_scm.SourceGit.desktop SourceGit.AppDir cp resources/appimage/sourcegit.appdata.xml SourceGit.AppDir/usr/share/metainfo/com.sourcegit_scm.SourceGit.appdata.xml @@ -53,9 +54,10 @@ mkdir -p resources/deb/usr/bin mkdir -p resources/deb/usr/share/applications mkdir -p resources/deb/usr/share/icons cp -f SourceGit/* resources/deb/opt/sourcegit -ln -rsf resources/deb/opt/sourcegit/sourcegit resources/deb/usr/bin +cp -f resources/_common/sourcegit resources/deb/usr/bin/ cp -r resources/_common/applications resources/deb/usr/share cp -r resources/_common/icons resources/deb/usr/share +chmod 755 resources/deb/usr/bin/sourcegit # Calculate installed size in KB installed_size=$(du -sk resources/deb | cut -f1) # Update the control file diff --git a/src/Commands/Command.cs b/src/Commands/Command.cs index 11a25b36..666926cc 100644 --- a/src/Commands/Command.cs +++ b/src/Commands/Command.cs @@ -172,7 +172,7 @@ namespace SourceGit.Commands // If an SSH private key was provided, sets the environment. if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey)) - start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'"); + start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o AddKeysToAgent=yes -i {SSHKey.Quoted()}"); // Force using en_US.UTF-8 locale if (OperatingSystem.IsLinux())