[pacman-dev] [PATCH 1/3] remove retry check from signature validation

2014-09-30 Thread Andrew Gregory
The retry path was removed by
4ccf16dff589ce9f369d377bb5d3f490bd27c624

Signed-off-by: Andrew Gregory andrew.gregor...@gmail.com
---
 lib/libalpm/sync.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 4c74a3a..27e720d 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1307,14 +1307,8 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t 
**data)
/* this can only happen maliciously */
total_bytes = total_bytes ? total_bytes : 1;
 
-   /* this one is special: -1 is failure, 1 is retry, 0 is success */
-   while(1) {
-   int ret = check_validity(handle, total, total_bytes);
-   if(ret == 0) {
-   break;
-   } else if(ret  0) {
-   return -1;
-   }
+   if(check_validity(handle, total, total_bytes) != 0) {
+   return -1;
}
 
if(trans-flags  ALPM_TRANS_FLAG_DOWNLOADONLY) {
-- 
2.1.1


[pacman-dev] [PATCH 3/3] _alpm_key_in_keychain: cache known keys

2014-09-30 Thread Andrew Gregory
Implements FS#38042

Signed-off-by: Andrew Gregory andrew.gregor...@gmail.com
---
 lib/libalpm/handle.c  | 5 +
 lib/libalpm/handle.h  | 4 
 lib/libalpm/signing.c | 6 ++
 3 files changed, 15 insertions(+)

diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 0d8ea34..0dd0e7f 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -70,6 +70,10 @@ void _alpm_handle_free(alpm_handle_t *handle)
curl_easy_cleanup(handle-curl);
 #endif
 
+#ifdef HAVE_LIBGPGME
+   FREELIST(handle-known_keys);
+#endif
+
regfree(handle-delta_regex);
 
/* free memory */
@@ -85,6 +89,7 @@ void _alpm_handle_free(alpm_handle_t *handle)
FREELIST(handle-noextract);
FREELIST(handle-ignorepkg);
FREELIST(handle-ignoregroup);
+   FREELIST(handle-known_keys);
FREE(handle);
 }
 
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index 9cd3a21..1860e6b 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -62,6 +62,10 @@ struct __alpm_handle_t {
CURL *curl; /* reusable curl_easy handle */
 #endif
 
+#ifdef HAVE_LIBGPGME
+   alpm_list_t *known_keys;  /* keys verified to be in our keychain */
+#endif
+
/* callback functions */
alpm_cb_log logcb;  /* Log callback function */
alpm_cb_download dlcb;  /* Download callback function */
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index c0fb006..8391315 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -221,6 +221,11 @@ int _alpm_key_in_keychain(alpm_handle_t *handle, const 
char *fpr)
gpgme_key_t key;
int ret = -1;
 
+   if(alpm_list_find_str(handle-known_keys, fpr)) {
+   _alpm_log(handle, ALPM_LOG_DEBUG, key %s found in cache\n, 
fpr);
+   return 1;
+   }
+
if(init_gpgme(handle)) {
/* pm_errno was set in gpgme_init() */
goto error;
@@ -238,6 +243,7 @@ int _alpm_key_in_keychain(alpm_handle_t *handle, const char 
*fpr)
ret = 0;
} else if(gpg_err_code(gpg_err) == GPG_ERR_NO_ERROR) {
_alpm_log(handle, ALPM_LOG_DEBUG, key lookup success, key 
exists\n);
+   handle-known_keys = alpm_list_add(handle-known_keys, 
strdup(fpr));
ret = 1;
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, gpg error: %s\n, 
gpgme_strerror(gpg_err));
-- 
2.1.1


Re: [pacman-dev] [PATCH 3/3] _alpm_key_in_keychain: cache known keys

2014-09-30 Thread Andrew Gregory
On 09/30/14 at 03:24pm, Andrew Gregory wrote:
 Implements FS#38042
 
 Signed-off-by: Andrew Gregory andrew.gregor...@gmail.com
 ---
  lib/libalpm/handle.c  | 5 +
  lib/libalpm/handle.h  | 4 
  lib/libalpm/signing.c | 6 ++
  3 files changed, 15 insertions(+)
 
 diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
 index 0d8ea34..0dd0e7f 100644
 --- a/lib/libalpm/handle.c
 +++ b/lib/libalpm/handle.c
 @@ -70,6 +70,10 @@ void _alpm_handle_free(alpm_handle_t *handle)
   curl_easy_cleanup(handle-curl);
  #endif
  
 +#ifdef HAVE_LIBGPGME
 + FREELIST(handle-known_keys);
 +#endif
 +
   regfree(handle-delta_regex);
  
   /* free memory */
 @@ -85,6 +89,7 @@ void _alpm_handle_free(alpm_handle_t *handle)
   FREELIST(handle-noextract);
   FREELIST(handle-ignorepkg);
   FREELIST(handle-ignoregroup);
 + FREELIST(handle-known_keys);

Obviously this should only be free'd once... fixed on my 4.2 branch.

apg


Re: [pacman-dev] Pull translation updates from Transifex

2014-09-30 Thread Alex Henrie
2014-09-29 16:04 GMT-06:00 Allan McRae al...@archlinux.org:

 On 30/09/14 05:17, Alex Henrie wrote:
  The translations have not been pulled since last June, and are in
  serious need of updating. For example, the Catalan translation contained
  the misspelling instal.lant when instal·lant was intended.
 
  I tried sending this update as a patch, but the mailing list rejected
  it because it was too large.
 

 There is no point dealing with this until we declare a string freeze for
 the upcoming release.

OK, I see. The translations were last pulled in June 2013 because the
last pacman release was in June 2013. Good luck with the upcoming
release; I hope that the translations can be corrected soon.

-Alex


[pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Miguel de Val-Borro
The website sarovar.org has been shut down. Link is replaced by the latest
available archive.org capture from August 2013.

Signed-off-by: Miguel de Val-Borro mig...@archlinux.net
---
 doc/translation-help.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/translation-help.txt b/doc/translation-help.txt
index 1fdb6e0..523ca1d 100644
--- a/doc/translation-help.txt
+++ b/doc/translation-help.txt
@@ -14,7 +14,7 @@ gettext website is a very useful guide to read before 
embarking on translation
 work, as it describes many of the commands in more detail than I will here:
 https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
 addition, this site presents a small tutorial that I found useful:
-http://oriya.sarovar.org/docs/gettext/[].
+https://web.archive.org/web/20130802092826/http://oriya.sarovar.org/docs/gettext/[].
 
 
 Translating Messages
-- 
2.1.1


[pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Miguel de Val-Borro
The website sarovar.org has been shut down. Link is replaced by the latest
available archive.org capture from August 2013.

Signed-off-by: Miguel de Val-Borro mig...@archlinux.net
---
 doc/translation-help.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/translation-help.txt b/doc/translation-help.txt
index 1fdb6e0..523ca1d 100644
--- a/doc/translation-help.txt
+++ b/doc/translation-help.txt
@@ -14,7 +14,7 @@ gettext website is a very useful guide to read before 
embarking on translation
 work, as it describes many of the commands in more detail than I will here:
 https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
 addition, this site presents a small tutorial that I found useful:
-http://oriya.sarovar.org/docs/gettext/[].
+https://web.archive.org/web/20130802092826/http://oriya.sarovar.org/docs/gettext/[].
 
 
 Translating Messages
-- 
2.1.1


Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Andrew Gregory
On 09/30/14 at 04:24pm, Miguel de Val-Borro wrote:
 The website sarovar.org has been shut down. Link is replaced by the latest
 available archive.org capture from August 2013.
 
 Signed-off-by: Miguel de Val-Borro mig...@archlinux.net
 ---
  doc/translation-help.txt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/doc/translation-help.txt b/doc/translation-help.txt
 index 1fdb6e0..523ca1d 100644
 --- a/doc/translation-help.txt
 +++ b/doc/translation-help.txt
 @@ -14,7 +14,7 @@ gettext website is a very useful guide to read before 
 embarking on translation
  work, as it describes many of the commands in more detail than I will here:
  https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
  addition, this site presents a small tutorial that I found useful:
 -http://oriya.sarovar.org/docs/gettext/[].
 +https://web.archive.org/web/20130802092826/http://oriya.sarovar.org/docs/gettext/[].
  
  
  Translating Messages
 -- 
 2.1.1

It looks like that tutorial is actually part of gettext.[1]  Is there
nothing more official than an archived copy that we can direct people
to?

[1] 
http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/doc/tutorial.html

apg


Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Johannes Löthberg

On 30/09, Andrew Gregory wrote:

It looks like that tutorial is actually part of gettext.[1]  Is there
nothing more official than an archived copy that we can direct people
to?


Only one I can find is another third-party one[1]. Might be a good idea 
to either ask the GNU people to host a version or for Arch to host our 
own copy.


[1]: http://multivac.fatburen.org/localdoc/gettext/tutorial.html

--
Sincerely,
 Johannes Löthberg
 PGP Key ID: 3A9D0BB5


pgp6AB3B_WSRc.pgp
Description: PGP signature


Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Dan McGee
On Tue, Sep 30, 2014 at 5:16 PM, Johannes Löthberg johan...@kyriasis.com
wrote:

 On 30/09, Andrew Gregory wrote:

 It looks like that tutorial is actually part of gettext.[1]  Is there
 nothing more official than an archived copy that we can direct people
 to?


 Only one I can find is another third-party one[1]. Might be a good idea to
 either ask the GNU people to host a version or for Arch to host our own
 copy.

 [1]: http://multivac.fatburen.org/localdoc/gettext/tutorial.html


Guys, let's not bikeshed here, why not just kill it? This is some link I
added in 2007 (commit 0e5326a767), far prior to Transifex existing, and
probably isn't even relevant anymore.

-Dan


Re: [pacman-dev] [PATCH 3/3] _alpm_key_in_keychain: cache known keys

2014-09-30 Thread Allan McRae
On 01/10/14 05:24, Andrew Gregory wrote:
 Implements FS#38042
 
 Signed-off-by: Andrew Gregory andrew.gregor...@gmail.com
 ---

The three patches in this series look fine.

Allan


Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Allan McRae
On 01/10/14 08:27, Dan McGee wrote:
 On Tue, Sep 30, 2014 at 5:16 PM, Johannes Löthberg johan...@kyriasis.com
 wrote:
 
 On 30/09, Andrew Gregory wrote:

 It looks like that tutorial is actually part of gettext.[1]  Is there
 nothing more official than an archived copy that we can direct people
 to?


 Only one I can find is another third-party one[1]. Might be a good idea to
 either ask the GNU people to host a version or for Arch to host our own
 copy.

 [1]: http://multivac.fatburen.org/localdoc/gettext/tutorial.html


 Guys, let's not bikeshed here, why not just kill it? This is some link I
 added in 2007 (commit 0e5326a767), far prior to Transifex existing, and
 probably isn't even relevant anymore.
 

Agreed.


Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Miguel de Val-Borro
On Tue, Sep 30, 2014 at 04:53:56PM -0400, Andrew Gregory wrote:
 On 09/30/14 at 04:24pm, Miguel de Val-Borro wrote:
  The website sarovar.org has been shut down. Link is replaced by the latest
  available archive.org capture from August 2013.
  
  Signed-off-by: Miguel de Val-Borro mig...@archlinux.net
  ---
   doc/translation-help.txt | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/doc/translation-help.txt b/doc/translation-help.txt
  index 1fdb6e0..523ca1d 100644
  --- a/doc/translation-help.txt
  +++ b/doc/translation-help.txt
  @@ -14,7 +14,7 @@ gettext website is a very useful guide to read before 
  embarking on translation
   work, as it describes many of the commands in more detail than I will here:
   https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
   addition, this site presents a small tutorial that I found useful:
  -http://oriya.sarovar.org/docs/gettext/[].
  +https://web.archive.org/web/20130802092826/http://oriya.sarovar.org/docs/gettext/[].
   
   
   Translating Messages
  -- 
  2.1.1
 
 It looks like that tutorial is actually part of gettext.[1]  Is there
 nothing more official than an archived copy that we can direct people
 to?
 
 [1] 
 http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/doc/tutorial.html

I did not notice that the tutorial is now in the gettext repository. It
seems that it is not available under the gettext documentation website
and the text has not been updated since 2004. Perhaps just removing
this sentence and link to sarovar.org should be fine?

Miguel


[pacman-dev] [PATCH] doc/translation-help.txt: Remove link to tutorial on sarovar.org

2014-09-30 Thread Miguel de Val-Borro
The website sarovar.org has been shut down and the tutorial is
not relevant any more.

Signed-off-by: Miguel de Val-Borro mig...@archlinux.net
---
 doc/translation-help.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/doc/translation-help.txt b/doc/translation-help.txt
index 1fdb6e0..52c1e89 100644
--- a/doc/translation-help.txt
+++ b/doc/translation-help.txt
@@ -12,9 +12,7 @@ http://www.transifex.net/projects/p/archlinux-pacman/[pacman 
project page].
 NOTE: This may be old information due to our switch to Transifex, but the
 gettext website is a very useful guide to read before embarking on translation
 work, as it describes many of the commands in more detail than I will here:
-https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].  In
-addition, this site presents a small tutorial that I found useful:
-http://oriya.sarovar.org/docs/gettext/[].
+https://www.gnu.org/software/gettext/manual/html_node/gettext.html[].
 
 
 Translating Messages
-- 
2.1.1