Browse code

First commit

Qurban Ullah authored on 27/02/2018 17:47:21
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,102 @@
1
+From a499a10833d525c9af794c616dc40f7425110c71 Mon Sep 17 00:00:00 2001
2
+From: Colin Watson <cjwatson@debian.org>
3
+Date: Sat, 27 Sep 2014 14:37:19 +0100
4
+Subject: Changed the javascript parser to set the tag's scope rather than
5
+ including it in the tag name.
6
+
7
+Patch from Colomban.
8
+
9
+Author: David Fishburn
10
+Origin: upstream, http://sourceforge.net/p/ctags/code/791/
11
+Bug-Debian: https://bugs.debian.org/742605
12
+Last-Update: 2014-09-27
13
+
14
+Patch-Name: jscript-set-tag-scope.patch
15
+---
16
+ jscript.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++---
17
+ 1 file changed, 51 insertions(+), 3 deletions(-)
18
+
19
+diff --git a/jscript.c b/jscript.c
20
+index 5de3367..a790355 100644
21
+--- a/jscript.c
22
+@@ -215,6 +215,7 @@ static void deleteToken (tokenInfo *const token)
23
+  *	 Tag generation functions
24
+  */
25
+ 
26
++/*
27
+ static void makeConstTag (tokenInfo *const token, const jsKind kind)
28
+ {
29
+ 	if (JsKinds [kind].enabled && ! token->ignoreTag )
30
+@@ -238,12 +239,13 @@ static void makeJsTag (tokenInfo *const token, const jsKind kind)
31
+ 
32
+ 	if (JsKinds [kind].enabled && ! token->ignoreTag )
33
+ 	{
34
+-		/*
35
++		*
36
+ 		 * If a scope has been added to the token, change the token
37
+ 		 * string to include the scope when making the tag.
38
+-		 */
39
++		 *
40
+ 		if ( vStringLength(token->scope) > 0 )
41
+ 		{
42
++			*
43
+ 			fulltag = vStringNew ();
44
+ 			vStringCopy(fulltag, token->scope);
45
+ 			vStringCatS (fulltag, ".");
46
+@@ -251,8 +253,54 @@ static void makeJsTag (tokenInfo *const token, const jsKind kind)
47
+ 			vStringTerminate(fulltag);
48
+ 			vStringCopy(token->string, fulltag);
49
+ 			vStringDelete (fulltag);
50
++			*
51
++ 			jsKind parent_kind = JSTAG_CLASS;
52
++ 
53
++ 			* 
54
++			 * if we're creating a function (and not a method),
55
++ 			 * guess we're inside another function 
56
++			 *
57
++ 			if (kind == JSTAG_FUNCTION)
58
++ 				parent_kind = JSTAG_FUNCTION;
59
++ 
60
++ 			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
61
++ 			e.extensionFields.scope[1] = vStringValue (token->scope);
62
++		}
63
++		* makeConstTag (token, kind); *
64
++ 		makeTagEntry (&e);
65
++	}
66
++}
67
++*/
68
++
69
++static void makeJsTag (tokenInfo *const token, const jsKind kind)
70
++{
71
++	if (JsKinds [kind].enabled && ! token->ignoreTag )
72
++	{
73
++		const char *const name = vStringValue (token->string);
74
++		tagEntryInfo e;
75
++		initTagEntry (&e, name);
76
++
77
++		e.lineNumber   = token->lineNumber;
78
++		e.filePosition = token->filePosition;
79
++		e.kindName	   = JsKinds [kind].name;
80
++		e.kind		   = JsKinds [kind].letter;
81
++
82
++		if ( vStringLength(token->scope) > 0 )
83
++		{
84
++			jsKind parent_kind = JSTAG_CLASS;
85
++
86
++			/* 
87
++			 * If we're creating a function (and not a method),
88
++			 * guess we're inside another function 
89
++			 */
90
++			if (kind == JSTAG_FUNCTION)
91
++				parent_kind = JSTAG_FUNCTION;
92
++
93
++			e.extensionFields.scope[0] = JsKinds [parent_kind].name;
94
++			e.extensionFields.scope[1] = vStringValue (token->scope);
95
+ 		}
96
+-		makeConstTag (token, kind);
97
++
98
++		makeTagEntry (&e);
99
+ 	}
100
+ }
101
+ 
0 102
new file mode 100644
... ...
@@ -0,0 +1,36 @@
1
+# $Id$
2
+# Maintainer: Qurban Ullah <qurbanullah@avouch.org>
3
+# Contributor: Qurban Ullah <qurbanullah@avouch.org>
4
+
5
+pkgname=ctags
6
+pkgver=5.8
7
+pkgrel=1
8
+pkgdesc="Generates an index file of language objects found in source files"
9
+arch=('i686' 'x86_64')
10
+license=('GPL')
11
+depends=('glibc')
12
+url="http://ctags.sourceforge.net/"
13
+source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
14
+        "CVE-2014-7204.patch")
15
+md5sums=('c00f82ecdcc357434731913e5b48630d'
16
+         '5fd1a8abb0e1e2d16fd4b8b870e03249')
17
+
18
+prepare() {
19
+  cd ${srcdir}/${pkgname}-${pkgver}
20
+
21
+  patch -Np1 <../CVE-2014-7204.patch
22
+}
23
+
24
+build() {
25
+  cd ${srcdir}/${pkgname}-${pkgver}
26
+
27
+  ./configure --prefix=/usr \
28
+              --disable-external-sort
29
+  make
30
+}
31
+
32
+package() {
33
+  cd ${srcdir}/${pkgname}-${pkgver}
34
+
35
+  make prefix=${pkgdir}/usr install
36
+}