summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Piasek <dagger@gentoo.org>2011-06-30 16:07:16 +0000
committerRobert Piasek <dagger@gentoo.org>2011-06-30 16:07:16 +0000
commit4b67ad7db30df1b018be0b518f4ff7617dc60fb5 (patch)
tree24a7269921998405e5d714537784a8ed6fba27c4
parentAdd version 1.2.5 (diff)
downloadgentoo-2-4b67ad7db30df1b018be0b518f4ff7617dc60fb5.tar.gz
gentoo-2-4b67ad7db30df1b018be0b518f4ff7617dc60fb5.tar.bz2
gentoo-2-4b67ad7db30df1b018be0b518f4ff7617dc60fb5.zip
add version 1.2.5 of smbtatools
(Portage version: 2.1.10.3/cvs/Linux x86_64)
-rw-r--r--net-fs/smbtatools/ChangeLog9
-rw-r--r--net-fs/smbtatools/files/dont_use_unsigned_long_long.patch92
-rw-r--r--net-fs/smbtatools/files/fix_calculating.patch65
-rw-r--r--net-fs/smbtatools/files/reorder_divisions.patch69
-rw-r--r--net-fs/smbtatools/smbtatools-1.2.5.ebuild35
5 files changed, 269 insertions, 1 deletions
diff --git a/net-fs/smbtatools/ChangeLog b/net-fs/smbtatools/ChangeLog
index 8f6109ba7105..9fafdca38e61 100644
--- a/net-fs/smbtatools/ChangeLog
+++ b/net-fs/smbtatools/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-fs/smbtatools
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/smbtatools/ChangeLog,v 1.2 2011/05/09 13:22:58 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/smbtatools/ChangeLog,v 1.3 2011/06/30 16:07:16 dagger Exp $
+
+*smbtatools-1.2.5 (30 Jun 2011)
+
+ 30 Jun 2011; Robert Piasek <dagger@gentoo.org> +smbtatools-1.2.5.ebuild,
+ +files/dont_use_unsigned_long_long.patch, +files/fix_calculating.patch,
+ +files/reorder_divisions.patch:
+ Add version 1.2.5
*smbtatools-1.2.4 (09 May 2011)
diff --git a/net-fs/smbtatools/files/dont_use_unsigned_long_long.patch b/net-fs/smbtatools/files/dont_use_unsigned_long_long.patch
new file mode 100644
index 000000000000..e920ee7ac7b4
--- /dev/null
+++ b/net-fs/smbtatools/files/dont_use_unsigned_long_long.patch
@@ -0,0 +1,92 @@
+From 572d4ecabe84f2acee433ff03518af74bcec4dfc Mon Sep 17 00:00:00 2001
+From: Holger Hetterich <hhetter@novell.com>
+Date: Tue, 7 Jun 2011 13:34:35 +0200
+Subject: [PATCH] Don't work with unsigned long long in make_human_readable as
+ lldiv doesn't work unsigned.
+
+---
+ include/common.h | 2 +-
+ src/common/common.c | 4 ++--
+ src/query/interpreter.c | 10 +++++-----
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/include/common.h b/include/common.h
+index 4f1a19d..2822f4a 100644
+--- a/include/common.h
++++ b/include/common.h
+@@ -80,7 +80,7 @@ enum IntCommands {
+ */
+ long long int common_myatoi( char *num);
+ int common_load_key_from_file( struct configuration_data *c);
+-char *common_make_human_readable( TALLOC_CTX *ctx, unsigned long long z );
++char *common_make_human_readable( TALLOC_CTX *ctx, long long z );
+ int common_connect_socket( const char *hostname,int iport );
+ char *common_create_header( TALLOC_CTX *ctx, const char *state_flags, size_t data_len);
+ void common_write_data( char *header, char *data, int dlength, int _socket);
+diff --git a/src/common/common.c b/src/common/common.c
+index 139d836..5d51649 100644
+--- a/src/common/common.c
++++ b/src/common/common.c
+@@ -32,11 +32,11 @@ void network_close_connection( int sockfd ) {
+ * unsigned long int z bytes.
+ *
+ */
+-char *common_make_human_readable( TALLOC_CTX *ctx, unsigned long long k )
++char *common_make_human_readable( TALLOC_CTX *ctx, long long int k )
+ {
+ char kbstring[20];
+ char *output;
+- long long kb = (long long ) k;
++ long long int kb = (long long ) k;
+ long long int rest = 0;
+ lldiv_t diff;
+ strcpy(kbstring,"Bytes");
+diff --git a/src/query/interpreter.c b/src/query/interpreter.c
+index 62c9ef4..caf0b26 100644
+--- a/src/query/interpreter.c
++++ b/src/query/interpreter.c
+@@ -1456,7 +1456,7 @@ void interpreter_fn_total( TALLOC_CTX *ctx,
+ {
+ char *query1, *query2, *xmldata = NULL;
+ dbi_result qdat;
+- unsigned long long sum;
++ long long sum;
+ if (command_data->argument_count != 1) {
+ printf("ERROR: function total expects one argument.\n");
+ exit(1);
+@@ -1473,12 +1473,12 @@ void interpreter_fn_total( TALLOC_CTX *ctx,
+ obj_struct->sql);
+
+ qdat = sql_query(ctx, config,query1);
+- sum = strtoull( result_get_element(ctx,0,qdat),
++ sum = strtoll( result_get_element(ctx,0,qdat),
+ NULL, 0);
+ const char *errf;
+ dbi_conn_error(config->DBIconn, &errf);
+ qdat = sql_query(ctx, config, query2);
+- sum = sum + strtoull(result_get_element(ctx,0,qdat),
++ sum = sum + strtoll(result_get_element(ctx,0,qdat),
+ NULL,0);
+ xmldata = talloc_asprintf(ctx,
+ "Total number of bytes transfered %s.",
+@@ -1493,7 +1493,7 @@ void interpreter_fn_total( TALLOC_CTX *ctx,
+ obj_struct->sql);
+ qdat = sql_query(ctx, config,query1);
+
+- sum = strtoull(result_get_element(ctx,0,qdat),
++ sum = strtoll(result_get_element(ctx,0,qdat),
+ NULL,0);
+ xmldata = talloc_asprintf(ctx,
+ "Total number of bytes read %s.",
+@@ -1507,7 +1507,7 @@ void interpreter_fn_total( TALLOC_CTX *ctx,
+ "select SUM(length) from write where %s;",
+ obj_struct->sql);
+ qdat = sql_query(ctx, config,query1);
+- sum = strtoull(result_get_element(ctx,0,qdat),
++ sum = strtoll(result_get_element(ctx,0,qdat),
+ NULL,0);
+ xmldata = talloc_asprintf(ctx,
+ "Total number of bytes written %s.",
+--
+1.7.5.3
+
diff --git a/net-fs/smbtatools/files/fix_calculating.patch b/net-fs/smbtatools/files/fix_calculating.patch
new file mode 100644
index 000000000000..5ba5e3ad1881
--- /dev/null
+++ b/net-fs/smbtatools/files/fix_calculating.patch
@@ -0,0 +1,65 @@
+From e070f22bd8605a9416a7d83c759a73059c8f1c50 Mon Sep 17 00:00:00 2001
+From: Holger Hetterich <hhetter@novell.com>
+Date: Tue, 7 Jun 2011 14:07:17 +0200
+Subject: [PATCH] Fix calculating
+
+---
+ src/common/common.c | 26 +++++++++++++-------------
+ 1 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/common/common.c b/src/common/common.c
+index 5d51649..4e6cb07 100644
+--- a/src/common/common.c
++++ b/src/common/common.c
+@@ -32,35 +32,35 @@ void network_close_connection( int sockfd ) {
+ * unsigned long int z bytes.
+ *
+ */
+-char *common_make_human_readable( TALLOC_CTX *ctx, long long int k )
++char *common_make_human_readable( TALLOC_CTX *ctx, long long int kb )
+ {
+ char kbstring[20];
+ char *output;
+- long long int kb = (long long ) k;
++ long long int result = 0;
+ long long int rest = 0;
+ lldiv_t diff;
+ strcpy(kbstring,"Bytes");
+- if (kb >= 1024) { diff = lldiv(kb, 1024); // kb
++ if (kb >= 1024) { diff = lldiv(kb, (long long) 1024); // kb
+ strcpy(kbstring,"KB");
+- kb = diff.quot;
++ result = diff.quot;
+ rest = diff.rem;
+ }
+- if (kb >= 1024) { diff = lldiv(kb+rest, 1024); // mb
++ if (kb >= 1024) { diff = lldiv(kb,(long long) 1024*1024); // mb
+ strcpy(kbstring,"MB");
+- kb = diff.quot;
++ result = diff.quot;
+ rest = diff.rem;
+ }
+ if (kb >= 1024) {
+- diff = lldiv(kb+rest,1024); // gb
+- kb = diff.quot;
+- rest = diff.rem;
++ diff = lldiv(kb,(long long) 1024*1024*1024); // gb
+ strcpy(kbstring,"GB");}
+- if (kb >= 1024) {
+- diff = lldiv(kb+rest,1024); // tb
+- kb = diff.quot;
++ result = diff.quot;
+ rest = diff.rem;
++ if (kb >= 1024) {
++ diff = lldiv(kb,(long long ) 1024*1024*1024*1024); // tb
+ strcpy(kbstring,"TB");}
+- output = talloc_asprintf( ctx,"%lli.%lli %s",kb,rest,kbstring);
++ result = diff.quot;
++ rest = diff.rem;
++ output = talloc_asprintf( ctx,"%lli.%lli %s",result,rest,kbstring);
+ return output;
+ }
+
+--
+1.7.5.3
+
diff --git a/net-fs/smbtatools/files/reorder_divisions.patch b/net-fs/smbtatools/files/reorder_divisions.patch
new file mode 100644
index 000000000000..5cb83f11503d
--- /dev/null
+++ b/net-fs/smbtatools/files/reorder_divisions.patch
@@ -0,0 +1,69 @@
+From a468c8aeb1ef35ed3f314d4ea4f47fc04c403d96 Mon Sep 17 00:00:00 2001
+From: Holger Hetterich <hhetter@novell.com>
+Date: Tue, 7 Jun 2011 14:48:28 +0200
+Subject: [PATCH] Change the order of the divisions
+
+
+diff --git a/src/common/common.c b/src/common/common.c
+index 4e6cb07..65aae46 100644
+--- a/src/common/common.c
++++ b/src/common/common.c
+@@ -36,30 +36,34 @@ char *common_make_human_readable( TALLOC_CTX *ctx, long long int kb )
+ {
+ char kbstring[20];
+ char *output;
+- long long int result = 0;
++ long long int result = kb;
+ long long int rest = 0;
+ lldiv_t diff;
+ strcpy(kbstring,"Bytes");
+- if (kb >= 1024) { diff = lldiv(kb, (long long) 1024); // kb
+- strcpy(kbstring,"KB");
+- result = diff.quot;
+- rest = diff.rem;
+- }
+- if (kb >= 1024) { diff = lldiv(kb,(long long) 1024*1024); // mb
+- strcpy(kbstring,"MB");
+- result = diff.quot;
+- rest = diff.rem;
+- }
+- if (kb >= 1024) {
+- diff = lldiv(kb,(long long) 1024*1024*1024); // gb
+- strcpy(kbstring,"GB");}
+- result = diff.quot;
+- rest = diff.rem;
+- if (kb >= 1024) {
+- diff = lldiv(kb,(long long ) 1024*1024*1024*1024); // tb
+- strcpy(kbstring,"TB");}
+- result = diff.quot;
+- rest = diff.rem;
++ if (kb >= (long long )1024*1024*1024*1024) {
++ diff = lldiv(kb,(long long ) 1024*1024*1024*1024); // tb
++ strcpy(kbstring,"TB");
++ result = diff.quot;
++ rest = diff.rem;
++ } else
++ if (kb >= (long long )1024*1024*1024) {
++ diff = lldiv(kb,(long long) 1024*1024*1024); // gb
++ strcpy(kbstring,"GB");
++ result = diff.quot;
++ rest = diff.rem;
++ } else
++ if (kb >= (long long) 1024*1024) {
++ diff = lldiv(kb,(long long) 1024*1024); // mb
++ strcpy(kbstring,"MB");
++ result = diff.quot;
++ rest = diff.rem;
++ } else
++ if (kb >= 1024) {
++ diff = lldiv(kb, (long long) 1024); // kb
++ strcpy(kbstring,"KB");
++ result = diff.quot;
++ rest = diff.rem;
++ }
+ output = talloc_asprintf( ctx,"%lli.%lli %s",result,rest,kbstring);
+ return output;
+ }
+--
+1.7.5.3
+
diff --git a/net-fs/smbtatools/smbtatools-1.2.5.ebuild b/net-fs/smbtatools/smbtatools-1.2.5.ebuild
new file mode 100644
index 000000000000..28edc158ea9a
--- /dev/null
+++ b/net-fs/smbtatools/smbtatools-1.2.5.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/smbtatools/smbtatools-1.2.5.ebuild,v 1.1 2011/06/30 16:07:16 dagger Exp $
+
+EAPI="4"
+inherit cmake-utils
+
+DESCRIPTION="Tools for configuration and query of SMB Traffic Analyzer"
+HOMEPAGE="http://github.com/hhetter/smbtatools"
+SRC_URI="http://morelias.org/smbta/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+DEPEND="dev-util/cmake
+ dev-db/libdbi
+ sys-libs/ncurses"
+RDEPEND="net-fs/smbtad"
+
+DOCS="doc/smbta-guide.html doc/gfx/*.png"
+
+PATCHES=(
+ "${FILESDIR}/dont_use_unsigned_long_long.patch"
+ "${FILESDIR}/fix_calculating.patch"
+ "${FILESDIR}/reorder_divisions.patch"
+)
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} \
+ $(cmake-utils_use debug DEBUG)"
+
+ cmake-utils_src_configure
+}