diff -Nru zorba-archive-module-2.7.0/debian/bzr-builder.manifest zorba-archive-module-2.8.0/debian/bzr-builder.manifest --- zorba-archive-module-2.7.0/debian/bzr-builder.manifest 2012-10-22 17:58:14.000000000 +0000 +++ zorba-archive-module-2.8.0/debian/bzr-builder.manifest 2013-01-16 21:38:55.000000000 +0000 @@ -1,3 +1,3 @@ # bzr-builder format 0.3 deb-version {debupstream}-1 -lp:zorba/archive-module revid:chillery+buildbot@lambda.nu-20120928171544-g1nlns0779tg3e3r -nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba-archive-module_debian_rules/debian debian revid:juan457@gmail.com-20121012222916-jf49ho9fnti47mxw +lp:zorba/archive-module revid:kuraru@gmail.com-20130116190117-bal1x00b741qh4hc +nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba-archive-module_debian_rules/debian debian revid:juan457@gmail.com-20130116181440-3e9lvyabkqbwv861 diff -Nru zorba-archive-module-2.7.0/debian/changelog zorba-archive-module-2.8.0/debian/changelog --- zorba-archive-module-2.7.0/debian/changelog 2012-10-22 17:58:14.000000000 +0000 +++ zorba-archive-module-2.8.0/debian/changelog 2013-01-16 21:38:55.000000000 +0000 @@ -1,12 +1,12 @@ -zorba-archive-module (2.7.0-1~oneiric1) oneiric; urgency=low +zorba-archive-module (2.8.0-1~oneiric1) oneiric; urgency=low * Auto build. - -- Juan Zacarias Mon, 22 Oct 2012 17:58:14 +0000 + -- Juan Zacarias Wed, 16 Jan 2013 21:38:55 +0000 -zorba-archive-module (2.7.0) unstable; urgency=low +zorba-archive-module (2.8.0) unstable; urgency=low *Updated to current Version - -- Juan Zacarias Fri, 12 Oct 2012 17:28:51 -0500 + -- Juan Zacarias Wed, 16 Jan 2013 12:13:22 -0600 diff -Nru zorba-archive-module-2.7.0/debian/copyright zorba-archive-module-2.8.0/debian/copyright --- zorba-archive-module-2.7.0/debian/copyright 2012-10-22 17:58:13.000000000 +0000 +++ zorba-archive-module-2.8.0/debian/copyright 2013-01-16 21:38:55.000000000 +0000 @@ -1,5 +1,5 @@ This package was debianized by Juan Zacarias on -Fri, 12 Oct 2012 17:28:51 -0500 +Wed, 16 Jan 2013 12:13:22 -0600 It was downloaded from http://www.zorba-xquery.com diff -Nru zorba-archive-module-2.7.0/src/archive.xsd zorba-archive-module-2.8.0/src/archive.xsd --- zorba-archive-module-2.7.0/src/archive.xsd 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/src/archive.xsd 2013-01-16 21:38:53.000000000 +0000 @@ -53,6 +53,13 @@ + + + + + + + @@ -88,6 +95,7 @@ + diff -Nru zorba-archive-module-2.7.0/src/archive_module.xq zorba-archive-module-2.8.0/src/archive_module.xq --- zorba-archive-module-2.7.0/src/archive_module.xq 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/src/archive_module.xq 2013-01-16 21:38:53.000000000 +0000 @@ -49,6 +49,19 @@ :

The parameters $entries and $contents have the same meaning as for : the function a:create with three arguments.

: + :

Entry entries can include a type attribute, this attribute can have one + : of two possible values: "regular" or "directory". If "regular" is + : specified then the entry will be created as a regular file; if "directory" + : is specified then the entry will be created as a directory, no contents + : will be read from $contents in this case. If no value is specified for type + : then it will be set to "regular". Example: + :

+ : $zip-file := a:create(
+ :    (<a:entry encoding="ISO-8859-1" type="directory">dir1</a:entry>, "dir1/file1"),
+ :    ("file contents"))
+ : 
+ :

+ : : @param $entries the meta data for the entries in the archive. Each entry : can be of type xs:string or an element with name a:entry. : @param $contents the content for the archive. Each item in the sequence @@ -90,18 +103,20 @@ : :

For example, the following sequence may be used to describe an archive : containing three elements: - :

