Skip to content

Commit

Permalink
Fix updateinfo script
Browse files Browse the repository at this point in the history
Move instructions from bin/tdnf-cache-updateinfo to 02-tdnf-updateinfo,
when motd triggers it, it will generate the right data.

Signed-off-by: Shreenidhi Shedi <[email protected]>
  • Loading branch information
sshedi committed Dec 11, 2024
1 parent ab45608 commit e563cf5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,5 @@ add_subdirectory("${PROJECT_SOURCE_DIR}/tools")
add_subdirectory("${PROJECT_SOURCE_DIR}/pytests")

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/tdnf-automatic.in ${PROJECT_SOURCE_DIR}/bin/tdnf-automatic @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bin/tdnf-cache-updateinfo.in ${PROJECT_SOURCE_DIR}/bin/tdnf-cache-updateinfo @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/tdnf.spec.in ${CMAKE_SOURCE_DIR}/tdnf.spec @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/scripts/build-tdnf-rpms.in ${CMAKE_SOURCE_DIR}/scripts/build-tdnf-rpms @ONLY)
1 change: 0 additions & 1 deletion bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
#

install(PROGRAMS "tdnf-automatic" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary)
install(PROGRAMS "tdnf-cache-updateinfo" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary)
15 changes: 0 additions & 15 deletions bin/tdnf-cache-updateinfo.in

This file was deleted.

11 changes: 8 additions & 3 deletions etc/motdgen.d/02-tdnf-updateinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#
# Copyright (C) 2020 VMware, Inc. All Rights Reserved.
# Copyright (C) 2024, Broadcom, Inc. All Rights Reserved.
#
# Licensed under the GNU General Public License v2 (the "License");
# you may not use this file except in compliance with the License. The terms
Expand All @@ -10,9 +11,13 @@

path="/var/cache/tdnf/cached-updateinfo.txt"

tdnf -q --refresh updateinfo | grep -vE '^Refreshing|^Disabling' > "${path}"

if [ -s "${path}" ]; then
grep -qE 'Security|Bugfix|Enhancement' "${path}" || exit 0
echo; cat "${path}"; echo "Run 'tdnf updateinfo info' to see the details."
grep -qE 'Security|Bugfix|Enhancement' "${path}" || exit 0
echo
cat "${path}"
echo "Run 'tdnf updateinfo info' to see the details."
else
echo "tdnf update info not available yet!"
echo "tdnf update info not available yet!"
fi
1 change: 0 additions & 1 deletion tdnf.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ rm -f %{_var}/cache/%{name}/cached-updateinfo.txt
%{_bindir}/yum
%{_bindir}/tdnfj
%{_bindir}/%{name}-config
%{_bindir}/%{name}-cache-updateinfo
%{_libdir}/libtdnf.so.*
%{_libexecdir}/%{name}/%{name}-history-util
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
Expand Down

0 comments on commit e563cf5

Please sign in to comment.