summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@gentoo.org>2011-04-13 08:43:50 +0000
committerNirbheek Chauhan <nirbheek@gentoo.org>2011-04-13 08:43:50 +0000
commit0ebfbc7b8fae0912fd37bb1fed8f21320af01df2 (patch)
tree5706219d7b8f78334613e2854a8f107ce71bd3ad /app-misc
parentVersion bump. Fix pdf installation and remove old. (diff)
downloadgentoo-2-0ebfbc7b8fae0912fd37bb1fed8f21320af01df2.tar.gz
gentoo-2-0ebfbc7b8fae0912fd37bb1fed8f21320af01df2.tar.bz2
gentoo-2-0ebfbc7b8fae0912fd37bb1fed8f21320af01df2.zip
Bringing in upstream CVS 1.57 of pwsafe.cpp plus upstream patches #3259375, #3259514, and #3259580.
(Portage version: 2.1.9.45/cvs/Linux x86_64)
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/pwsafe/ChangeLog12
-rw-r--r--app-misc/pwsafe/files/pwsafe-0.2.0-cvs-1.57.patch57
-rw-r--r--app-misc/pwsafe/files/pwsafe-0.2.0-fake-readline.patch107
-rw-r--r--app-misc/pwsafe/files/pwsafe-0.2.0-man-page-option-syntax.patch30
-rw-r--r--app-misc/pwsafe/files/pwsafe-0.2.0-printf.patch43
-rw-r--r--app-misc/pwsafe/metadata.xml12
-rw-r--r--app-misc/pwsafe/pwsafe-0.2.0-r1.ebuild46
7 files changed, 304 insertions, 3 deletions
diff --git a/app-misc/pwsafe/ChangeLog b/app-misc/pwsafe/ChangeLog
index 7107298a7956..6f4144e77bf7 100644
--- a/app-misc/pwsafe/ChangeLog
+++ b/app-misc/pwsafe/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for app-misc/pwsafe
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/pwsafe/ChangeLog,v 1.8 2011/03/27 20:49:53 nirbheek Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/pwsafe/ChangeLog,v 1.9 2011/04/13 08:43:50 nirbheek Exp $
+
+*pwsafe-0.2.0-r1 (13 Apr 2011)
+
+ 13 Apr 2011; Christopher Head (Hawk777) <headch@gmail.com>
+ +pwsafe-0.2.0-r1.ebuild, +files/pwsafe-0.2.0-cvs-1.57.patch,
+ +files/pwsafe-0.2.0-fake-readline.patch,
+ +files/pwsafe-0.2.0-man-page-option-syntax.patch,
+ +files/pwsafe-0.2.0-printf.patch, metadata.xml:
+ Bringing in upstream CVS 1.57 of pwsafe.cpp plus upstream patches
+ #3259375, #3259514, and #3259580.
27 Mar 2011; Nirbheek Chauhan <nirbheek@gentoo.org> metadata.xml:
Add new maintainer + proxy-maintainer
diff --git a/app-misc/pwsafe/files/pwsafe-0.2.0-cvs-1.57.patch b/app-misc/pwsafe/files/pwsafe-0.2.0-cvs-1.57.patch
new file mode 100644
index 000000000000..9119abed769e
--- /dev/null
+++ b/app-misc/pwsafe/files/pwsafe-0.2.0-cvs-1.57.patch
@@ -0,0 +1,57 @@
+Index: pwsafe.cpp
+===================================================================
+RCS file: /cvsroot/pwsafe/pwsafe/pwsafe.cpp,v
+retrieving revision 1.56
+retrieving revision 1.57
+diff -u -r1.56 -r1.57
+--- pwsafe.cpp 30 Sep 2005 10:30:56 -0000 1.56
++++ pwsafe.cpp 12 Aug 2007 12:33:06 -0000 1.57
+@@ -3,7 +3,7 @@
+
+ Copyright (C) 2004-2005 Nicolas S. Dade
+
+- $Id: pwsafe-0.2.0-cvs-1.57.patch,v 1.1 2011/04/13 08:43:49 nirbheek Exp $
++ $Id: pwsafe-0.2.0-cvs-1.57.patch,v 1.1 2011/04/13 08:43:49 nirbheek Exp $
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+@@ -3346,6 +3346,12 @@
+ }
+
+ bufpos += rc;
++ buf[bufpos] = '\0';
++
++ if (rc == 0) {
++ // EOF (ctrl-D)
++ break;
++ }
+
+ if (bufpos == buflen && !strchr(buf,'\n')) {
+ // we needed a bigger buffer
+@@ -3354,6 +3360,7 @@
+ fprintf(stderr, "Error: %s out of memory\n", program_name);
+ memset(buf,0,buflen);
+ free(buf);
++ throw FailEx();
+ }
+
+ memcpy(new_buf, buf, bufpos);
+@@ -3364,9 +3371,15 @@
+ }
+ }
+
+- int len = strchr(buf,'\n') - buf;
+- saved.assign(buf+len+1, bufpos-(len+1));
+- buf[len] = '\0';
++ char* lf = strchr(buf,'\n');
++ if (lf) {
++ // save the rest of the input for later
++ saved.assign(lf+1);
++ *lf = '\0';
++ } else {
++ saved.assign("",0);
++ }
++
+ return buf;
+ }
+ #endif // WITH_READLINE
diff --git a/app-misc/pwsafe/files/pwsafe-0.2.0-fake-readline.patch b/app-misc/pwsafe/files/pwsafe-0.2.0-fake-readline.patch
new file mode 100644
index 000000000000..4e0f4ad4dfd6
--- /dev/null
+++ b/app-misc/pwsafe/files/pwsafe-0.2.0-fake-readline.patch
@@ -0,0 +1,107 @@
+Index: pwsafe.cpp
+===================================================================
+RCS file: /cvsroot/pwsafe/pwsafe/pwsafe.cpp,v
+retrieving revision 1.57
+diff -u -r1.57 pwsafe.cpp
+--- pwsafe.cpp 12 Aug 2007 12:33:06 -0000 1.57
++++ pwsafe.cpp 30 Mar 2011 07:22:11 -0000
+@@ -3325,61 +3325,48 @@
+ static char* readline(const char* prompt) {
+ printf("%s", prompt);
+ fflush(stdout);
+-
+- static secstring saved;
+- int buflen = saved.length() + 100;
+- int bufpos = saved.length();
+- char* buf = reinterpret_cast<char*>(malloc(buflen+1));
+- if (!buf)
+- throw FailEx();
+- memcpy(buf, saved.data(), saved.length());
+- buf[saved.length()] = '\0';
+-
+- while (!strchr(buf,'\n')) {
+- const int rc = ::read(STDIN_FILENO, buf+bufpos, buflen);
+-
+- if (rc == -1) {
+- fprintf(stderr, "Error: %s read(STDIN) failed: %s\n", program_name, strerror(errno));
+- memset(buf,0,buflen);
+- free(buf);
+- throw FailEx();
+- }
+-
+- bufpos += rc;
+- buf[bufpos] = '\0';
+-
+- if (rc == 0) {
+- // EOF (ctrl-D)
+- break;
+- }
+-
+- if (bufpos == buflen && !strchr(buf,'\n')) {
+- // we needed a bigger buffer
+- char* new_buf = reinterpret_cast<char*>(malloc(2*buflen+1));
+- if (!new_buf) {
+- fprintf(stderr, "Error: %s out of memory\n", program_name);
+- memset(buf,0,buflen);
+- free(buf);
+- throw FailEx();
+- }
+
+- memcpy(new_buf, buf, bufpos);
+- memset(buf, 0, buflen);
+- free(buf);
+- buf = new_buf;
+- buflen *= 2;
+- }
+- }
++ size_t buflen = 100;
++ size_t bufpos = 0;
++ char* buf = static_cast<char*>(malloc(buflen+1));
++ if (!buf)
++ throw FailEx();
+
+- char* lf = strchr(buf,'\n');
+- if (lf) {
+- // save the rest of the input for later
+- saved.assign(lf+1);
+- *lf = '\0';
+- } else {
+- saved.assign("",0);
++ for (;;) {
++ const ssize_t rc = ::read(STDIN_FILENO, buf+bufpos, 1);
++ if (rc == -1) {
++ fprintf(stderr, "Error: %s read(STDIN) failed: %s\n", program_name, strerror(errno));
++ memset(buf,0,bufpos);
++ free(buf);
++ throw FailEx();
++ } else if (rc == 0) {
++ // EOF (ctrl-D)
++ break;
++ } else if (buf[bufpos] == '\n') {
++ // end of line
++ break;
++ }
++
++ ++bufpos;
++
++ if (bufpos == buflen) {
++ // we need a bigger buffer
++ char* new_buf = static_cast<char*>(malloc(2*buflen+1));
++ if (!new_buf) {
++ fprintf(stderr, "Error: %s out of memory\n", program_name);
++ memset(buf,0,bufpos);
++ free(buf);
++ throw FailEx();
++ }
++ memcpy(new_buf, buf, bufpos);
++ memset(buf, 0, bufpos);
++ free(buf);
++ buf = new_buf;
++ buflen *= 2;
++ }
+ }
+
++ buf[bufpos] = '\0';
+ return buf;
+ }
+ #endif // WITH_READLINE
diff --git a/app-misc/pwsafe/files/pwsafe-0.2.0-man-page-option-syntax.patch b/app-misc/pwsafe/files/pwsafe-0.2.0-man-page-option-syntax.patch
new file mode 100644
index 000000000000..a83d3a83d8eb
--- /dev/null
+++ b/app-misc/pwsafe/files/pwsafe-0.2.0-man-page-option-syntax.patch
@@ -0,0 +1,30 @@
+Index: pwsafe.1.in
+===================================================================
+RCS file: /cvsroot/pwsafe/pwsafe/pwsafe.1.in,v
+retrieving revision 1.8
+diff -u -r1.8 pwsafe.1.in
+--- pwsafe.1.in 18 Mar 2006 14:17:41 -0000 1.8
++++ pwsafe.1.in 30 Mar 2011 07:42:23 -0000
+@@ -52,18 +52,18 @@
+ .B \-\-passwd
+ Change the database's passphrase.
+ .TP
+-.B \-\-list[=REGEX]
++.B \-\-list [REGEX]
+ List all [matching] entries in database.
+ .BR
+ If \-u or \-p is given then REGEX must match only one entry, and only the requested field(s) are emitted.
+ .TP
+-.B \-a, \-\-add[=NAME]
++.B \-a, \-\-add [NAME]
+ Add an entry to database.
+ .TP
+-.B \-e, \-\-edit=REGEX
++.B \-e, \-\-edit REGEX
+ Edit an entry.
+ .TP
+-.B \-\-delete=NAME
++.B \-\-delete NAME
+ Delete an entry from database.
+ .TP
+ If no command is given, an interactive mode is entered.
diff --git a/app-misc/pwsafe/files/pwsafe-0.2.0-printf.patch b/app-misc/pwsafe/files/pwsafe-0.2.0-printf.patch
new file mode 100644
index 000000000000..409f3a7220ed
--- /dev/null
+++ b/app-misc/pwsafe/files/pwsafe-0.2.0-printf.patch
@@ -0,0 +1,43 @@
+Index: pwsafe.cpp
+===================================================================
+RCS file: /cvsroot/pwsafe/pwsafe/pwsafe.cpp,v
+retrieving revision 1.57
+diff -u -r1.57 pwsafe.cpp
+--- pwsafe.cpp 12 Aug 2007 12:33:06 -0000 1.57
++++ pwsafe.cpp 30 Mar 2011 05:44:07 -0000
+@@ -1619,7 +1619,7 @@
+ snprintf(ent_buf, sizeof(ent_buf), "%d", entropy_needed);
+ ent_buf[sizeof(ent_buf)-1] = '\0';
+ char len_buf[24];
+- snprintf(len_buf, sizeof(len_buf), "%d", pw.length());
++ snprintf(len_buf, sizeof(len_buf), "%lu", static_cast<unsigned long>(pw.length()));
+ len_buf[sizeof(len_buf)-1] = '\0';
+ switch (tolower(get1char("Use "+pw+"\ntype "+type_name+", length "+len_buf+", "+ent_buf+" bits of entropy [y/N/ /+/-/q/?] ? ", 'n'))) {
+ case 'y':
+@@ -2380,7 +2380,7 @@
+ version = VERSION_1_7;
+ }
+
+- if (arg_verbose > 1) printf("read in %u entries\n", entries.size());
++ if (arg_verbose > 1) printf("read in %lu entries\n", static_cast<unsigned long>(entries.size()));
+
+ opened = true;
+ return true;
+@@ -2601,7 +2601,7 @@
+ for (matches_t::const_iterator i=matches.begin(); i!=matches.end() && count < 3; ++i, ++count)
+ printf("%s%s", (count?", ":""), (*i)->groupname().c_str());
+ if (count != matches.size())
+- printf(", ... (%u more) ", matches.size()-3);
++ printf(", ... (%lu more) ", static_cast<unsigned long>(matches.size()-3));
+ printf(".\n");
+ throw FailEx();
+ }
+@@ -2637,7 +2637,7 @@
+ // print out the UUID too
+ fprintf(outfile, "%s\n", formatuuid(e.uuid).c_str());
+ if (!e.extras.empty())
+- fprintf(outfile, "and %u unknown extra fields\n", e.extras.size());
++ fprintf(outfile, "and %lu unknown extra fields\n", static_cast<unsigned long>(e.extras.size()));
+ }
+ } else
+ // just print out the name
diff --git a/app-misc/pwsafe/metadata.xml b/app-misc/pwsafe/metadata.xml
index c6c9ea091424..bb3559e6d4c9 100644
--- a/app-misc/pwsafe/metadata.xml
+++ b/app-misc/pwsafe/metadata.xml
@@ -13,7 +13,15 @@
</maintainer>
<longdescription lang="en">
pwsafe is a commandline password database utility compatible with
- Counterpane's Passwordsafe. It is compatible with Counterpane Passwordsafe
- 1.9.x and 2.0 databases. It can interact with X11 selection and clipboard.
+ Counterpane's Password Safe. It is compatible with Counterpane Password
+ Safe 1.9.x and 2.0 databases. It can interact with X11 selection and
+ clipboard.
</longdescription>
+ <upstream>
+ <maintainer>
+ <email>ndade@nsd.dyndns.org</email>
+ <name>Nicolas Dade</name>
+ </maintainer>
+ <remote-id type="sourceforge">pwsafe</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/app-misc/pwsafe/pwsafe-0.2.0-r1.ebuild b/app-misc/pwsafe/pwsafe-0.2.0-r1.ebuild
new file mode 100644
index 000000000000..62f61a9e761c
--- /dev/null
+++ b/app-misc/pwsafe/pwsafe-0.2.0-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/pwsafe/pwsafe-0.2.0-r1.ebuild,v 1.1 2011/04/13 08:43:50 nirbheek Exp $
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="A Password Safe compatible command-line password manager"
+HOMEPAGE="http://nsd.dyndns.org/pwsafe/"
+SRC_URI="http://nsd.dyndns.org/pwsafe/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="X readline"
+
+DEPEND="sys-libs/ncurses
+ dev-libs/openssl
+ readline? ( sys-libs/readline )
+ X? ( x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXmu
+ x11-libs/libX11 )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-cvs-1.57.patch"
+ epatch "${FILESDIR}/${P}-printf.patch"
+ epatch "${FILESDIR}/${P}-fake-readline.patch"
+ epatch "${FILESDIR}/${P}-man-page-option-syntax.patch"
+}
+
+src_configure() {
+ econf $(use_with X x) $(use_with readline) || die
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ doman pwsafe.1 || die
+ dobin pwsafe || die
+ dodoc README NEWS || die
+}