myfile.txt
- : dir/myfile.xml]]>
+ :
myfile.txt</a:entry>
+ : <a:entry encoding="ISO-8859-1" compression="store">dir/myfile.xml</a:entry>]]>
+ : 
:

: :

The $options argument may be used to describe general options for the : archive. For example, the following option element can be used to create a ZIP : archive in which all entries are compressed with the DEFLATE compression : algorithm: - :


- :   ZIP
- :   DEFLATE
- : ]]>
+ :

+ :   <archive:format>ZIP</archive:format>
+ :   <archive:compression>DEFLATE</archive:compression>
+ : </archive:options>]]>
+ : 
:

: :

The result of the function is the generated archive as a item of type @@ -271,10 +286,11 @@ : Returns the algorithm and format options of the given archive. : For example, for a ZIP archive, the following options element : would be returned: - :


- :   ZIP</archive:format>
- :   
- : ]]>
+ :

+ :   <archive:format>ZIP</archive:format>
+ :   <archive:compressionDEFLATE</archive:compression>
+ : </archive:options>]]>
+ : 
: : @param $archive the archive as xs:base64Binary : diff -Nru zorba-archive-module-2.7.0/src/archive_module.xq.src/archive_module.cpp zorba-archive-module-2.8.0/src/archive_module.xq.src/archive_module.cpp --- zorba-archive-module-2.7.0/src/archive_module.xq.src/archive_module.cpp 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/src/archive_module.xq.src/archive_module.cpp 2013-01-16 21:38:53.000000000 +0000 @@ -119,6 +119,8 @@ gmtime_r(&aTime, &gmtm); #endif + // create a datetime item without timezone because + // this is what the entry tells us (at least for zip) Item lModifiedItem = getItemFactory()->createDateTime( static_cast(gmtm.tm_year + 1900), static_cast(gmtm.tm_mon + 1), @@ -167,7 +169,8 @@ ******************/ ArchiveFunction::ArchiveEntry::ArchiveEntry() - : theEncoding("UTF-8") + : theEncoding("UTF-8"), + theEntryType(regular) { // use current time as a default for each entry #if defined (WIN32) @@ -187,7 +190,7 @@ if (archive_entry_size_is_set(aEntry)) { - //add a size variable + theSize = (int)archive_entry_size(aEntry); } if (archive_entry_mtime_is_set(aEntry)) @@ -195,12 +198,19 @@ theLastModified = archive_entry_mtime(aEntry); } //check if it is encoded + + switch(archive_entry_filetype(aEntry)) + { + case AE_IFDIR: theEntryType = directory; break; + default: theEntryType = regular; break; + } } void ArchiveFunction::ArchiveEntry::setValues(zorba::Item& aEntry) { theEntryPath = aEntry.getStringValue(); + if (aEntry.isNode()) { Item lAttr; @@ -212,7 +222,15 @@ Item lAttrName; lAttr.getNodeName(lAttrName); - if (lAttrName.getLocalName() == "last-modified") + if(lAttrName.getLocalName() == "type") + { + String filetype = lAttr.getStringValue(); + if(filetype == "directory") + { + theEntryType = directory; + } + } + else if (lAttrName.getLocalName() == "last-modified") { ArchiveModule::parseDateTimeItem(lAttr, theLastModified); } @@ -548,12 +566,15 @@ for (size_t i = 0; i < aEntries.size(); ++i) { - if (!aFiles->next(lFile)) + if(aEntries[i].getEntryType() == ArchiveEntry::regular) { - std::ostringstream lMsg; - lMsg << "number of entries (" << aEntries.size() - << ") doesn't match number of content arguments (" << i << ")"; - throwError("ARCH0001", lMsg.str().c_str()); + if (!aFiles->next(lFile)) + { + std::ostringstream lMsg; + lMsg << "number of entries (" << aEntries.size() + << ") doesn't match number of content arguments (" << i << ")"; + throwError("ARCH0001", lMsg.str().c_str()); + } } const ArchiveEntry& lEntry = aEntries[i]; @@ -578,14 +599,19 @@ std::istream* lStream; bool lDeleteStream; uint64_t lFileSize; - - lDeleteStream = getStream( - aEntry, aFile, lStream, lFileSize); archive_entry_set_pathname(theEntry, aEntry.getEntryPath().c_str()); archive_entry_set_mtime(theEntry, aEntry.getLastModified(), 0); // TODO: modified to allow the creation of empty directories - archive_entry_set_filetype(theEntry, AE_IFREG); + if(aEntry.getEntryType() == ArchiveEntry::regular){ + archive_entry_set_filetype(theEntry, AE_IFREG); + lDeleteStream = getStream( + aEntry, aFile, lStream, lFileSize); + } else { + archive_entry_set_filetype(theEntry, AE_IFDIR); + lDeleteStream = false; + lFileSize = 0; + } // TODO: specifies the permits of a file archive_entry_set_perm(theEntry, 0644); archive_entry_set_size(theEntry, lFileSize); @@ -632,11 +658,14 @@ archive_write_header(theArchive, theEntry); - char lBuf[ZORBA_ARCHIVE_MAX_READ_BUF]; - while (lStream->good()) + if(aEntry.getEntryType() == ArchiveEntry::regular) { - lStream->read(lBuf, ZORBA_ARCHIVE_MAX_READ_BUF); - archive_write_data(theArchive, lBuf, lStream->gcount()); + char lBuf[ZORBA_ARCHIVE_MAX_READ_BUF]; + while (lStream->good()) + { + lStream->read(lBuf, ZORBA_ARCHIVE_MAX_READ_BUF); + archive_write_data(theArchive, lBuf, lStream->gcount()); + } } archive_entry_clear(theEntry); @@ -890,9 +919,7 @@ base64::attach(*theData.theStream); } - lErr = archive_read_open( - theArchive, &theData, 0, ArchiveItemSequence::readStream, 0); - + lErr = archive_read_open(theArchive, &theData, NULL, ArchiveItemSequence::readStream, NULL); ArchiveFunction::checkForError(lErr, 0, theArchive); } else @@ -1021,6 +1048,7 @@ theLastModifiedName = theFactory->createQName("", "last-modified"); theUncompressedSizeName = theFactory->createQName("", "size"); + theEntryType = theFactory->createQName("", "type"); } bool @@ -1071,6 +1099,26 @@ aRes, theLastModifiedName, lType, lModifiedItem); } + Item lEntryType; + if(archive_entry_filetype(lEntry) == AE_IFDIR) + { + // this entry is a directory + lEntryType = theFactory->createString("directory"); + } + else if(archive_entry_filetype(lEntry) == AE_IFREG) + { + lEntryType = theFactory->createString("regular"); + } + else + { + // error! type not supported! + // for the time being don't do anything + } + + lType = theUntypedQName; + theFactory->createAttributeNode( + aRes, theEntryType, lType, lEntryType); + // skip to the next entry and raise an error if that fails lErr = archive_read_data_skip(theArchive); ArchiveFunction::checkForError(lErr, 0, theArchive); @@ -1183,26 +1231,6 @@ if (!lEntry) return false; - /*while (true) - { - int lErr = archive_read_next_header(theArchive, &lEntry); - - if (lErr == ARCHIVE_EOF) return false; - - if (lErr != ARCHIVE_OK) - { - ArchiveFunction::checkForError(lErr, 0, theArchive); - } - - if (theReturnAll) break; - - String lName = archive_entry_pathname(lEntry); - if (theEntryNames.find(lName) != theEntryNames.end()) - { - break; - } - }*/ - String lResult; // reserve some space if we know the decompressed size @@ -1294,26 +1322,6 @@ if (!lEntry) return false; - /*while (true) - { - int lErr = archive_read_next_header(theArchive, &lEntry); - - if (lErr == ARCHIVE_EOF) return false; - - if (lErr != ARCHIVE_OK) - { - ArchiveFunction::checkForError(lErr, 0, theArchive); - } - - if (theReturnAll) break; - - String lName = archive_entry_pathname(lEntry); - if (theEntryNames.find(lName) != theEntryNames.end()) - { - break; - } - }*/ - std::vector lResult; // reserve some space if we know the decompressed size @@ -1429,31 +1437,33 @@ //form an ArchiveEntry with the entry theEntry.setValues(lEntry); - - //read entry content - std::vector lResult; - if (archive_entry_size_is_set(lEntry)) - { - long long lSize = archive_entry_size(lEntry); - lResult.reserve(lSize); - } + if(archive_entry_filetype(lEntry) == AE_IFREG){ + //read entry content + std::vector lResult; - std::vector lBuf; - lBuf.resize(ZORBA_ARCHIVE_MAX_READ_BUF); + if (archive_entry_size_is_set(lEntry)) + { + long long lSize = archive_entry_size(lEntry); + lResult.reserve(lSize); + } - //read entry into string - while (true) - { - int s = archive_read_data( - theArchive, &lBuf[0], ZORBA_ARCHIVE_MAX_READ_BUF); + std::vector lBuf; + lBuf.resize(ZORBA_ARCHIVE_MAX_READ_BUF); + + //read entry into string + while (true) + { + int s = archive_read_data( + theArchive, &lBuf[0], ZORBA_ARCHIVE_MAX_READ_BUF); - if (s == 0) break; + if (s == 0) break; - lResult.insert(lResult.end(), lBuf.begin(), lBuf.begin() + s); - } + lResult.insert(lResult.end(), lBuf.begin(), lBuf.begin() + s); + } - aRes = theFactory->createBase64Binary(&lResult[0], lResult.size()); + aRes = theFactory->createBase64Binary(&lResult[0], lResult.size()); + } return true; } @@ -1608,31 +1618,36 @@ //form an ArchiveEntry with the entry theEntry.setValues(lEntry); + + if(archive_entry_filetype(lEntry) == AE_IFREG){ - //read entry content - std::vector lResult; + //read entry content + std::vector lResult; - if (archive_entry_size_is_set(lEntry)) - { - long long lSize = archive_entry_size(lEntry); - lResult.reserve(lSize); - } + if (archive_entry_size_is_set(lEntry)) + { + long long lSize = archive_entry_size(lEntry); + lResult.reserve(lSize); + } - std::vector lBuf; - lBuf.resize(ZORBA_ARCHIVE_MAX_READ_BUF); + std::vector lBuf; + lBuf.resize(ZORBA_ARCHIVE_MAX_READ_BUF); - //read entry into string - while (true) - { - int s = archive_read_data( - theArchive, &lBuf[0], ZORBA_ARCHIVE_MAX_READ_BUF); + //read entry into string + while (true) + { + int s = archive_read_data( + theArchive, &lBuf[0], ZORBA_ARCHIVE_MAX_READ_BUF); - if (s == 0) break; + if (s == 0) break; - lResult.insert(lResult.end(), lBuf.begin(), lBuf.begin() + s); - } + lResult.insert(lResult.end(), lBuf.begin(), lBuf.begin() + s); + } - aRes = theFactory->createBase64Binary(&lResult[0], lResult.size()); + aRes = theFactory->createBase64Binary(&lResult[0], lResult.size()); + } + // else? if the entry represents a directory what are we + // going to return?? return true; } diff -Nru zorba-archive-module-2.7.0/src/archive_module.xq.src/archive_module.h zorba-archive-module-2.8.0/src/archive_module.xq.src/archive_module.h --- zorba-archive-module-2.7.0/src/archive_module.xq.src/archive_module.h 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/src/archive_module.xq.src/archive_module.h 2013-01-16 21:38:53.000000000 +0000 @@ -150,6 +150,14 @@ #endif readStream(struct archive *a, void *client_data, const void **buff); + // needed for the "non-linear" zip format +#ifdef WIN32 + static __int64 seekStream(struct archive *a, void *data, __int64 request, int whence); +#else + static off_t seekStream(struct archive *a, void *data, off_t request, int whence); +#endif + + }; @@ -196,12 +204,16 @@ class ArchiveEntry { + public: + enum ArchiveEntryType { regular = 0, directory }; + protected: String theEntryPath; String theEncoding; int theSize; time_t theLastModified; String theCompression; + ArchiveEntryType theEntryType; bool theSkipExtras; public: @@ -217,6 +229,8 @@ const String& getCompression() const { return theCompression; } + const ArchiveEntryType& getEntryType() const { return theEntryType; } + void setValues(zorba::Item& aEntry); void setValues(struct archive_entry* aEntry); @@ -362,6 +376,7 @@ zorba::Item theEntryName; zorba::Item theUncompressedSizeName; zorba::Item theLastModifiedName; + zorba::Item theEntryType; public: EntriesIterator(zorba::Item& aArchive); diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/dir_01.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/dir_01.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/dir_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/dir_01.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +foo.xml, bar.xml, dir1/, \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/dir_02.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/dir_02.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/dir_02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/dir_02.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +foo.xml, bar.xml, \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/dir_03.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/dir_03.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/dir_03.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/dir_03.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +true \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/dir_04.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/dir_04.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/dir_04.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/dir_04.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +foo.xml, bar.xml, dir1/, newdir/, \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/entries_01.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/entries_01.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/entries_01.xml.res 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/entries_01.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -1,2 +1,2 @@ -dir1/dir1/file1dir1/file2dir2/file1 \ No newline at end of file +dir1/dir1/file1dir1/file2dir2/file1 \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/entries_02.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/entries_02.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/entries_02.xml.res 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/entries_02.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -1,2 +1,2 @@ -dir1/dir1/file1dir1/file2dir2/file1 \ No newline at end of file +dir1/dir1/file1dir1/file2dir2/file1 \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/entries_03.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/entries_03.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/entries_03.xml.res 2012-10-22 17:58:12.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/entries_03.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -1 +1 @@ -dir1/dir1/file1dir1/file2dir2/file1 +dir1/dir1/file1dir1/file2dir2/file1 diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/options_02.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/options_02.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/options_02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/options_02.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +TARBZIP2 \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/update_02.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/update_02.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/update_02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/update_02.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,2 @@ + +3 <foo2/> \ No newline at end of file diff -Nru zorba-archive-module-2.7.0/test/ExpQueryResults/update_03.xml.res zorba-archive-module-2.8.0/test/ExpQueryResults/update_03.xml.res --- zorba-archive-module-2.7.0/test/ExpQueryResults/update_03.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/ExpQueryResults/update_03.xml.res 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +:10,21: user-defined error [http://www.zorba-xquery.com/modules/archive#ARCH0001]: number of entries (2) doesn't match number of content arguments (1); raised at D:\zorba\code\zorba_modules\archive-module\src\archive_module.xq.src\archive_module.cpp:686 diff -Nru zorba-archive-module-2.7.0/test/Queries/dir_01.xq zorba-archive-module-2.8.0/test/Queries/dir_01.xq --- zorba-archive-module-2.7.0/test/Queries/dir_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/dir_01.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; + +let $foo-content := "" +let $bar-content := "" +let $archive := a:create( + ("foo.xml", "bar.xml", dir1), + ($foo-content, $bar-content) +) +return + for $e in a:entries($archive) return concat($e/text(), ",") diff -Nru zorba-archive-module-2.7.0/test/Queries/dir_02.xq zorba-archive-module-2.8.0/test/Queries/dir_02.xq --- zorba-archive-module-2.7.0/test/Queries/dir_02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/dir_02.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,11 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; + +let $foo-content := "" +let $bar-content := "" +let $archive := a:create( + ("foo.xml", "bar.xml", dir1), + ($foo-content, $bar-content) +) +let $archive2 := a:delete($archive, "dir1/") +return + for $e in a:entries($archive2) return concat($e/text(), ",") diff -Nru zorba-archive-module-2.7.0/test/Queries/dir_03.xq zorba-archive-module-2.8.0/test/Queries/dir_03.xq --- zorba-archive-module-2.7.0/test/Queries/dir_03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/dir_03.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,13 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; + +let $foo-content := "" +let $bar-content := "" +let $archive := a:create( + ("foo.xml", "bar.xml", dir1), + ($foo-content, $bar-content) +) +let $archive2 := a:delete($archive, "nonexistent.xml") +let $entries := a:entries($archive) +let $entries2 := a:entries($archive2) +return $entries=$entries2 + diff -Nru zorba-archive-module-2.7.0/test/Queries/dir_04.xq zorba-archive-module-2.8.0/test/Queries/dir_04.xq --- zorba-archive-module-2.7.0/test/Queries/dir_04.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/dir_04.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,13 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; + +let $foo-content := "" +let $bar-content := "" +let $archive := a:create( + ("foo.xml", "bar.xml", dir1), + ($foo-content, $bar-content) +) +let $archive2 := a:update($archive, newdir, ()) +let $entries := a:entries($archive) +let $entries2 := a:entries($archive2) +return for $e in $entries2 return concat($e/text(), ",") + diff -Nru zorba-archive-module-2.7.0/test/Queries/entries_03.spec zorba-archive-module-2.8.0/test/Queries/entries_03.spec --- zorba-archive-module-2.7.0/test/Queries/entries_03.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/entries_03.spec 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/archive:ARCH9999 diff -Nru zorba-archive-module-2.7.0/test/Queries/options_02.spec zorba-archive-module-2.8.0/test/Queries/options_02.spec --- zorba-archive-module-2.7.0/test/Queries/options_02.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/options_02.spec 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/archive:ARCH9999 diff -Nru zorba-archive-module-2.7.0/test/Queries/options_02.xq zorba-archive-module-2.8.0/test/Queries/options_02.xq --- zorba-archive-module-2.7.0/test/Queries/options_02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/options_02.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,5 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; +import module namespace f = "http://expath.org/ns/file"; + +let $tar-bz2 := f:read-binary(fn:resolve-uri("simple.tar.bz2")) +return a:options($tar-bz2) diff -Nru zorba-archive-module-2.7.0/test/Queries/options_03.spec zorba-archive-module-2.8.0/test/Queries/options_03.spec --- zorba-archive-module-2.7.0/test/Queries/options_03.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/options_03.spec 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/archive:ARCH9999 diff -Nru zorba-archive-module-2.7.0/test/Queries/options_03.xq zorba-archive-module-2.8.0/test/Queries/options_03.xq --- zorba-archive-module-2.7.0/test/Queries/options_03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/options_03.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,5 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; + +let $fake_archive := xs:base64Binary("5Pb8") +return + a:options($fake_archive) diff -Nru zorba-archive-module-2.7.0/test/Queries/update_02.xq zorba-archive-module-2.8.0/test/Queries/update_02.xq --- zorba-archive-module-2.7.0/test/Queries/update_02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/update_02.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; +import module namespace b = "http://www.zorba-xquery.com/modules/converters/base64"; + +let $foo-content := "" +let $bar-content := xs:base64Binary("YWJj") +let $archive := a:create( + ("foo.xml", "bar.txt"), + ($foo-content, $bar-content) +) +let $new-archive := a:update($archive, "foo2.xml", "") +return (count(a:entries($new-archive)), a:extract-text($new-archive, "foo2.xml")) + diff -Nru zorba-archive-module-2.7.0/test/Queries/update_03.spec zorba-archive-module-2.8.0/test/Queries/update_03.spec --- zorba-archive-module-2.7.0/test/Queries/update_03.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/update_03.spec 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/archive:ARCH0001 diff -Nru zorba-archive-module-2.7.0/test/Queries/update_03.xq zorba-archive-module-2.8.0/test/Queries/update_03.xq --- zorba-archive-module-2.7.0/test/Queries/update_03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/update_03.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; +import module namespace b = "http://www.zorba-xquery.com/modules/converters/base64"; + +let $foo-content := "" +let $bar-content := xs:base64Binary("YWJj") +let $archive := a:create( + ("foo.xml", "bar.txt"), + ($foo-content, $bar-content) +) +let $new-archive := a:update($archive, ("foo2.xml", "bar2.xml"), ("")) +return (count(a:entries($new-archive)), a:extract-text($new-archive, "foo2.xml")) + diff -Nru zorba-archive-module-2.7.0/test/Queries/update_04.spec zorba-archive-module-2.8.0/test/Queries/update_04.spec --- zorba-archive-module-2.7.0/test/Queries/update_04.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/update_04.spec 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/archive:ARCH9999 diff -Nru zorba-archive-module-2.7.0/test/Queries/update_04.xq zorba-archive-module-2.8.0/test/Queries/update_04.xq --- zorba-archive-module-2.7.0/test/Queries/update_04.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-archive-module-2.8.0/test/Queries/update_04.xq 2013-01-16 21:38:53.000000000 +0000 @@ -0,0 +1,7 @@ +import module namespace a = "http://www.zorba-xquery.com/modules/archive"; +import module namespace b = "http://www.zorba-xquery.com/modules/converters/base64"; + +let $fake_archive := xs:base64Binary("YWJj") +let $new-archive := a:update($fake_archive, "foo2.xml", "") +return (count(a:entries($new-archive)), a:extract-text($new-archive, "foo2.xml")) +