summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Tsai <scottt.tw@gmail.com>2013-01-18 02:33:55 +0800
committerScott Tsai <scottt.tw@gmail.com>2013-01-18 02:36:38 +0800
commit83fdb75f08ed16c009f69524198e61fad201c5d5 (patch)
tree232d73f3245bf555fc9efd31282b5a472226f5e8
parent45d414f31e8b49f5b41afe56a58aa71ecd17cd14 (diff)
downloadpython-pycparser-83fdb75f08ed16c009f69524198e61fad201c5d5.tar.gz
python-pycparser-83fdb75f08ed16c009f69524198e61fad201c5d5.tar.xz
python-pycparser-83fdb75f08ed16c009f69524198e61fad201c5d5.zip
comment 11
-rw-r--r--pycparser-unittests-sys-path.patch24
-rw-r--r--python-pycparser.spec24
2 files changed, 42 insertions, 6 deletions
diff --git a/pycparser-unittests-sys-path.patch b/pycparser-unittests-sys-path.patch
new file mode 100644
index 0000000..e786973
--- /dev/null
+++ b/pycparser-unittests-sys-path.patch
@@ -0,0 +1,24 @@
+# HG changeset patch
+# User Scott Tsai <scottt.tw@gmail.com>
+# Date 1358446261 -28800
+# Node ID 12aa73c5da595a08f587c14a74e84bf72f0bf7a0
+# Parent a46039840b0ed8466bebcddae9d4f1df60d3bc98
+tests/all_tests.py: add local paths to the front of sys.path
+
+While doing pycparser development on a machine that already has an
+older version of pycparser installed, we want unit tests to run against
+the local copy instead of the system wide copy of pycparser.
+This patch adds '.' and '..' to the front of sys.path instead of the back.
+
+diff --git a/tests/all_tests.py b/tests/all_tests.py
+--- a/tests/all_tests.py
++++ b/tests/all_tests.py
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env python
+
+ import sys
+-sys.path.extend(['.', '..'])
++sys.path[0:0] = ['.', '..']
+
+ import unittest
+
diff --git a/python-pycparser.spec b/python-pycparser.spec
index bf04d67..ab7ea07 100644
--- a/python-pycparser.spec
+++ b/python-pycparser.spec
@@ -1,15 +1,26 @@
+# NOTE: "hgrev" and "version" should match, e.g.
+# revision 82ace14bb612 is tagged as "release_v2.09.1" in
+# https://bitbucket.org/eliben/pycparser
+
+%global hgrev 82ace14bb612
+
Name: python-pycparser
-Version: 2.08
+Version: 2.09.1
Release: 1%{?dist}
Summary: C parser and AST generator written in Python
License: BSD
-URL: http://code.google.com/p/pycparser/
-Source0: http://pycparser.googlecode.com/files/pycparser-%{version}.tar.gz
+URL: https://bitbucket.org/eliben/pycparser
+# tarball generated by bitbucket from mercurial tag:
+# https://bitbucket.org/eliben/pycparser/commits/%{hgrev}
+Source0: eliben-pycparser-%{hgrev}.tar.bz2
Source1: remove-relative-sys-path
+# https://bitbucket.org/eliben/pycparser/pull-request/2/tests-all_testspy-add-local-paths-to-the/diff
+Patch0: pycparser-unittests-sys-path.patch
BuildArch: noarch
+BuildRequires: python2-devel
# for unit tests
BuildRequires: python-ply
BuildRequires: dos2unix
@@ -23,7 +34,8 @@ need to parse C source code.
%prep
-%setup -q -n pycparser-%{version}
+%setup -q -n eliben-pycparser-%{hgrev}
+%patch0 -p1
# examples
cp %SOURCE1 .
@@ -45,5 +57,5 @@ dos2unix LICENSE
%{python_sitelib}/pycparser-*.egg-info
%changelog
-* Tue Jun 18 2012 <scottt.tw@gmail.com> Scott Tsai 2.08-1
-- upstream 2.08
+* Fri Jan 18 2013 Scott Tsai <scottt.tw@gmail.com> 2.09.1-1
+- upstream 2.09.1