[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
The proposal to merge lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module has been updated. Status: Approved => Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Validation queue job 1039576-2013-01-08T05-24-49.124Z is finished. The final status was: All tests succeeded! -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Validation queue starting for merge proposal. Log at: http://zorbatest.lambda.nu:8080/remotequeue/1039576-2013-01-08T05-24-49.124Z/log.html -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
The proposal to merge lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
- Added documentation changes to include entry@type attribute. -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
The proposal to merge lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module has been updated. Status: Approved => Needs review For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions. -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
The proposal to merge lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module has been updated. Commit Message changed to: - Added ability to create directories in archives - Added testcases For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
The proposal to merge lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Review: Needs Fixing The following tests started to fail on my Linux machine. Any clue why? 3613 - zorba_archive_module/entries_03.xq (Failed) 3618 - zorba_archive_module/dir_04.xq (Failed) 3619 - zorba_archive_module/dir_02.xq (Failed) 3625 - zorba_archive_module/update_02.xq (Failed) 3629 - zorba_archive_module/entries_02.xq (Failed) 3633 - zorba_archive_module/dir_01.xq (Failed) 3635 - zorba_archive_module/entries_01.xq (Failed) 3636 - zorba_archive_module/dir_03.xq (Failed) 3638 - zorba_archive_module/options_02.xq (Failed) -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module
Luis Rodriguez Gonzalez has proposed merging lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module. Requested reviews: Matthias Brantner (matthias-brantner) Related bugs: Bug #1039576 in Zorba: "archive module doesnt create directory entries" https://bugs.launchpad.net/zorba/+bug/1039576 For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 - Added ability to create directories in archives - Added testcases -- https://code.launchpad.net/~zorba-coders/zorba/1039576/+merge/123170 Your team Zorba Coders is subscribed to branch lp:zorba/archive-module. === modified file 'src/archive.xsd' --- src/archive.xsd 2012-08-01 20:47:46 + +++ src/archive.xsd 2012-09-06 20:59:23 + @@ -53,6 +53,13 @@ + + + + + + + @@ -88,6 +95,7 @@ + === modified file 'src/archive_module.xq.src/archive_module.cpp' --- src/archive_module.xq.src/archive_module.cpp 2012-08-03 04:53:47 + +++ src/archive_module.xq.src/archive_module.cpp 2012-09-06 20:59:23 + @@ -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()) +{ +