From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/eselect:master commit in: /, modules/
Date: Mon, 25 Dec 2017 11:00:37 +0000 (UTC) [thread overview]
Message-ID: <1514194826.b4cf6bfdc8ad3908637f5ab068f6c323bb32fe6b.ulm@gentoo> (raw)
commit: b4cf6bfdc8ad3908637f5ab068f6c323bb32fe6b
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 09:40:26 2017 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 09:40:26 2017 +0000
URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=b4cf6bfd
Check for valid news item format.
* modules/news.eselect (do_list): Check for valid news item format.
ChangeLog | 2 ++
modules/news.eselect | 30 ++++++++++++++++++++----------
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 648e874..55e5bb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2017-12-25 Ulrich Müller <ulm@gentoo.org>
+ * modules/news.eselect (do_list): Check for valid news item format.
+
* libs/core.bash.in (eval): Make it fatal again, after more than
one year of transition time.
diff --git a/modules/news.eselect b/modules/news.eselect
index 15cf985..b0e9695 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -172,7 +172,7 @@ describe_list() {
}
do_list() {
- local item stat repo dir header line title posted i=1
+ local item stat repo dir header line format title posted i=1
local cols=${COLUMNS:-80} ifs_save=${IFS}
local -a repos dirs
@@ -185,16 +185,26 @@ do_list() {
title="(${item} - no title)"
posted=${item:0:10}
[[ ${posted} == +([0-9])-+([0-9])-+([0-9]) ]] || posted="(no date) "
- header=$(read_item "${dir}" "${item}" header) \
- || title="(${item} - removed?)"
- local IFS=$'\n'
- for line in ${header}; do
- case "${line%%:*}" in
- Title) title=${line##*([^:]):*([[:space:]])} ;;
- Posted) posted=${line##*([^:]):*([[:space:]])} ;;
+ if header=$(read_item "${dir}" "${item}" header); then
+ local IFS=$'\n'
+ for line in ${header}; do
+ case "${line%%:*}" in
+ Title) title=${line##*([^:]):*([[:space:]])} ;;
+ Posted) posted=${line##*([^:]):*([[:space:]])} ;;
+ News-Item-Format) format=${line##*([^:]):*([[:space:]])} ;;
+ esac
+ done
+ IFS=${ifs_save}
+ case ${format} in
+ 1.*|2.*) ;;
+ *)
+ title="(${item} - unknown format ${format})"
+ posted=""
+ ;;
esac
- done
- IFS=${ifs_save}
+ else
+ title="(${item} - removed?)"
+ fi
[[ ${repo} != gentoo ]] && title="[${repo}] ${title}"
line="${posted}$(space $((10 - ${#posted}))) ${title}"
# truncate the line if it is too long
next reply other threads:[~2017-12-25 11:00 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-25 11:00 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-22 5:55 [gentoo-commits] proj/eselect:master commit in: /, modules/ Ulrich Müller
2024-11-18 5:52 Ulrich Müller
2024-11-13 20:26 Ulrich Müller
2023-08-07 16:22 Ulrich Müller
2023-06-12 16:24 Ulrich Müller
2019-11-28 13:16 Ulrich Müller
2018-01-24 10:03 Ulrich Müller
2018-01-08 23:30 Ulrich Müller
2017-05-22 11:27 Ulrich Müller
2017-05-06 13:24 Ulrich Müller
2016-12-06 7:05 Ulrich Müller
2015-01-18 22:01 Ulrich Müller
2014-08-28 13:02 Ulrich Müller
2014-05-24 7:02 Ulrich Müller
2014-02-25 10:09 Ulrich Müller
2014-02-09 17:57 Ulrich Müller
2014-02-09 16:23 Ulrich Müller
2014-02-09 17:57 ` Ulrich Müller
2013-11-14 16:47 Ulrich Müller
2013-08-24 16:52 Ulrich Mueller
2013-07-16 14:27 Ulrich Mueller
2013-07-14 15:24 Ulrich Mueller
2013-02-22 22:24 Ulrich Mueller
2012-12-06 21:02 Ulrich Mueller
2012-09-12 22:09 Ulrich Mueller
2012-08-19 20:03 Ulrich Mueller
2012-06-27 17:02 Ulrich Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1514194826.b4cf6bfdc8ad3908637f5ab068f6c323bb32fe6b.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox