From c658f53d02ba5e8b8234999811d37ed778e3dcbf Mon Sep 17 00:00:00 2001 From: zhipengl Date: Fri, 7 Dec 2018 19:32:34 +0800 Subject: [PATCH] Refactor motd patch for crontabs According to analysis from Saul in task 26455, we can remove motd patch for crontabs and then use RPM instead of SRPM for it. We also need to remove usage of --without-progname in utilities/ update-motd/files/motd-update. Story: 2003765 Task: 28181 & 28182 Depends-on: https://review.openstack.org/#/c/623385/ Change-Id: I4be7d47ee77ac07eb24f5b88cd707c29b595df7a Signed-off-by: zhipengl --- base/crontabs/centos/build_srpm.data | 1 - ...te-package-versioning-for-TIS-format.patch | 25 ------- base/crontabs/centos/meta_patches/PATCH_ORDER | 2 - ...o-remove-printing-of-motd-script-nam.patch | 35 ---------- ...tion-to-remove-printing-of-motd-scri.patch | 65 ------------------- base/crontabs/centos/srpm_path | 1 - centos_pkg_dirs | 1 - utilities/update-motd/files/motd-update | 2 +- 8 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 base/crontabs/centos/build_srpm.data delete mode 100644 base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch delete mode 100644 base/crontabs/centos/meta_patches/PATCH_ORDER delete mode 100644 base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch delete mode 100644 base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch delete mode 100644 base/crontabs/centos/srpm_path diff --git a/base/crontabs/centos/build_srpm.data b/base/crontabs/centos/build_srpm.data deleted file mode 100644 index 70b4b5dcb..000000000 --- a/base/crontabs/centos/build_srpm.data +++ /dev/null @@ -1 +0,0 @@ -TIS_PATCH_VER=2 diff --git a/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch deleted file mode 100644 index 8f3d7f6b3..000000000 --- a/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a15d83975ed19367767e18354ea07cd5d281e265 Mon Sep 17 00:00:00 2001 -From: Don Penney -Date: Tue, 27 Sep 2016 10:14:02 -0400 -Subject: [PATCH] Update package versioning for TIS format - ---- - SPECS/crontabs.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec -index 7001d1a..4512bcc 100644 ---- a/SPECS/crontabs.spec -+++ b/SPECS/crontabs.spec -@@ -2,7 +2,7 @@ - Summary: Root crontab files used to schedule the execution of programs - Name: crontabs - Version: 1.11 --Release: 6.%{snap_release}%{?dist} -+Release: 6.%{snap_release}.el7%{?_tis_dist}.%{tis_patch_ver} - License: Public Domain and GPLv2 - Group: System Environment/Base - URL: https://fedorahosted.org/crontabs --- -1.8.3.1 - diff --git a/base/crontabs/centos/meta_patches/PATCH_ORDER b/base/crontabs/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 253c79ab1..000000000 --- a/base/crontabs/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,2 +0,0 @@ -spec-add-patch-to-remove-printing-of-motd-script-nam.patch -0001-Update-package-versioning-for-TIS-format.patch diff --git a/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch b/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch deleted file mode 100644 index 5c61ad948..000000000 --- a/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9221bd11aec1590df2dc3f19e9a582d76ed7adc0 Mon Sep 17 00:00:00 2001 -From: Michel Thebeau -Date: Mon, 25 Jul 2016 11:45:55 -0400 -Subject: [PATCH] spec: add patch to remove printing of motd script name - -Signed-off-by: Michel Thebeau ---- - SPECS/crontabs.spec | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec -index d6a8c69..90098e1 100644 ---- a/SPECS/crontabs.spec -+++ b/SPECS/crontabs.spec -@@ -10,6 +10,8 @@ Source0: https://fedorahosted.org/releases/c/r/crontabs/%{name}-%{version}-1.%{s - BuildArch: noarch - Requires: /etc/cron.d - -+Patch1: run-parts-add-option-to-remove-printing-of-motd-scri.patch -+ - %description - This package is used by Fedora mainly for executing files by cron. - -@@ -25,6 +27,8 @@ your system. - %prep - %setup -q - -+%patch1 -p1 -+ - %build - #empty - --- -1.8.3.1 - diff --git a/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch b/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch deleted file mode 100644 index ffabb92c5..000000000 --- a/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch +++ /dev/null @@ -1,65 +0,0 @@ -From f0bd54cb83ba430ef81153c7a6da2a52daca5266 Mon Sep 17 00:00:00 2001 -From: Michel Thebeau -Date: Mon, 25 Jul 2016 11:23:18 -0400 -Subject: [PATCH] run-parts: add option to remove printing of motd script name - -The awk statement seems to be a round-about way of printing the name of -the motd script (/etc/motd.d/*). The pipe seems to allow awk to print -without user input; while the end of input causes awk to exit. Any -input to awk is echoed to terminal before the motd script name is -printed. - -The script name that is printed is appended to /etc/motd. This is -undesirable. Add an option to skip the awk program. - -Signed-off-by: Michel Thebeau ---- - run-parts | 25 +++++++++++++++++++------ - 1 file changed, 19 insertions(+), 6 deletions(-) - -diff --git a/run-parts b/run-parts -index 7e148f8..b444f4e 100755 ---- a/run-parts -+++ b/run-parts -@@ -4,6 +4,14 @@ - # keep going when something fails - set +e - -+# First parameter to remove printing of the names of executed scripts. -+# The default is unmodified behaviour, print the name of scripts. -+with_progname="y" -+if [ "$1" == "--without-progname" ]; then -+ with_progname="" -+ shift -+fi -+ - if [ $# -lt 1 ]; then - echo "Usage: run-parts [--list | --test] " - exit 1 -@@ -87,12 +95,17 @@ for i in $(LC_ALL=C; echo ${1%/}/*[^~,]) ; do - - # run executable files - logger -p cron.notice -t "run-parts($1)[$$]" "starting $(basename $i)" -- $i 2>&1 | awk -v "progname=$i" \ -- 'progname { -- print progname ":\n" -- progname=""; -- } -- { print; }' -+ if [ -n "$with_progname" ]; then -+ $i 2>&1 | awk -v "progname=$i" \ -+ 'progname { -+ print progname ":\n" -+ progname=""; -+ } -+ { print; }' -+ else -+ $i 2>&1 -+ fi -+ - logger -i -p cron.notice -t "run-parts($1)" "finished $(basename $i)" - fi - fi --- -1.8.3.1 - diff --git a/base/crontabs/centos/srpm_path b/base/crontabs/centos/srpm_path deleted file mode 100644 index 0f0dfed39..000000000 --- a/base/crontabs/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/crontabs-1.11-6.20121102git.el7.src.rpm diff --git a/centos_pkg_dirs b/centos_pkg_dirs index cc99a7c57..e2cceddb7 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -142,7 +142,6 @@ networking/net-tools filesystem/drbd/drbd-tools database/mariadb database/python-psycopg2 -base/crontabs base/dnsmasq base/dnsmasq-config filesystem/parted diff --git a/utilities/update-motd/files/motd-update b/utilities/update-motd/files/motd-update index b853b09d8..e339e448e 100644 --- a/utilities/update-motd/files/motd-update +++ b/utilities/update-motd/files/motd-update @@ -11,5 +11,5 @@ MOTD_PATH=${MOTD_PATH:-"/etc/motd.d"} MOTD_TAG=${MOTD_TAG:-"motd-update"} if [ -d ${MOTD_PATH} ]; then - run-parts --without-progname ${MOTD_PATH} 1>${MOTD_FILE} + run-parts ${MOTD_PATH} 1>${MOTD_FILE} fi