diff options
author | Ulrich Müller <ulm@gentoo.org> | 2016-12-04 06:38:54 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2016-12-04 13:22:01 +0100 |
commit | 24b7b6c3026e62b519922cf81074594fbd573ef8 (patch) | |
tree | 7c7dd5c86e93aa7757c6060a2f59789d6fcd0b2c | |
parent | Disable eval again. (diff) | |
download | eselect-24b7b6c3026e62b519922cf81074594fbd573ef8.tar.gz eselect-24b7b6c3026e62b519922cf81074594fbd573ef8.tar.bz2 eselect-24b7b6c3026e62b519922cf81074594fbd573ef8.zip |
Check return status of package manager calls in news module.
* modules/news.eselect (find_items, find_repo_dir): Check return
status of package manager calls, bug 601506.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | modules/news.eselect | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2016-12-04 Ulrich Müller <ulm@gentoo.org> + + * modules/news.eselect (find_items, find_repo_dir): Check return + status of package manager calls, bug 601506. + 2016-10-31 Ulrich Müller <ulm@gentoo.org> * libs/core.bash.in (eval): Disable eval again, because the diff --git a/modules/news.eselect b/modules/news.eselect index e413706..1c6a981 100644 --- a/modules/news.eselect +++ b/modules/news.eselect @@ -14,7 +14,10 @@ NEWS_DIR="/var/lib/gentoo/news" # returns one item per line: status/repository/name # sort order: by item name (i.e. effectively by date) find_items() { - local stat repos=$(get_repositories) repo file item + local stat repos repo file item + repos=$(get_repositories) \ + || die "Package manager cannot get list of repositories" + [[ -n ${repos} ]] || write_warning_msg "No repositories found" for stat; do for repo in ${repos}; do file="${EROOT}${NEWS_DIR}/news-${repo}.${stat}" @@ -80,7 +83,8 @@ find_repo_dir() { done if [[ ${i} -eq ${#repos[@]} ]]; then repos[i]=${repo} - dirs[i]=$(get_repo_news_dir "${repo}") + dirs[i]=$(get_repo_news_dir "${repo}") \ + || die "Package manager cannot get news dir for repo ${repo}" fi dir=${dirs[i]} } |