Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2013-01-07 Thread Matthias Brantner
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

2013-01-07 Thread Matthias Brantner
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


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2013-01-07 Thread Zorba Build Bot
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

2013-01-07 Thread Zorba Build Bot
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

2013-01-07 Thread noreply
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


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2012-12-21 Thread Luis Rodriguez Gonzalez
- 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

2012-09-26 Thread Matthias Brantner
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


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2012-09-26 Thread Zorba Build Bot
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

2012-09-26 Thread Zorba Build Bot
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

2012-09-10 Thread Matthias Brantner
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


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2012-09-10 Thread Matthias Brantner
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


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2012-09-06 Thread Luis Rodriguez Gonzalez
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 @@
 xs:restriction base=xs:string/
   /xs:simpleType
   
+  xs:simpleType name=entry-type
+xs:restriction base=xs:string
+  xs:enumeration value=regular/
+  xs:enumeration value=directory/
+/xs:restriction
+  /xs:simpleType
+  
   !-- elements --
   xs:element name=archive-option-element
 abstract=true type=xs:string/
@@ -88,6 +95,7 @@
  
   !-- entry attributes --
   xs:attributeGroup name=entry-attributes
+xs:attribute name=type type=entry-type/
 xs:attribute name=size type=entry-size-type/
 xs:attribute name=last-modified type=entry-datetime-type/
 xs:attribute name=encoding type=entry-encoding-type/

=== 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_castshort(gmtm.tm_year + 1900),
 static_castshort(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);
   

Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/1039576 into lp:zorba/archive-module

2012-09-06 Thread Juan Zacarias
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