diff --git a/CMakeLists.txt b/CMakeLists.txt index c0aa5071..4cc4d7da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 3becd28a..49f3a2f9 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -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) diff --git a/bin/tdnf-cache-updateinfo.in b/bin/tdnf-cache-updateinfo.in deleted file mode 100755 index 6ab77161..00000000 --- a/bin/tdnf-cache-updateinfo.in +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (C) 2020 VMware, 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 -# of the License are located in the COPYING file of this distribution. -# - -exec > /var/cache/tdnf/cached-updateinfo.txt - -tdnf -q --refresh updateinfo | grep -vE '^Refreshing|^Disabling' - -exit ${PIPESTATUS[0]} diff --git a/etc/motdgen.d/02-tdnf-updateinfo.sh b/etc/motdgen.d/02-tdnf-updateinfo.sh index fb386a08..5c8c90cc 100755 --- a/etc/motdgen.d/02-tdnf-updateinfo.sh +++ b/etc/motdgen.d/02-tdnf-updateinfo.sh @@ -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 @@ -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 diff --git a/tdnf.spec.in b/tdnf.spec.in index 61b432e6..26b32d2e 100644 --- a/tdnf.spec.in +++ b/tdnf.spec.in @@ -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