diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 7e8dcfe32..c0b5de04c 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -78,13 +78,15 @@ function Get-DockerBuildxVersion { function Get-GitVersion { $result = Get-CommandResult "git --version" $gitVersion = $result.Output | Take-OutputPart -Part 2 - return "Git $gitVersion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git-core" + return "Git $gitVersion (apt source repository: $aptSourceRepo)" } function Get-GitLFSVersion { $result = Get-CommandResult "git-lfs --version" $gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" - return "Git LFS $gitlfsversion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git-lfs" + return "Git LFS $gitlfsversion (apt source repository: $aptSourceRepo)" } function Get-GitFTPVersion { diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index e620f68f7..d878862cb 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -7,19 +7,30 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/install.sh +GIT_REPO="ppa:git-core/ppa" +GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs" + ## Install git -add-apt-repository ppa:git-core/ppa -y +add-apt-repository $GIT_REPO -y apt-get update apt-get install git -y git --version # Install git-lfs -curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash -apt-get install -y --no-install-recommends git-lfs +curl -s $GIT_LFS_REPO/script.deb.sh | bash +apt-get install -y git-lfs # Install git-ftp apt-get install git-ftp -y +# Remove source repo's +add-apt-repository --remove $GIT_REPO +rm /etc/apt/sources.list.d/github_git-lfs.list + +# Document apt source repo's +echo "git-core $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt +echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt + #Install hub tmp_hub="/tmp/hub" mkdir -p "$tmp_hub"