BTS

Issue657

Title grml-etc-core/zshrc-0.3.64+avpi
Priority bug Status resolved
Superseder Nosy List ft, kiste, mika
Assigned To ft Topics grml-etc-core

Created on 2009-03-30.21:49:42 by kiste, last changed 2009-03-31.22:01:48 by mika.

Messages
msg2112 (view) Author: mika Date: 2009-03-31.22:01:48
We believe that your issue has been closed by the upload of
Version 0.3.65 of grml-etc-core from Michael Prokop <mika@grml.org>.
The explanation is attached below

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 31 Mar 2009 23:52:18 +0200
Source: grml-etc-core
Binary: grml-etc-core
Architecture: source all
Version: 0.3.65
Distribution: unstable
Urgency: low
Maintainer: Michael Prokop <mika@grml.org>
Changed-By: Michael Prokop <mika@grml.org>
Description: 
 grml-etc-core - core ecetera files for the grml system
Changes: 
 grml-etc-core (0.3.65) unstable; urgency=low
 .
   [ Frank Terbeck ]
   * zshrc: Add $NOTITLE to disable alteration of terminal titles.
     Based on an idea by Timo Boettcher.
   * zshrc: Cleaned up abbreviations by Alexander Steinböck.
     [Closes: issue642]
   * zshrc: source ~/.zshrc.local for root, too.
   * zshrc: Added a space to a grep related abbreviation for seamless
     typing; by Alexander Steinböck [Closes: issue616]
   * zshrc: Fix pattern to extract battery status from newer acpi
     versions. [Closes: issue657]
   * zshrc: Always read /etc/default/locale. Users are expected to
     adjust locale settings via '.zshrc.local'.
 .
   [ Michael Prokop ]
   * vimrc: add check for $NOPRECMD [Closes: issue447]
   * vimrc: enable features only if available [Closes: issue641]
   * zshrc: use 'setopt noglobdots' as [Open]SuSE uses in its
     /etc/zshrc 'setopt globdots' by default.
Checksums-Sha1: 
 62ef5f0963dbbc06fcce7734720ebd1d5f40a48b 873 grml-etc-core_0.3.65.dsc
 c131241e8dc510af121369aba69de1edd51beccf 108395 grml-etc-core_0.3.65.tar.gz
 8e6a8457af03923796f4139b08fd5aedb37b6246 110998 grml-etc-core_0.3.65_all.deb
Checksums-Sha256: 
 0df43059ce49c14ae32fb7094fc1dcd349e77268b70a020e969753756bfd29f2 873 grml-etc-core_0.3.65.dsc
 a712a6574c35e91cece4915141edfbc97fb1a9c83802ce3baa6db456dc0061b1 108395 grml-etc-core_0.3.65.tar.gz
 f0db9e49de5244a21d0a8667a160a17708367383d0b9c1d2a5a18ccb09c9441b 110998 grml-etc-core_0.3.65_all.deb
Files: 
 c8d22f616392fcd8d1654c84a55f98a1 873 grml optional grml-etc-core_0.3.65.dsc
 55c659366f4d2492e94a72891cde251a 108395 grml optional grml-etc-core_0.3.65.tar.gz
 17e5265a0096073b52ddb159ab149046 110998 grml optional grml-etc-core_0.3.65_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJ0pDt2N9T+zficugRAqU7AJ93Xfy+J87cBzt2IY4k1dqXfgBk1QCfQQlF
s/ufAFaB4gpKUmMmoWFkgH8=
=erlD
-----END PGP SIGNATURE-----
msg2102 (view) Author: ft Date: 2009-03-30.22:14:58
Kai Wilke <bts@bts.grml.org>:
> Ab Release >=1.4-1 von acpi werden keine Leerzeichen beim Output mehr am Anfang
> der Zeile angezeigt. Aus vorher "       battery..." wurde "battery....". Alles in Zeile 1077 der
> zshrc. Vorschlag zur Lösung ist:
> PERCENT="${${${(ws: :)${(M)${"$(acpi 2>/dev/null)"}##*Battery*}}[4]}%\%}"

Ich sehe nicht, warum man den Pattern dafür so verändern sollte.

[snip]
diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc
index 5b09f25..32f3831 100644
--- a/etc/zsh/zshrc
+++ b/etc/zsh/zshrc
@@ -1032,7 +1032,7 @@ fi
 
 battery() {
 if [[ $BATTERY -gt 0 ]] ; then
-    PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]##Battery <->: [^0-9]##, (<->)%*/${match[1]}}"
+    PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]#Battery <->: [^0-9]##, (<->)%*/${match[1]}}"
     if [[ -z "$PERCENT" ]] ; then
         PERCENT='acpi not present'
     else
[snap]

Das sollte funktionieren. Siehe 'man zshexpn': x# vs x##.

Ich werde das nun committen, inklusive Close: Zeile für diesen Issue.
Wenn der Patch das ganze nicht lösen sollte bitte melden.

Gruß, Frank
msg2101 (view) Author: kiste Date: 2009-03-30.21:49:41
Ab Release >=1.4-1 von acpi werden keine Leerzeichen beim Output mehr am Anfang
der Zeile angezeigt. Aus vorher "       battery..." wurde "battery....". Alles in Zeile 1077 der
zshrc. Vorschlag zur Lösung ist:
PERCENT="${${${(ws: :)${(M)${"$(acpi 2>/dev/null)"}##*Battery*}}[4]}%\%}"
History
Date User Action Args
2009-03-31 22:01:48mikasetstatus: fixed-in-git -> resolved
nosy: mika, ft, kiste
messages: + msg2112
2009-03-30 22:50:51ftsetstatus: chatting -> fixed-in-git
nosy: mika, ft, kiste
2009-03-30 22:15:47ftsetnosy: mika, ft, kiste
assignedto: kiste -> ft
2009-03-30 22:15:04ftsetstatus: unread -> chatting
nosy: mika, ft, kiste
messages: + msg2102
2009-03-30 21:49:42kistecreate