flickcurl: new package for darktable
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Licensed under the GNU General Public License, version 3.
|
||||||
|
# See the file http://www.gnu.org/copyleft/gpl.txt
|
||||||
|
|
||||||
|
from pisi.actionsapi import get
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
from pisi.actionsapi import autotools
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
autotools.configure("--disable-static \
|
||||||
|
--with-raptor=2")
|
||||||
|
|
||||||
|
pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
|
||||||
|
|
||||||
|
def build():
|
||||||
|
autotools.make()
|
||||||
|
|
||||||
|
def install():
|
||||||
|
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
|
||||||
|
|
||||||
|
pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING.*", "LICENSE.*", "README")
|
||||||
|
|
||||||
|
# By PiSiDo 2.0.0
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
From a5cc2a5d2fc7074f50fbaa772232b6e0fea7ce89 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dave Beckett <dave@dajobe.org>
|
||||||
|
Date: Sun, 25 Jan 2015 15:44:27 -0800
|
||||||
|
Subject: [PATCH] Make form use/free api saner and prevent double free. Fixes
|
||||||
|
Issue #28
|
||||||
|
|
||||||
|
---
|
||||||
|
src/common.c | 31 +++++++++++++++++++++----------
|
||||||
|
src/flickcurl_internal.h | 2 +-
|
||||||
|
src/oauth.c | 34 ++++++++++++++++++----------------
|
||||||
|
3 files changed, 40 insertions(+), 27 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/common.c b/src/common.c
|
||||||
|
index 1fcc67d..348c78f 100644
|
||||||
|
--- a/src/common.c
|
||||||
|
+++ b/src/common.c
|
||||||
|
@@ -1516,14 +1516,18 @@ flickcurl_invoke_get_content(flickcurl *fc, size_t* size_p)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * INTERNAL - free a form.
|
||||||
|
+ */
|
||||||
|
void
|
||||||
|
-flickcurl_free_form(char **form, int count)
|
||||||
|
+flickcurl_free_form(char **form)
|
||||||
|
{
|
||||||
|
if(!form)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* free content which is the first key */
|
||||||
|
- free(form[0]);
|
||||||
|
+ if(form[0])
|
||||||
|
+ free(form[0]);
|
||||||
|
|
||||||
|
free(form);
|
||||||
|
}
|
||||||
|
@@ -1537,10 +1541,16 @@ flickcurl_free_form(char **form, int count)
|
||||||
|
* INTERNAL - decoded content from current request as HTTP FORM and return fields
|
||||||
|
*
|
||||||
|
* NOTE: The result may be an empty array with just two NULL
|
||||||
|
-* terminating pointers if there are no fields.
|
||||||
|
+* terminating pointers if there are no fields or no content.
|
||||||
|
+*
|
||||||
|
+* If @count_p is not NULL, *@count_p is set to the number of pairs of
|
||||||
|
+* fields.
|
||||||
|
+*
|
||||||
|
+* Index 0 is used to store the raw content.
|
||||||
|
+*
|
||||||
|
+* Return value: NULL on failure or an array of [char* field name,
|
||||||
|
+* char* field value] starting at index 1, terminated by a NULL pair.
|
||||||
|
*
|
||||||
|
-* Return value: array of [char* field name, char* field value] with
|
||||||
|
-* NULL pair terminating or NULL on failure
|
||||||
|
*/
|
||||||
|
char**
|
||||||
|
flickcurl_invoke_get_form_content(flickcurl *fc, int* count_p)
|
||||||
|
@@ -1562,21 +1572,24 @@ flickcurl_invoke_get_form_content(flickcurl *fc, int* count_p)
|
||||||
|
count++; /* counting separators so need +1 for number of contents */
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* Allocate count + 1 sized array of char* (key, value) pointers
|
||||||
|
+ /* Allocate 1+ count + 1 sized array of char* (key, value) pointers
|
||||||
|
* The last pair are always (NULL, NULL).
|
||||||
|
*
|
||||||
|
* The pointers are into the 'content' buffer which is kept around
|
||||||
|
* and owned by this array and stored in form[0].
|
||||||
|
*/
|
||||||
|
- form = (char**)calloc(2*(count + 1), sizeof(char*));
|
||||||
|
+ form = (char**)calloc(1 + 2*(count + 1), sizeof(char*));
|
||||||
|
if(!form) {
|
||||||
|
if(content)
|
||||||
|
free(content);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* the form owns the content array */
|
||||||
|
+ form[0] = content;
|
||||||
|
+
|
||||||
|
if(content) {
|
||||||
|
- for(p = content, i = 0; *p; p++) {
|
||||||
|
+ for(p = content, i = 1; *p; p++) {
|
||||||
|
char *start = p;
|
||||||
|
|
||||||
|
while(*p && *p != '&' && *p != '=')
|
||||||
|
@@ -1590,8 +1603,6 @@ flickcurl_invoke_get_form_content(flickcurl *fc, int* count_p)
|
||||||
|
}
|
||||||
|
form[i++] = NULL;
|
||||||
|
form[i] = NULL;
|
||||||
|
-
|
||||||
|
- free(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count_p)
|
||||||
|
diff --git a/src/flickcurl_internal.h b/src/flickcurl_internal.h
|
||||||
|
index 4904341..3082978 100644
|
||||||
|
--- a/src/flickcurl_internal.h
|
||||||
|
+++ b/src/flickcurl_internal.h
|
||||||
|
@@ -119,7 +119,7 @@ xmlDocPtr flickcurl_invoke(flickcurl *fc);
|
||||||
|
char* flickcurl_invoke_get_content(flickcurl *fc, size_t* size_p);
|
||||||
|
/* Invoke URI prepared above and get back 'count' key/values */
|
||||||
|
char** flickcurl_invoke_get_form_content(flickcurl *fc, int* count_p);
|
||||||
|
-void flickcurl_free_form(char **form, int count);
|
||||||
|
+void flickcurl_free_form(char **form);
|
||||||
|
|
||||||
|
/* args.c */
|
||||||
|
void flickcurl_free_arg(flickcurl_arg *arg);
|
||||||
|
diff --git a/src/oauth.c b/src/oauth.c
|
||||||
|
index d1f649e..8ac4e3c 100644
|
||||||
|
--- a/src/oauth.c
|
||||||
|
+++ b/src/oauth.c
|
||||||
|
@@ -741,11 +741,12 @@ flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback)
|
||||||
|
uri, count);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- for(i = 0; i < (2 * count); i += 2) {
|
||||||
|
- if(!strcmp(form[i], "oauth_token")) {
|
||||||
|
- request_token = form[i+1];
|
||||||
|
- } else if(!strcmp(form[i], "oauth_token_secret")) {
|
||||||
|
- request_token_secret = form[i+1];
|
||||||
|
+ for(i = 0; i < count; i++) {
|
||||||
|
+ int offset = 1 + (2 * i);
|
||||||
|
+ if(!strcmp(form[offset], "oauth_token")) {
|
||||||
|
+ request_token = form[offset+1];
|
||||||
|
+ } else if(!strcmp(form[offset], "oauth_token_secret")) {
|
||||||
|
+ request_token_secret = form[offset+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -771,7 +772,7 @@ flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback)
|
||||||
|
|
||||||
|
tidy:
|
||||||
|
if(form)
|
||||||
|
- flickcurl_free_form(form, count);
|
||||||
|
+ flickcurl_free_form(form);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
@@ -888,15 +889,16 @@ flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier)
|
||||||
|
uri, count);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- for(i = 0; i < (2 * count); i += 2) {
|
||||||
|
- if(!strcmp(form[i], "oauth_token")) {
|
||||||
|
- access_token = form[i+1];
|
||||||
|
- } else if(!strcmp(form[i], "oauth_token_secret")) {
|
||||||
|
- access_token_secret = form[i+1];
|
||||||
|
- } else if(!strcmp(form[i], "username")) {
|
||||||
|
- username = form[i+1];
|
||||||
|
- } else if(!strcmp(form[i], "user_nsid")) {
|
||||||
|
- user_nsid = form[i+1];
|
||||||
|
+ for(i = 0; i < count; i++) {
|
||||||
|
+ int offset = 1 + (2 * i);
|
||||||
|
+ if(!strcmp(form[offset], "oauth_token")) {
|
||||||
|
+ access_token = form[offset+1];
|
||||||
|
+ } else if(!strcmp(form[offset], "oauth_token_secret")) {
|
||||||
|
+ access_token_secret = form[offset+1];
|
||||||
|
+ } else if(!strcmp(form[offset], "username")) {
|
||||||
|
+ username = form[offset+1];
|
||||||
|
+ } else if(!strcmp(form[offset], "user_nsid")) {
|
||||||
|
+ user_nsid = form[offset+1];
|
||||||
|
}
|
||||||
|
/* ignoring: fullname */
|
||||||
|
}
|
||||||
|
@@ -952,7 +954,7 @@ flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier)
|
||||||
|
|
||||||
|
tidy:
|
||||||
|
if(form)
|
||||||
|
- flickcurl_free_form(form, count);
|
||||||
|
+ flickcurl_free_form(form);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||||
|
<PISI>
|
||||||
|
<Source>
|
||||||
|
<Name>flickcurl</Name>
|
||||||
|
<Homepage>http://librdf.org/flickcurl/</Homepage>
|
||||||
|
<Packager>
|
||||||
|
<Name>PisiLinux Community</Name>
|
||||||
|
<Email>admin@pisilinux.org</Email>
|
||||||
|
</Packager>
|
||||||
|
<License>GPLv2</License>
|
||||||
|
<IsA>app:console</IsA>
|
||||||
|
<IsA>library</IsA>
|
||||||
|
<Summary>C library for the Flickr API</Summary>
|
||||||
|
<Description>Flickcurl is a C library for the Flickr API, handling creating the requests, signing, token management, calling the API, marshalling request parameters and decoding responses.</Description>
|
||||||
|
<Archive sha1sum="547480030ce4f777bb35d98b43fe15ee3eeae0e0" type="targz">http://download.dajobe.org/flickcurl/flickcurl-1.26.tar.gz</Archive>
|
||||||
|
<BuildDependencies>
|
||||||
|
<Dependency>curl-devel</Dependency>
|
||||||
|
<Dependency>raptor2-devel</Dependency>
|
||||||
|
<Dependency>libxml2-devel</Dependency>
|
||||||
|
</BuildDependencies>
|
||||||
|
<Patches>
|
||||||
|
<Patch>a5cc2a5d2fc7074f50fbaa772232b6e0fea7ce89.patch</Patch>
|
||||||
|
</Patches>
|
||||||
|
</Source>
|
||||||
|
|
||||||
|
<Package>
|
||||||
|
<Name>flickcurl</Name>
|
||||||
|
<RuntimeDependencies>
|
||||||
|
<Dependency>curl</Dependency>
|
||||||
|
<Dependency>raptor2</Dependency>
|
||||||
|
<Dependency>libxml2</Dependency>
|
||||||
|
</RuntimeDependencies>
|
||||||
|
<Files>
|
||||||
|
<Path fileType="executable">/usr/bin</Path>
|
||||||
|
<Path fileType="library">/usr/lib/</Path>
|
||||||
|
<Path fileType="doc">/usr/share/doc</Path>
|
||||||
|
<Path fileType="man">/usr/share/man</Path>
|
||||||
|
</Files>
|
||||||
|
</Package>
|
||||||
|
|
||||||
|
<Package>
|
||||||
|
<Name>flickcurl-devel</Name>
|
||||||
|
<Summary>flickurl için geliştirme dosyaları</Summary>
|
||||||
|
<RuntimeDependencies>
|
||||||
|
<Dependency release="current">flickcurl</Dependency>
|
||||||
|
<Dependency>raptor2-devel</Dependency>
|
||||||
|
</RuntimeDependencies>
|
||||||
|
<Files>
|
||||||
|
<Path fileType="header">/usr/include</Path>
|
||||||
|
<Path fileType="doc">/usr/share/gtk-doc</Path>
|
||||||
|
<Path fileType="data">/usr/lib/pkgconfig</Path>
|
||||||
|
</Files>
|
||||||
|
</Package>
|
||||||
|
|
||||||
|
<History>
|
||||||
|
<Update release="1">
|
||||||
|
<Date>2018-10-14</Date>
|
||||||
|
<Version>1.26</Version>
|
||||||
|
<Comment>First release</Comment>
|
||||||
|
<Name>Kamil Atlı</Name>
|
||||||
|
<Email>suvari@pisilinux.org</Email>
|
||||||
|
</Update>
|
||||||
|
</History>
|
||||||
|
</PISI>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<PISI>
|
||||||
|
<Source>
|
||||||
|
<Name>flickcurl</Name>
|
||||||
|
<Summary xml:lang="tr">Flickr API için C Kitaplığı</Summary>
|
||||||
|
<Description xml:lang="tr">Flickcurl oluşan istekleri taşıma, imzalama, token yönetimi, API çağırma, istenilen parametreleri sıralama ve yanıtları çözme işlemleri için bir C kitaplığıdır.</Description>
|
||||||
|
</Source>
|
||||||
|
|
||||||
|
<Package>
|
||||||
|
<Name>flickcurl-devel</Name>
|
||||||
|
<Summary xml:lang="tr">flickcurl için geliştirme dosyaları</Summary>
|
||||||
|
</Package>
|
||||||
|
</PISI>
|
||||||
|
|
||||||
Reference in New Issue
Block a user