Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] emacs r1641 - emacs-updater
Date: Wed, 05 Jan 2011 11:11:40
Message-Id: 20110105111130.1B84520051@flycatcher.gentoo.org
1 Author: ulm
2 Date: 2011-01-05 11:11:27 +0000 (Wed, 05 Jan 2011)
3 New Revision: 1641
4
5 Modified:
6 emacs-updater/ChangeLog
7 emacs-updater/emacs-updater
8 Log:
9 Use wc instead of sed for line counting. Postpone "no packages" message.
10
11 Modified: emacs-updater/ChangeLog
12 ===================================================================
13 --- emacs-updater/ChangeLog 2011-01-05 10:27:45 UTC (rev 1640)
14 +++ emacs-updater/ChangeLog 2011-01-05 11:11:27 UTC (rev 1641)
15 @@ -1,3 +1,9 @@
16 +2011-01-05 Ulrich Mueller <ulm@g.o>
17 +
18 + * emacs-updater: Use wc instead of sed for line counting; the
19 + latter did not work for empty files. Postpone message that no
20 + packages have been found.
21 +
22 2010-11-27 Ulrich Mueller <ulm@g.o>
23
24 * emacs-updater (have_paludis, pm_paludis): Use cave instead of
25
26 Modified: emacs-updater/emacs-updater
27 ===================================================================
28 --- emacs-updater/emacs-updater 2011-01-05 10:27:45 UTC (rev 1640)
29 +++ emacs-updater/emacs-updater 2011-01-05 11:11:27 UTC (rev 1641)
30 @@ -273,8 +273,8 @@
31 exit 3
32 fi
33
34 -NO_OF_FILES=$(sed -n '$=' "${TMPFILE}")
35 -[ ${NO_OF_FILES} -eq 1 ] && s= || s=s
36 +NO_OF_FILES=$(wc -l <"${TMPFILE}")
37 +[ "${NO_OF_FILES}" -eq 1 ] && s= || s=s
38 message "Assigning ${NO_OF_FILES} file${s} to packages ..."
39
40 if [ "${ORPHANS}" ]; then
41 @@ -287,13 +287,8 @@
42 # qfile -eqCR -f "${TMPFILE}" | sort -u | xargs qlist -eqCILS
43 fi
44
45 -if [ ! -s "${PKGFILE}" ]; then
46 - warning "No packages to update, quitting."
47 - exit 3
48 -fi
49 -
50 -NO_OF_PACKAGES=$(sed -n '$=' "${PKGFILE}")
51 -[ ${NO_OF_PACKAGES} -eq 1 ] && s= || s=s
52 +NO_OF_PACKAGES=$(wc -l <"${PKGFILE}")
53 +[ "${NO_OF_PACKAGES}" -eq 1 ] && s= || s=s
54 if [ "${ORPHANS}" ]; then
55 message "${NO_OF_PACKAGES} orphan file${s} found:"
56 else
57 @@ -307,6 +302,11 @@
58 fi
59
60 echo
61 +if [ "${NO_OF_PACKAGES}" -eq 0 ]; then
62 + warning "No packages to update, quitting."
63 + exit 3
64 +fi
65 +
66 if [ "${BATCH}" ]; then
67 message "Remerging packages ..."
68 else