From: "Sebastian Pipping" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:emacs-updater commit in: /
Date: Sun, 6 May 2012 16:06:10 +0000 (UTC) [thread overview]
Message-ID: <1294225887.bc4e5689c58ffd2870da87973a2d609ab126807b.sping@gentoo> (raw)
commit: bc4e5689c58ffd2870da87973a2d609ab126807b
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 5 11:11:27 2011 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Wed Jan 5 11:11:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=bc4e5689
Use wc instead of sed for line counting. Postpone "no packages" message.
svn path=/emacs-updater/; revision=1641
---
ChangeLog | 6 ++++++
emacs-updater | 18 +++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e13f8f2..a100b11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-05 Ulrich Mueller <ulm@gentoo.org>
+
+ * emacs-updater: Use wc instead of sed for line counting; the
+ latter did not work for empty files. Postpone message that no
+ packages have been found.
+
2010-11-27 Ulrich Mueller <ulm@gentoo.org>
* emacs-updater (have_paludis, pm_paludis): Use cave instead of
diff --git a/emacs-updater b/emacs-updater
index d2cb91e..59ac937 100755
--- a/emacs-updater
+++ b/emacs-updater
@@ -273,8 +273,8 @@ if [ ! -s "${TMPFILE}" ]; then
exit 3
fi
-NO_OF_FILES=$(sed -n '$=' "${TMPFILE}")
-[ ${NO_OF_FILES} -eq 1 ] && s= || s=s
+NO_OF_FILES=$(wc -l <"${TMPFILE}")
+[ "${NO_OF_FILES}" -eq 1 ] && s= || s=s
message "Assigning ${NO_OF_FILES} file${s} to packages ..."
if [ "${ORPHANS}" ]; then
@@ -287,13 +287,8 @@ else
# qfile -eqCR -f "${TMPFILE}" | sort -u | xargs qlist -eqCILS
fi
-if [ ! -s "${PKGFILE}" ]; then
- warning "No packages to update, quitting."
- exit 3
-fi
-
-NO_OF_PACKAGES=$(sed -n '$=' "${PKGFILE}")
-[ ${NO_OF_PACKAGES} -eq 1 ] && s= || s=s
+NO_OF_PACKAGES=$(wc -l <"${PKGFILE}")
+[ "${NO_OF_PACKAGES}" -eq 1 ] && s= || s=s
if [ "${ORPHANS}" ]; then
message "${NO_OF_PACKAGES} orphan file${s} found:"
else
@@ -307,6 +302,11 @@ if [ "${PRETEND}" -o "${ORPHANS}" ]; then
fi
echo
+if [ "${NO_OF_PACKAGES}" -eq 0 ]; then
+ warning "No packages to update, quitting."
+ exit 3
+fi
+
if [ "${BATCH}" ]; then
message "Remerging packages ..."
else
next reply other threads:[~2012-05-06 16:09 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 16:06 Sebastian Pipping [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-05 14:08 [gentoo-commits] proj/emacs-tools:emacs-updater commit in: / Ulrich Müller
2024-05-02 16:52 Ulrich Müller
2024-05-02 16:52 Ulrich Müller
2024-05-02 16:52 Ulrich Müller
2024-05-02 16:52 Ulrich Müller
2023-09-25 18:54 Ulrich Müller
2023-09-25 18:47 Ulrich Müller
2019-08-30 22:02 Ulrich Müller
2019-08-30 22:02 Ulrich Müller
2018-12-09 22:37 Ulrich Müller
2018-09-16 14:50 Ulrich Müller
2016-06-08 6:53 Ulrich Müller
2016-06-07 22:20 Ulrich Müller
2016-06-07 13:06 Ulrich Müller
2016-06-07 12:50 Ulrich Müller
2016-06-07 12:50 Ulrich Müller
2014-06-05 17:07 Ulrich Müller
2014-06-05 16:43 Ulrich Müller
2014-05-20 6:49 Ulrich Müller
2014-05-19 18:14 Ulrich Müller
2014-05-19 18:14 Ulrich Müller
2013-08-09 13:57 Ulrich Mueller
2013-03-20 17:03 Ulrich Mueller
2013-03-20 16:54 Ulrich Mueller
2013-03-12 18:55 Ulrich Mueller
2013-03-12 18:55 Ulrich Mueller
2013-03-12 18:55 Ulrich Mueller
2013-03-11 11:27 Ulrich Mueller
2013-03-11 10:15 Ulrich Mueller
2013-03-11 9:43 Ulrich Mueller
2013-03-11 8:23 Ulrich Mueller
2013-03-09 12:31 Ulrich Mueller
2013-03-09 12:31 Ulrich Mueller
2013-03-09 12:31 Ulrich Mueller
2012-10-11 8:20 Ulrich Mueller
2012-10-11 8:20 Ulrich Mueller
2012-10-08 20:59 Ulrich Mueller
2012-10-08 20:45 Ulrich Mueller
2012-05-06 18:47 Ulrich Mueller
2012-05-06 18:14 Ulrich Mueller
2012-05-06 16:07 [gentoo-commits] proj/emacs-tools:backups/emacs-updater@1480 " Sebastian Pipping
2012-05-06 16:06 ` [gentoo-commits] proj/emacs-tools:emacs-updater " Sebastian Pipping
2012-05-06 16:07 [gentoo-commits] proj/emacs-tools:backups/emacs-updater@1480 " Sebastian Pipping
2012-05-06 16:06 ` [gentoo-commits] proj/emacs-tools:emacs-updater " Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
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=1294225887.bc4e5689c58ffd2870da87973a2d609ab126807b.sping@gentoo \
--to=sping@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