rpms/i3status/F-12 i3status-2.0-18c4b9866d395720077e815d85755a8ac54354ca.patch, NONE, 1.1 i3status-2.0-37882cee889d556a932d26084119f516d6639b13.patch, NONE, 1.1 i3status-2.0-6823fbf05537ca88716f403235cea5e7064ef9b1.patch, NONE, 1.1 i3status-2.0-9307ff9d131a70164a50e57e3aa3115c92715925.patch, NONE, 1.1 i3status-2.0-998109a6537c4534652673ff25d72a502cb15605.patch, NONE, 1.1 i3status-2.0-9c14b7a527a34f0ed04a53c72fe85f4d21f094ec.patch, NONE, 1.1 i3status-2.0-a5594ee17f967d037a558b55aba0ae6c6e1077b9.patch, NONE, 1.1 i3status-2.0-c166d2e2d312e198a4dc9039302c5b82ed2805d1.patch, NONE, 1.1 i3status-2.0-ced822f4611b7c3f6df49cae188ab05aa65ab0d6.patch, NONE, 1.1 i3status.spec, 1.1, 1.2

Simon Wesp cassmodiah at fedoraproject.org
Fri Feb 5 20:04:07 UTC 2010


Author: cassmodiah

Update of /cvs/pkgs/rpms/i3status/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13347

Modified Files:
	i3status.spec 
Added Files:
	i3status-2.0-18c4b9866d395720077e815d85755a8ac54354ca.patch 
	i3status-2.0-37882cee889d556a932d26084119f516d6639b13.patch 
	i3status-2.0-6823fbf05537ca88716f403235cea5e7064ef9b1.patch 
	i3status-2.0-9307ff9d131a70164a50e57e3aa3115c92715925.patch 
	i3status-2.0-998109a6537c4534652673ff25d72a502cb15605.patch 
	i3status-2.0-9c14b7a527a34f0ed04a53c72fe85f4d21f094ec.patch 
	i3status-2.0-a5594ee17f967d037a558b55aba0ae6c6e1077b9.patch 
	i3status-2.0-c166d2e2d312e198a4dc9039302c5b82ed2805d1.patch 
	i3status-2.0-ced822f4611b7c3f6df49cae188ab05aa65ab0d6.patch 
Log Message:
* Sat Feb 05 2010 Simon Wesp <cassmodiah at fedoraproject.org> - 2.0-2
- Some bugfixes (sync with upstream)
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=9307ff9d131a70164a50e57e3aa3115c92715925
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=a5594ee17f967d037a558b55aba0ae6c6e1077b9
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=998109a6537c4534652673ff25d72a502cb15605
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=37882cee889d556a932d26084119f516d6639b13
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=ced822f4611b7c3f6df49cae188ab05aa65ab0d6
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=6823fbf05537ca88716f403235cea5e7064ef9b1
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=c166d2e2d312e198a4dc9039302c5b82ed2805d1
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=9c14b7a527a34f0ed04a53c72fe85f4d21f094ec
- Add patch http://code.stapelberg.de/git/i3status/commit/?id=18c4b9866d395720077e815d85755a8ac54354ca


i3status-2.0-18c4b9866d395720077e815d85755a8ac54354ca.patch:
 i3status.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- NEW FILE i3status-2.0-18c4b9866d395720077e815d85755a8ac54354ca.patch ---
>From 18c4b9866d395720077e815d85755a8ac54354ca Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Fri, 29 Jan 2010 23:02:17 +0100
Subject: Instead of a relative sleep(1), sleep until the full second

This makes sure you don’t lag behind up to nearly one second in
the worst case, depending on the start time of your i3status.
---
diff --git i3status-2.0.orig/i3status.c i3status-2.0/i3status.c
index f2d055d..59fedf8 100644
--- i3status-2.0.orig/i3status.c
+++ i3status-2.0/i3status.c
@@ -22,6 +22,8 @@
 #include <glob.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <time.h>
+#include <sys/time.h>
 
 #include "i3status.h"
 
