- add pccts for testing zip archives.
- modify archivetests accordingly.
This commit is contained in:
+14
-12
@@ -53,7 +53,7 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
"5af9dd7d754f788cf511c57ce0af3d555fed009d")
|
"5af9dd7d754f788cf511c57ce0af3d555fed009d")
|
||||||
|
|
||||||
def testUnpackZip(self):
|
def testUnpackZip(self):
|
||||||
bctx = BuildContext("tests/sandbox/pspec.xml")
|
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||||
|
|
||||||
assert bctx.spec.source.archiveType == "zip"
|
assert bctx.spec.source.archiveType == "zip"
|
||||||
|
|
||||||
@@ -62,22 +62,24 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
achv.unpack(cleanDir=True)
|
achv.unpack(cleanDir=True)
|
||||||
|
|
||||||
targetDir = bctx.pkg_work_dir()
|
targetDir = bctx.pkg_work_dir()
|
||||||
assert pathexists(targetDir + "/sandbox")
|
assert pathexists(targetDir + "/pccts")
|
||||||
|
|
||||||
testfile = targetDir + "/sandbox/loremipsum.txt"
|
testfile = targetDir + "/pccts/history.txt"
|
||||||
assert pathexists(testfile)
|
assert pathexists(testfile)
|
||||||
|
|
||||||
# check file integrity
|
# check file integrity
|
||||||
self.assertEqual(util.sha1_file(testfile),
|
self.assertEqual(util.sha1_file(testfile),
|
||||||
"80abb91ee44eb6eb69defa1e0760e58451351b94")
|
"f2be0f9783e84e98fe4e2b8201a8f506fcc07a4d")
|
||||||
|
|
||||||
|
# TODO: no link file in pccts package. Need to find a ZIP file
|
||||||
|
# containing a symlink
|
||||||
# check for symbolic links
|
# check for symbolic links
|
||||||
testfile = targetDir + "/sandbox/testdir/link1"
|
# testfile = targetDir + "/sandbox/testdir/link1"
|
||||||
assert islink(testfile)
|
# assert islink(testfile)
|
||||||
|
|
||||||
def testMakeZip(self):
|
def testMakeZip(self):
|
||||||
# first unpack our dear sandbox.zip
|
# first unpack our dear sandbox.zip
|
||||||
bctx = BuildContext("tests/sandbox/pspec.xml")
|
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||||
targetDir = bctx.pkg_work_dir()
|
targetDir = bctx.pkg_work_dir()
|
||||||
achv = sourcearchive.SourceArchive(bctx)
|
achv = sourcearchive.SourceArchive(bctx)
|
||||||
achv.fetch(interactive=False)
|
achv.fetch(interactive=False)
|
||||||
@@ -86,7 +88,7 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
newZip = targetDir + "/new.zip"
|
newZip = targetDir + "/new.zip"
|
||||||
zip = archive.ArchiveZip(newZip, 'zip', 'w')
|
zip = archive.ArchiveZip(newZip, 'zip', 'w')
|
||||||
sourceDir = targetDir + "/sandbox"
|
sourceDir = targetDir + "/pccts"
|
||||||
zip.add_to_archive(sourceDir)
|
zip.add_to_archive(sourceDir)
|
||||||
zip.close()
|
zip.close()
|
||||||
|
|
||||||
@@ -94,7 +96,7 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
def testUnpackZipCond(self):
|
def testUnpackZipCond(self):
|
||||||
bctx = BuildContext("tests/sandbox/pspec.xml")
|
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||||
url = uri.URI(bctx.spec.source.archiveUri)
|
url = uri.URI(bctx.spec.source.archiveUri)
|
||||||
targetDir = bctx.pkg_work_dir()
|
targetDir = bctx.pkg_work_dir()
|
||||||
filePath = join(config.archives_dir(), url.filename())
|
filePath = join(config.archives_dir(), url.filename())
|
||||||
@@ -106,9 +108,9 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
assert bctx.spec.source.archiveType == "zip"
|
assert bctx.spec.source.archiveType == "zip"
|
||||||
|
|
||||||
achv = archive.Archive(filePath, bctx.spec.source.archiveType)
|
achv = archive.Archive(filePath, bctx.spec.source.archiveType)
|
||||||
achv.unpack_files(["sandbox/loremipsum.txt"], targetDir)
|
achv.unpack_files(["pccts/history.txt"], targetDir)
|
||||||
assert pathexists(targetDir + "/sandbox")
|
assert pathexists(targetDir + "/pccts")
|
||||||
testfile = targetDir + "/sandbox/loremipsum.txt"
|
testfile = targetDir + "/pccts/history.txt"
|
||||||
assert pathexists(testfile)
|
assert pathexists(testfile)
|
||||||
|
|
||||||
suite = unittest.makeSuite(ArchiveFileTestCase)
|
suite = unittest.makeSuite(ArchiveFileTestCase)
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright (C) 2005, TUBITAK/UEKAE
|
||||||
|
#
|
||||||
|
# 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 the Free
|
||||||
|
# Software Foundation; either version 2 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# Please read the COPYING file.
|
||||||
|
# Timu EREN <selamtux@gmail.com>
|
||||||
|
|
||||||
|
from pisi.actionsapi import autotools
|
||||||
|
from pisi.actionsapi import get
|
||||||
|
from pisi.actionsapi import pisitools
|
||||||
|
from pisi.actionsapi import shelltools
|
||||||
|
|
||||||
|
WorkDir = "pccts"
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
shelltools.export("COPT", get.CFLAGS())
|
||||||
|
|
||||||
|
def build():
|
||||||
|
# autotools.make("COPT=%s" % (get.CFLAGS()))
|
||||||
|
autotools.make()
|
||||||
|
|
||||||
|
def install():
|
||||||
|
#autotools.install("")
|
||||||
|
|
||||||
|
pisitools.dobin("bin/antlr")
|
||||||
|
pisitools.dobin("bin/dlg")
|
||||||
|
pisitools.dobin("bin/genmk")
|
||||||
|
pisitools.dobin("bin/sor")
|
||||||
|
|
||||||
|
pisitools.insinto("/usr/include/pccts","h/*.h")
|
||||||
|
pisitools.insinto("/usr/include/pccts","h/*.c")
|
||||||
|
pisitools.insinto("/usr/include/pccts","h/*.cpp")
|
||||||
|
|
||||||
|
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.h")
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.c")
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.cpp")
|
||||||
|
|
||||||
|
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.h")
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.c")
|
||||||
|
pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.cpp")
|
||||||
|
|
||||||
|
pisitools.dodoc("CHANGES*", "KNOWN_PROBLEMS*", "README", "RIGHTS", "history.txt", "history.ps")
|
||||||
|
pisitools.dodoc("sorcerer/README", "sorcerer/UPDATES")
|
||||||
|
|
||||||
|
pisitools.doman("dlg/dlg.1", "antlr/antlr.1")
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
--- pccts-1.33.33/support/genmk/genmk.c Fri Aug 3 17:12:51 2001
|
||||||
|
+++ pccts-1.33.33/support/genmk/genmk-gentoo.c Fri Aug 3 17:12:14 2001
|
||||||
|
@@ -7,6 +7,11 @@
|
||||||
|
* U of MN
|
||||||
|
*/
|
||||||
|
|
||||||
|
+/* modified 20010803 by Peter Kadau
|
||||||
|
+ * for better fhs-compliance
|
||||||
|
+ * i.e. from "none" to "hmmm soso" ;-)
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "pcctscfg.h" /* be sensitive to what ANTLR/DLG call the files */
|
||||||
|
@@ -65,7 +70,7 @@
|
||||||
|
static int nondef_comp = 0; /* 1=compiler is non default */
|
||||||
|
static char *compilerCCC="CC";
|
||||||
|
static char *compilerCC="cc";
|
||||||
|
-static char *pccts_path="/usr/local/pccts";
|
||||||
|
+static char *pccts_path="/usr/include/pccts";
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
void help(void);
|
||||||
|
@@ -356,7 +361,7 @@
|
||||||
|
{ "-cfiles",1,pCFiles, "Additional files in C or C++ to compile"},
|
||||||
|
{ "-sor",0,pSor, "Start of sorcerer group"},
|
||||||
|
{ "-pccts_path",1,ppccts_path,
|
||||||
|
- "Path for $PCCTS directory (default is /usr/local/pccts)"},
|
||||||
|
+ "Path for $PCCTS directory (default is /usr/include/pccts)"},
|
||||||
|
{ "-compiler",1,pCompiler,
|
||||||
|
"Default compiler (default is CC/cc)"},
|
||||||
|
{ "*", 0,pFile, "" }, /* anything else is a file */
|
||||||
|
@@ -495,13 +500,13 @@
|
||||||
|
else printf("SCAN = %s%s\n", DIR(), dlg_class);
|
||||||
|
|
||||||
|
printf("PCCTS = %s\n",pccts_path);
|
||||||
|
- printf("ANTLR_H = $(PCCTS)%sh\n", DirectorySymbol);
|
||||||
|
+ printf("ANTLR_H = $(PCCTS)\n");
|
||||||
|
if (num_sors>0) {
|
||||||
|
- printf("SOR_H = $(PCCTS)%ssorcerer%sh\n", DirectorySymbol, DirectorySymbol);
|
||||||
|
+ printf("SOR_H = $(PCCTS)%ssorcerer\n", DirectorySymbol);
|
||||||
|
printf("SOR_LIB = $(PCCTS)%ssorcerer%slib\n",
|
||||||
|
DirectorySymbol, DirectorySymbol);
|
||||||
|
}
|
||||||
|
- printf("BIN = $(PCCTS)%sbin\n", DirectorySymbol);
|
||||||
|
+ printf("BIN = %susr%sbin\n", DirectorySymbol, DirectorySymbol);
|
||||||
|
printf("ANTLR = $(BIN)%santlr\n", DirectorySymbol);
|
||||||
|
printf("DLG = $(BIN)%sdlg\n", DirectorySymbol);
|
||||||
|
if (num_sors>0) printf("SOR = $(BIN)%ssor\n", DirectorySymbol);
|
||||||
|
--- pccts-1.33.33/sorcerer/lib/sorlist.c 1999-06-30 03:15:56.000000000 +0200
|
||||||
|
+++ pccts-1.33.33/sorcerer/lib/sorlist.c.new 2003-05-23 11:11:09.000000000 +0200
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
+#include "pcctscfg.h"
|
||||||
|
|
||||||
|
#ifdef PCCTS_USE_STDARG
|
||||||
|
#include <stdarg.h>
|
||||||
|
--- pccts-1.33.33/sorcerer/lib/sintstack.c 1999-06-30 15:08:06.000000000 +0200
|
||||||
|
+++ pccts-1.33.33/sorcerer/lib/sintstack.c.new 2003-05-23 12:54:26.000000000 +0200
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
+#include "pcctscfg.h"
|
||||||
|
|
||||||
|
#ifdef PCCTS_USE_STDARG
|
||||||
|
#include <stdarg.h>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<!DOCTYPE PISI SYSTEM "http://www.uludag.org.tr/projeler/pisi/pisi-spec.dtd">
|
||||||
|
<PISI>
|
||||||
|
<Source>
|
||||||
|
<Name>pccts</Name>
|
||||||
|
<Homepage>http://www.polhode.com</Homepage>
|
||||||
|
<Packager>
|
||||||
|
<Name>Timu EREN</Name>
|
||||||
|
<Email>selamtux@gmail.com</Email>
|
||||||
|
</Packager>
|
||||||
|
<License>BSD</License>
|
||||||
|
<IsA>category</IsA>
|
||||||
|
<PartOf>component</PartOf>
|
||||||
|
<Summary xml:lang="en">Purdue Compiler Construction Tool Set is an embedded C/C++ parser generator</Summary>
|
||||||
|
<Description xml:lang="en">Purdue Compiler Construction Tool Set is an embedded C/C++ parser generator</Description>
|
||||||
|
<Archive type="zip" sha1sum="5b3417efd5f537434b568114bcda853b4975d851">http://www.polhode.com/pccts133mr33.zip</Archive>
|
||||||
|
<Patches>
|
||||||
|
<Patch level="1">pccts-1.33.33-gentoo.diff</Patch>
|
||||||
|
</Patches>
|
||||||
|
<BuildDependencies>
|
||||||
|
<Dependency>unzip</Dependency>
|
||||||
|
<Dependency>patch</Dependency>
|
||||||
|
</BuildDependencies>
|
||||||
|
<History>
|
||||||
|
<Update>
|
||||||
|
<Date>2005-09-16</Date>
|
||||||
|
<Version>1.33.33</Version>
|
||||||
|
<Release>1</Release>
|
||||||
|
</Update>
|
||||||
|
</History>
|
||||||
|
</Source>
|
||||||
|
<Package>
|
||||||
|
<Name>pccts</Name>
|
||||||
|
<Files>
|
||||||
|
<Path fileType="header">/usr/include</Path>
|
||||||
|
<Path fileType="doc">/usr/share/doc</Path>
|
||||||
|
<Path fileType="executable">/usr/bin</Path>
|
||||||
|
<Path fileType="man">/usr/share/man</Path>
|
||||||
|
</Files>
|
||||||
|
</Package>
|
||||||
|
</PISI>
|
||||||
Reference in New Issue
Block a user