-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix golang post install and post uninstall sriptlets
- Loading branch information
1 parent
cb6ac00
commit 2a787a7
Showing
2 changed files
with
14 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
%global gopath %{_datadir}/gocode | ||
%global ms_go_filename go1.22.10-20241203.4.src.tar.gz | ||
%global ms_go_revision 1 | ||
%global go_priority %(echo %{version}.%{ms_go_revision} | tr -d .) | ||
%ifarch aarch64 | ||
%global gohostarch arm64 | ||
%else | ||
|
@@ -16,7 +15,7 @@ | |
Summary: Go | ||
Name: golang | ||
Version: 1.22.10 | ||
Release: 1%{?dist} | ||
Release: 2%{?dist} | ||
License: BSD-3-Clause | ||
Vendor: Microsoft Corporation | ||
Distribution: Azure Linux | ||
|
@@ -134,17 +133,10 @@ EOF | |
|
||
%post -p /sbin/ldconfig | ||
|
||
alternatives --install %{_bindir}/go go %{goroot}/bin/go %{go_priority} | ||
alternatives --install %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt %{go_priority} | ||
|
||
%postun | ||
/sbin/ldconfig | ||
if [ $1 -eq 0 ]; then | ||
# This is uninstall | ||
alternatives --remove go %{goroot}/bin/go | ||
alternatives --remove gofmt %{goroot}/bin/gofmt | ||
|
||
rm %{_sysconfdir}/profile.d/go-exports.sh | ||
rm -rf /opt/go | ||
exit 0 | ||
fi | ||
|
@@ -162,6 +154,11 @@ fi | |
%{_bindir}/* | ||
|
||
%changelog | ||
* Tue Feb 04 2025 Tobias Brick <[email protected]> - 1.22.10-2 | ||
- Fix post scriptlet | ||
- Remove calls to alternatives | ||
- Don't manually delete go-exports.sh | ||
|
||
* Wed Dec 04 2024 Microsoft Golang Bot <[email protected]> - 1.22.10-1 | ||
- Bump version to 1.22.10-1 | ||
|
||
|
@@ -186,7 +183,7 @@ fi | |
* Tue Jun 04 2024 Davis Goodin <[email protected]> - 1.22.4-1 | ||
- Bump version to 1.22.4-1 | ||
|
||
* Tue May 07 2024 Davis Goodin <[email protected]> - 1.22.3-1 | ||
* Mon May 27 2024 Davis Goodin <[email protected]> - 1.22.3-1 | ||
- Bump version to 1.22.3-1 | ||
|
||
* Wed May 08 2024 Davis Goodin <[email protected]> - 1.21.9-2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
%global gopath %{_datadir}/gocode | ||
%global ms_go_filename go1.23.3-20241202.3.src.tar.gz | ||
%global ms_go_revision 2 | ||
%global go_priority %(echo %{version}.%{ms_go_revision} | tr -d .) | ||
%ifarch aarch64 | ||
%global gohostarch arm64 | ||
%else | ||
|
@@ -16,7 +15,7 @@ | |
Summary: Go | ||
Name: golang | ||
Version: 1.23.3 | ||
Release: 2%{?dist} | ||
Release: 3%{?dist} | ||
License: BSD-3-Clause | ||
Vendor: Microsoft Corporation | ||
Distribution: Azure Linux | ||
|
@@ -134,17 +133,10 @@ EOF | |
|
||
%post -p /sbin/ldconfig | ||
|
||
alternatives --install %{_bindir}/go go %{goroot}/bin/go %{go_priority} | ||
alternatives --install %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt %{go_priority} | ||
|
||
%postun | ||
/sbin/ldconfig | ||
if [ $1 -eq 0 ]; then | ||
# This is uninstall | ||
alternatives --remove go %{goroot}/bin/go | ||
alternatives --remove gofmt %{goroot}/bin/gofmt | ||
|
||
rm %{_sysconfdir}/profile.d/go-exports.sh | ||
rm -rf /opt/go | ||
exit 0 | ||
fi | ||
|
@@ -162,6 +154,11 @@ fi | |
%{_bindir}/* | ||
|
||
%changelog | ||
* Tue Feb 04 2025 Tobias Brick <[email protected]> - 1.23.3-3 | ||
- Fix post scriptlet | ||
- Remove calls to alternatives | ||
- Don't manually delete go-exports.sh | ||
|
||
* Tue Dec 03 2024 Microsoft Golang Bot <[email protected]> - 1.23.3-2 | ||
- Bump version to 1.23.3-2 | ||
|
||
|
@@ -186,7 +183,7 @@ fi | |
* Tue Jun 04 2024 Davis Goodin <[email protected]> - 1.22.4-1 | ||
- Bump version to 1.22.4-1 | ||
|
||
* Tue May 07 2024 Davis Goodin <[email protected]> - 1.22.3-1 | ||
* Mon May 27 2024 Davis Goodin <[email protected]> - 1.22.3-1 | ||
- Bump version to 1.22.3-1 | ||
|
||
* Wed May 08 2024 Davis Goodin <[email protected]> - 1.21.9-2 | ||
|