@@ -186,6 +188,8 @@ int main(int argc, char *argv[]) {
         if ((general_socket = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
                 die("Could not create socket\n");
 
+        int interval = cfg_getint(cfg_general, "interval");
+
         while (1) {
                 for (j = 0; j < cfg_size(cfg, "order"); j++) {
                         if (j > 0)
@@ -223,6 +227,13 @@ int main(int argc, char *argv[]) {
                 printf("\n");
                 fflush(stdout);
 
-                sleep(cfg_getint(cfg_general, "interval"));
+                /* To provide updates on every full second (as good as possible)
+                 * we don’t use sleep(interval) but we sleep until the next
+                 * second (with microsecond precision) plus (interval-1)
+                 * seconds. */
+                struct timeval current_time;
+                gettimeofday(&current_time, NULL);
+                struct timespec ts = {interval - 1, (10e5 - current_time.tv_usec) * 1000};
+                nanosleep(&ts, NULL);
         }
 }
--
cgit v0.8.3

i3status-2.0-37882cee889d556a932d26084119f516d6639b13.patch:
 print_ipv6_addr.c |   59 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 35 insertions(+), 24 deletions(-)

--- NEW FILE i3status-2.0-37882cee889d556a932d26084119f516d6639b13.patch ---
>From 37882cee889d556a932d26084119f516d6639b13 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Fri, 01 Jan 2010 21:01:57 +0100
Subject: ipv6: reuse the existing socket for further lookups

This reduces network overhead if you do not run a local caching
nameserver.
---
diff --git i3status-2.0.orig/src/print_ipv6_addr.c i3status-2.0/src/print_ipv6_addr.c
index fcb2df8..fd02dba 100644
--- i3status-2.0.orig/src/print_ipv6_addr.c
+++ i3status-2.0/src/print_ipv6_addr.c
@@ -8,15 +8,46 @@
 #include <string.h>
 #include <arpa/inet.h>
 
+static void print_sockname(int fd) {
+        static char buf[INET6_ADDRSTRLEN+1];
+        struct sockaddr_storage local;
+        int ret;
+
+        socklen_t local_len = sizeof(struct sockaddr_storage);
+        if (getsockname(fd, (struct sockaddr*)&local, &local_len) == -1) {
+                perror("getsockname()");
+                (void)close(fd);
+                printf("no IPv6");
+                return;
+        }
+
+        memset(buf, 0, INET6_ADDRSTRLEN + 1);
+        if ((ret = getnameinfo((struct sockaddr*)&local, local_len,
+                               buf, sizeof(buf), NULL, 0,
+                               NI_NUMERICHOST)) != 0) {
+                fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
+                printf("no IPv6");
+                return;
+        }
+
+        printf("%s", buf);
+}
+
 /*
  * Returns the IPv6 address with which you have connectivity at the moment.
  *
  */
 static void print_ipv6_addr() {
-        static char buf[INET6_ADDRSTRLEN+1];
         struct addrinfo hints;
         struct addrinfo *result, *resp;
-        int fd;
+        static int fd = -1;
+
+        /* To save dns lookups (if they are not cached locally) and creating
+         * sockets, we save the fd and keep it open. */
+        if (fd > -1) {
+                print_sockname(fd);
+                return;
+        }
 
         memset(&hints, 0, sizeof(struct addrinfo));
         hints.ai_family = AF_INET6;
@@ -52,29 +83,10 @@ static void print_ipv6_addr() {
                         continue;
                 }
 
-                struct sockaddr_storage local;
-                socklen_t local_len = sizeof(struct sockaddr_storage);
-                if (getsockname(fd, (struct sockaddr*)&local, &local_len) == -1) {
-                        perror("getsockname()");
-                        (void)close(fd);
-                        printf("no IPv6");
-                        return;
-                }
-
-                (void)close(fd);
+                free(result);
 
-                memset(buf, 0, INET6_ADDRSTRLEN + 1);
-                int ret;
-                if ((ret = getnameinfo((struct sockaddr*)&local, local_len,
-                                       buf, sizeof(buf), NULL, 0,
-                                       NI_NUMERICHOST)) != 0) {
-                        fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
-                        printf("no IPv6");
-                        return;
-                }
+                print_sockname(fd);
 
-                free(result);
-                printf("%s", buf);
                 return;
         }
 
--
cgit v0.8.3

i3status-2.0-6823fbf05537ca88716f403235cea5e7064ef9b1.patch:
 print_disk_info.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- NEW FILE i3status-2.0-6823fbf05537ca88716f403235cea5e7064ef9b1.patch ---
>From 6823fbf05537ca88716f403235cea5e7064ef9b1 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Sun, 10 Jan 2010 10:07:21 +0100
Subject: disk: also round when printing TB (Thanks Merovius)

---
diff --git i3status-2.0.orig/src/print_disk_info.c i3status-2.0/src/print_disk_info.c
index 11111db..3bd2bf8 100644
--- i3status-2.0.orig/src/print_disk_info.c
+++ i3status-2.0/src/print_disk_info.c
@@ -20,7 +20,7 @@
  */
 static void print_bytes_human(uint64_t bytes) {
         if (bytes > TERABYTE)
-                printf("%f TB", (double)bytes / TERABYTE);
+                printf("%.02f TB", (double)bytes / TERABYTE);
         else if (bytes > GIGABYTE)
                 printf("%.01f GB", (double)bytes / GIGABYTE);
         else if (bytes > MEGABYTE)
--
cgit v0.8.3

i3status-2.0-9307ff9d131a70164a50e57e3aa3115c92715925.patch:
 i3status.conf    |    2 +-
 src/print_load.c |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

--- NEW FILE i3status-2.0-9307ff9d131a70164a50e57e3aa3115c92715925.patch ---
>From 9307ff9d131a70164a50e57e3aa3115c92715925 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Sun, 13 Dec 2009 12:59:59 +0100
Subject: The load values represent 1,5,15 min, not 5,10,15 min (Thanks Chris)

---
diff --git i3status-2.0.orig/i3status.conf i3status-2.0/i3status.conf
index 1e120cf..774aa06 100644
--- i3status-2.0.orig/i3status.conf
+++ i3status-2.0/i3status.conf
@@ -42,7 +42,7 @@ time {
 }
 
 load {
-	format = "%5min"
+	format = "%1min"
 }
 
 cpu_temperature 0 {
diff --git i3status-2.0.orig/src/print_load.c i3status-2.0/src/print_load.c
index c0d9494..9fe1964 100644
--- i3status-2.0.orig/src/print_load.c
+++ i3status-2.0/src/print_load.c
@@ -20,14 +20,14 @@ void print_load(const char *format) {
                         continue;
                 }
 
-                if (BEGINS_WITH(walk+1, "5min")) {
+                if (BEGINS_WITH(walk+1, "1min")) {
                         (void)printf("%1.2f", loadavg[0]);
-                        walk += strlen("5min");
+                        walk += strlen("1min");
                 }
 
-                if (BEGINS_WITH(walk+1, "10min")) {
+                if (BEGINS_WITH(walk+1, "5min")) {
                         (void)printf("%1.2f", loadavg[1]);
-                        walk += strlen("10min");
+                        walk += strlen("5min");
                 }
 
                 if (BEGINS_WITH(walk+1, "15min")) {
--
cgit v0.8.3

i3status-2.0-998109a6537c4534652673ff25d72a502cb15605.patch:
 print_battery_info.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- NEW FILE i3status-2.0-998109a6537c4534652673ff25d72a502cb15605.patch ---
>From 998109a6537c4534652673ff25d72a502cb15605 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Sun, 20 Dec 2009 17:45:46 +0100
Subject: Remove trailing whitespace

---
diff --git i3status-2.0.orig/src/print_battery_info.c i3status-2.0/src/print_battery_info.c
index 460134d..c806493 100644
--- i3status-2.0.orig/src/print_battery_info.c
+++ i3status-2.0/src/print_battery_info.c
@@ -106,7 +106,7 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
 
                 (void)snprintf(remainingbuf, sizeof(remainingbuf), "%02d:%02d:%02d",
                         max(hours, 0), max(minutes, 0), max(seconds, 0));
-                
+
                 empty_time = time(NULL);
                 empty_time += seconds_remaining;
                 empty_tm = localtime(&empty_time);
--
cgit v0.8.3

i3status-2.0-9c14b7a527a34f0ed04a53c72fe85f4d21f094ec.patch:
 print_wireless_info.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- NEW FILE i3status-2.0-9c14b7a527a34f0ed04a53c72fe85f4d21f094ec.patch ---
>From 9c14b7a527a34f0ed04a53c72fe85f4d21f094ec Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Tue, 26 Jan 2010 13:25:37 +0100
Subject: wireless: display no IP instead of (null)

---
diff --git i3status-2.0.orig/src/print_wireless_info.c i3status-2.0/src/print_wireless_info.c
index b8bdefe..946c589 100644
--- i3status-2.0.orig/src/print_wireless_info.c
+++ i3status-2.0/src/print_wireless_info.c
@@ -86,7 +86,10 @@ void print_wireless_info(const char *interface, const char *format_up, const cha
                 }
 
                 if (BEGINS_WITH(walk+1, "ip")) {
-                        (void)printf("%s", get_ip_addr(interface));
+                        const char *ip_address = get_ip_addr(interface);
+                        if (ip_address != NULL)
+                                (void)printf("%s", get_ip_addr(interface));
+                        else (void)printf("no IP");
                         walk += strlen("ip");
                 }
         }
--
cgit v0.8.3

i3status-2.0-a5594ee17f967d037a558b55aba0ae6c6e1077b9.patch:
 print_battery_info.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

--- NEW FILE i3status-2.0-a5594ee17f967d037a558b55aba0ae6c6e1077b9.patch ---
>From a5594ee17f967d037a558b55aba0ae6c6e1077b9 Mon Sep 17 00:00:00 2001
From: André-Patrick Bubel <code at andre-bubel.de>
Date: Tue, 08 Dec 2009 10:32:46 +0100
Subject: Implemented showing the time when battery is empty

---
diff --git i3status-2.0.orig/src/print_battery_info.c i3status-2.0/src/print_battery_info.c
index aec6dee..460134d 100644
--- i3status-2.0.orig/src/print_battery_info.c
+++ i3status-2.0/src/print_battery_info.c
@@ -1,4 +1,5 @@
 // vim:ts=8:expandtab
+#include <time.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -17,10 +18,13 @@
  *
  */
 void print_battery_info(int number, const char *format, bool last_full_capacity) {
+        time_t empty_time;
+        struct tm *empty_tm;
         char buf[1024];
         char statusbuf[16];
         char percentagebuf[16];
         char remainingbuf[256];
+        char emptytimebuf[256];
         const char *walk, *last;
         int full_design = -1,
             remaining = -1,
@@ -30,6 +34,7 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
         memset(statusbuf, '\0', sizeof(statusbuf));
         memset(percentagebuf, '\0', sizeof(percentagebuf));
         memset(remainingbuf, '\0', sizeof(remainingbuf));
+        memset(emptytimebuf, '\0', sizeof(emptytimebuf));
 
 #if defined(LINUX)
         static char batpath[512];
@@ -85,21 +90,29 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
 
         if (present_rate > 0) {
                 float remaining_time;
-                int seconds, hours, minutes;
+                int seconds, hours, minutes, seconds_remaining;
                 if (status == CS_CHARGING)
                         remaining_time = ((float)full_design - (float)remaining) / (float)present_rate;
                 else if (status == CS_DISCHARGING)
                         remaining_time = ((float)remaining / (float)present_rate);
                 else remaining_time = 0;
 
-                seconds = (int)(remaining_time * 3600.0);
-                hours = seconds / 3600;
-                seconds -= (hours * 3600);
+                seconds_remaining = (int)(remaining_time * 3600.0);
+
+                hours = seconds_remaining / 3600;
+                seconds = seconds_remaining - (hours * 3600);
                 minutes = seconds / 60;
                 seconds -= (minutes * 60);
 
                 (void)snprintf(remainingbuf, sizeof(remainingbuf), "%02d:%02d:%02d",
                         max(hours, 0), max(minutes, 0), max(seconds, 0));
+                
+                empty_time = time(NULL);
+                empty_time += seconds_remaining;
+                empty_tm = localtime(&empty_time);
+
+                (void)snprintf(emptytimebuf, sizeof(emptytimebuf), "%02d:%02d:%02d",
+                        max(empty_tm->tm_hour, 0), max(empty_tm->tm_min, 0), max(empty_tm->tm_sec, 0));
         }
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
         int state;
@@ -165,6 +178,9 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
                 } else if (strncmp(walk+1, "remaining", strlen("remaining")) == 0) {
                         printf("%s", remainingbuf);
                         walk += strlen("remaining");
+                } else if (strncmp(walk+1, "emptytime", strlen("emptytime")) == 0) {
+                        printf("%s", emptytimebuf);
+                        walk += strlen("emptytime");
                 }
         }
 }
--
cgit v0.8.3

i3status-2.0-c166d2e2d312e198a4dc9039302c5b82ed2805d1.patch:
 print_ip_addr.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- NEW FILE i3status-2.0-c166d2e2d312e198a4dc9039302c5b82ed2805d1.patch ---
>From c166d2e2d312e198a4dc9039302c5b82ed2805d1 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Tue, 26 Jan 2010 13:25:21 +0100
Subject: get_ip_address: return NULL instead of down

---
diff --git i3status-2.0.orig/src/print_ip_addr.c i3status-2.0/src/print_ip_addr.c
index 6ddd35a..e719d2f 100644
--- i3status-2.0.orig/src/print_ip_addr.c
+++ i3status-2.0/src/print_ip_addr.c
@@ -25,10 +25,8 @@ const char *get_ip_addr(const char *interface) {
 
         getifaddrs(&ifaddr);
 
-        if (ifaddr == NULL) {
-                (void)snprintf(part, sizeof(part), "E: down");
-                return part;
-        }
+        if (ifaddr == NULL)
+                return NULL;
 
         addrp = ifaddr;
 
--
cgit v0.8.3

i3status-2.0-ced822f4611b7c3f6df49cae188ab05aa65ab0d6.patch:
 print_ipv6_addr.c |   72 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 42 insertions(+), 30 deletions(-)

--- NEW FILE i3status-2.0-ced822f4611b7c3f6df49cae188ab05aa65ab0d6.patch ---
>From ced822f4611b7c3f6df49cae188ab05aa65ab0d6 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael at stapelberg.de>
Date: Mon, 04 Jan 2010 10:16:59 +0100
Subject: ipv6: cache the result of the DNS query only, the socket needs to be re-created every time

---
diff --git i3status-2.0.orig/src/print_ipv6_addr.c i3status-2.0/src/print_ipv6_addr.c
index fd02dba..b9486be 100644
--- i3status-2.0.orig/src/print_ipv6_addr.c
+++ i3status-2.0/src/print_ipv6_addr.c
@@ -1,5 +1,6 @@
 // vim:ts=8:expandtab
 #include <stdio.h>
+#include <stdbool.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
@@ -8,17 +9,38 @@
 #include <string.h>
 #include <arpa/inet.h>
 
-static void print_sockname(int fd) {
+static bool print_sockname(struct addrinfo *addr) {
         static char buf[INET6_ADDRSTRLEN+1];
         struct sockaddr_storage local;
         int ret;
+        int fd;
+
+        if ((fd = socket(addr->ai_family, SOCK_DGRAM, 0)) == -1) {
+                perror("socket()");
+                return false;
+        }
+
+        /* Since the socket was created with SOCK_DGRAM, this is
+         * actually not establishing a connection or generating
+         * any other network traffic. Instead, as a side-effect,
+         * it saves the local address with which packets would
+         * be sent to the destination. */
+        if (connect(fd, addr->ai_addr, addr->ai_addrlen) == -1) {
+                /* We don’t display the error here because most
+                 * likely, there just is no IPv6 connectivity.
+                 * Thus, don’t spam the user’s console but just
+                 * try the next address. */
+                (void)close(fd);
+                return false;
+        }
+
 
         socklen_t local_len = sizeof(struct sockaddr_storage);
         if (getsockname(fd, (struct sockaddr*)&local, &local_len) == -1) {
                 perror("getsockname()");
                 (void)close(fd);
                 printf("no IPv6");
-                return;
+                return true;
         }
 
         memset(buf, 0, INET6_ADDRSTRLEN + 1);
@@ -26,11 +48,14 @@ static void print_sockname(int fd) {
                                buf, sizeof(buf), NULL, 0,
                                NI_NUMERICHOST)) != 0) {
                 fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
+                (void)close(fd);
                 printf("no IPv6");
-                return;
+                return true;
         }
 
+        (void)close(fd);
         printf("%s", buf);
+        return true;
 }
 
 /*
@@ -40,14 +65,13 @@ static void print_sockname(int fd) {
 static void print_ipv6_addr() {
         struct addrinfo hints;
         struct addrinfo *result, *resp;
-        static int fd = -1;
+        static struct addrinfo *cached = NULL;
 
         /* To save dns lookups (if they are not cached locally) and creating
          * sockets, we save the fd and keep it open. */
-        if (fd > -1) {
-                print_sockname(fd);
-                return;
-        }
+        if (cached != NULL)
+                if (print_sockname(cached))
+                        return;
 
         memset(&hints, 0, sizeof(struct addrinfo));
         hints.ai_family = AF_INET6;
@@ -64,33 +88,22 @@ static void print_ipv6_addr() {
         }
 
         for (resp = result; resp != NULL; resp = resp->ai_next) {
-                if ((fd = socket(resp->ai_family, SOCK_DGRAM, 0)) == -1) {
-                        perror("socket()");
+                if (!print_sockname(resp))
                         continue;
-                }
 
-                /* Since the socket was created with SOCK_DGRAM, this is
-                 * actually not establishing a connection or generating
-                 * any other network traffic. Instead, as a side-effect,
-                 * it saves the local address with which packets would
-                 * be sent to the destination. */
-                if (connect(fd, resp->ai_addr, resp->ai_addrlen) == -1) {
-                        /* We don’t display the error here because most
-                         * likely, there just is no IPv6 connectivity.
-                         * Thus, don’t spam the user’s console but just
-                         * try the next address. */
-                        (void)close(fd);
-                        continue;
+                if ((cached = malloc(sizeof(struct addrinfo))) == NULL)
+                        return;
+                memcpy(cached, resp, sizeof(struct addrinfo));
+                if ((cached->ai_addr = malloc(resp->ai_addrlen)) == NULL) {
+                        cached = NULL;
+                        return;
                 }
-
-                free(result);
-
-                print_sockname(fd);
-
+                memcpy(cached->ai_addr, resp->ai_addr, resp->ai_addrlen);
+                freeaddrinfo(result);
                 return;
         }
 
-        free(result);
+        freeaddrinfo(result);
         printf("no IPv6");
 }
 
--
cgit v0.8.3


Index: i3status.spec
===================================================================
RCS file: /cvs/pkgs/rpms/i3status/F-12/i3status.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- i3status.spec	2 Dec 2009 19:50:07 -0000	1.1
+++ i3status.spec	5 Feb 2010 20:04:07 -0000	1.2
@@ -1,6 +1,6 @@
 Name:           i3status
 Version:        2.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Generates a status line for dzen2 or wmii
 
 Group:          User Interface/Desktops
@@ -9,9 +9,29 @@ URL:            http://i3.zekjur.net/i3s
 Source0:        http://i3.zekjur.net/%{name}/%{name}-%{version}.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# The load values represent 1,5,15 min, not 5,10,15 min (Thanks Chris)
+Patch0: %{name}-2.0-9307ff9d131a70164a50e57e3aa3115c92715925.patch
+# Implemented showing the time when battery is empty
+Patch1: %{name}-2.0-a5594ee17f967d037a558b55aba0ae6c6e1077b9.patch
+# Remove trailing whitespace
+Patch2: %{name}-2.0-998109a6537c4534652673ff25d72a502cb15605.patch
+# ipv6: reuse the existing socket for further lookups
+Patch3: %{name}-2.0-37882cee889d556a932d26084119f516d6639b13.patch
+# ipv6: cache the result of the DNS query only, the socket needs to be re-created every time
+Patch4: %{name}-2.0-ced822f4611b7c3f6df49cae188ab05aa65ab0d6.patch
+# disk: also round when printing TB (Thanks Merovius)
+Patch5: %{name}-2.0-6823fbf05537ca88716f403235cea5e7064ef9b1.patch
+# get_ip_address: return NULL instead of down
+Patch6: %{name}-2.0-c166d2e2d312e198a4dc9039302c5b82ed2805d1.patch
+# wireless: display no IP instead of (null)
+Patch7: %{name}-2.0-9c14b7a527a34f0ed04a53c72fe85f4d21f094ec.patch
+# Instead of a relative sleep(1), sleep until the full second
+Patch8: %{name}-2.0-18c4b9866d395720077e815d85755a8ac54354ca.patch
+
 BuildRequires:  libconfuse-devel
 BuildRequires:  wireless-tools-devel
 BuildRequires:  asciidoc
+BuildRequires:  libAfterImage-devel
 
 
 %description
@@ -22,12 +42,18 @@ pseudo filesystem.
 %prep
 %setup -q
 
-#####         I M P O R T A N T          #####
-##### !!!! TO CHECK ON EVERY UPDATE !!!! #####
-# honor optflags
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+
 sed -e 's|CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare|CFLAGS+=%{optflags} -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare|g' \
     -i Makefile
-##############################################
 
 
 %build
@@ -36,7 +62,13 @@ make %{?_smp_mflags} 
 
 %install
 rm -rf %{buildroot}
-make install DESTDIR=%{buildroot} INSTALL="install -p"
+make install \
+     DESTDIR=%{buildroot} \
+     INSTALL="install -p"
+
+mkdir -p %{buildroot}/%{_sysconfdir}/
+install -Dpm0644 %{name}.conf \
+        %{buildroot}/%{_sysconfdir}/%{name}.conf
 
 
 %clean
@@ -49,8 +81,22 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/%{name}.conf
 %{_bindir}/%{name}
 %{_mandir}/man*/%{name}*
+%{_sysconfdir}/%{name}.conf
 
 
 %changelog
+* Sat Feb 05 2010 Simon Wesp <cassmodiah at fedoraproject.org> - 2.0-2
+- Some bugfixes (sync with upstream)
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=9307ff9d131a70164a50e57e3aa3115c92715925
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=a5594ee17f967d037a558b55aba0ae6c6e1077b9
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=998109a6537c4534652673ff25d72a502cb15605
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=37882cee889d556a932d26084119f516d6639b13
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=ced822f4611b7c3f6df49cae188ab05aa65ab0d6
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=6823fbf05537ca88716f403235cea5e7064ef9b1
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=c166d2e2d312e198a4dc9039302c5b82ed2805d1
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=9c14b7a527a34f0ed04a53c72fe85f4d21f094ec
+- Add patch http://code.stapelberg.de/git/i3status/commit/?id=18c4b9866d395720077e815d85755a8ac54354ca
+
+
 * Wed Dec 02 2009 Simon Wesp <cassmodiah at fedoraproject.org> - 2.0-1
 - Package build for Fedora



More information about the scm-commits mailing list