Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix golang post install and post uninstall sriptlets #12026

Open
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions SPECS/golang/golang-1.22.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -162,6 +154,11 @@ fi
%{_bindir}/*

%changelog
* Wed Jan 22 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

Expand All @@ -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
Expand Down
17 changes: 7 additions & 10 deletions SPECS/golang/golang.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -162,6 +154,11 @@ fi
%{_bindir}/*

%changelog
* Wed Jan 22 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

Expand All @@ -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
Expand Down
Loading