Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Change the ZIP file generator so that it sets the execute bit approprately. Ticket [baf9b6b11e08c1d]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
b57bc473b0cf7632bf02aaa8d79a4ef6 |
| User & Date: | drh 2011-02-27 23:31:27.376 |
Context
|
2011-02-28
| ||
| 14:18 | All of the execute permission bit handling appears to be working now, though beta testing would be good. Ticket [baf9b6b11e08c1]. check-in: 3ad119b703 user: drh tags: trunk | |
|
2011-02-27
| ||
| 23:31 | Change the ZIP file generator so that it sets the execute bit approprately. Ticket [baf9b6b11e08c1d]. check-in: b57bc473b0 user: drh tags: trunk | |
| 21:45 | Fix the "revert" command so that it restores the correct execute permission to the file. Ticket [baf9b6b11e08c1] check-in: 3c39caac39 user: drh tags: trunk | |
Changes
Changes to src/zip.c.
| ︙ | ︙ | |||
102 103 104 105 106 107 108 |
for(j=0; j<nDir; j++){
if( strcmp(zName, azDir[j])==0 ) break;
}
if( j>=nDir ){
nDir++;
azDir = fossil_realloc(azDir, sizeof(azDir[0])*nDir);
azDir[j] = mprintf("%s", zName);
| | | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
for(j=0; j<nDir; j++){
if( strcmp(zName, azDir[j])==0 ) break;
}
if( j>=nDir ){
nDir++;
azDir = fossil_realloc(azDir, sizeof(azDir[0])*nDir);
azDir[j] = mprintf("%s", zName);
zip_add_file(zName, 0, 0);
}
zName[i+1] = c;
}
}
}
/*
** Append a single file to a growing ZIP archive.
**
** pFile is the file to be appended. zName is the name
** that the file should be saved as.
*/
void zip_add_file(const char *zName, const Blob *pFile, int isExe){
z_stream stream;
int nameLen;
int toOut = 0;
int iStart;
int iCRC = 0;
int nByte = 0;
int nByteCompr = 0;
|
| ︙ | ︙ | |||
137 138 139 140 141 142 143 |
char zOutBuf[100000];
/* Fill in as much of the header as we know.
*/
nBlob = pFile ? blob_size(pFile) : 0;
if( nBlob>0 ){
iMethod = 8;
| | | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
char zOutBuf[100000];
/* Fill in as much of the header as we know.
*/
nBlob = pFile ? blob_size(pFile) : 0;
if( nBlob>0 ){
iMethod = 8;
iMode = isExe ? 0100755 : 0100644;
}else{
iMethod = 0;
iMode = 040755;
}
nameLen = strlen(zName);
memset(zHdr, 0, sizeof(zHdr));
put32(&zHdr[0], 0x04034b50);
|
| ︙ | ︙ | |||
285 286 287 288 289 290 291 |
if( g.argc<3 ){
usage("ARCHIVE FILE....");
}
zip_open();
for(i=3; i<g.argc; i++){
blob_zero(&file);
blob_read_from_file(&file, g.argv[i]);
| | | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
if( g.argc<3 ){
usage("ARCHIVE FILE....");
}
zip_open();
for(i=3; i<g.argc; i++){
blob_zero(&file);
blob_read_from_file(&file, g.argv[i]);
zip_add_file(g.argv[i], &file, file_isexe(g.argv[i]));
blob_reset(&file);
}
zip_close(&zip);
blob_write_to_file(&zip, g.argv[2]);
}
/*
|
| ︙ | ︙ | |||
339 340 341 342 343 344 345 |
if( pManifest ){
char *zName;
zip_set_timedate(pManifest->rDate);
if( db_get_boolean("manifest", 0) ){
blob_append(&filename, "manifest", -1);
zName = blob_str(&filename);
zip_add_folders(zName);
| | | | | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
if( pManifest ){
char *zName;
zip_set_timedate(pManifest->rDate);
if( db_get_boolean("manifest", 0) ){
blob_append(&filename, "manifest", -1);
zName = blob_str(&filename);
zip_add_folders(zName);
zip_add_file(zName, &mfile, 0);
sha1sum_blob(&mfile, &hash);
blob_reset(&mfile);
blob_append(&hash, "\n", 1);
blob_resize(&filename, nPrefix);
blob_append(&filename, "manifest.uuid", -1);
zName = blob_str(&filename);
zip_add_file(zName, &hash, 0);
blob_reset(&hash);
}
manifest_file_rewind(pManifest);
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
int fid = uuid_to_rid(pFile->zUuid, 0);
if( fid ){
content_get(fid, &file);
blob_resize(&filename, nPrefix);
blob_append(&filename, pFile->zName, -1);
zName = blob_str(&filename);
zip_add_folders(zName);
zip_add_file(zName, &file, manifest_file_mperm(pFile));
blob_reset(&file);
}
}
}else{
blob_reset(&mfile);
}
manifest_destroy(pManifest);
|
| ︙ | ︙ |