Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appdir.excludes is being ignored #69

Closed
ericovasconcelos opened this issue Jul 21, 2015 · 8 comments
Closed

Appdir.excludes is being ignored #69

ericovasconcelos opened this issue Jul 21, 2015 · 8 comments

Comments

@ericovasconcelos
Copy link

Hi,

I've tried to use the appdir.excludes from deployment.properties to exclude .svn files in my project. I realized that files in the directories were not being excluded.

From my perspective, I believe that the code at ZpkInvokable.php:451 that validates the exclude is working:

the code:
if (in_array($localPath, $excludes)) {
return;
}

Returns returns false for the following example:
$localPath = "module/Application/view/application/usuariomodule/Application/view/application/usuario";
$excludes[0] = "svn";
$excludes[1] = "**/.svn";

This means that it will neve enter the return line.

I've managed to solve it by adding the following loop:

foreach($excludes as $excludeItem) {
if (strpos($localPath, $excludeItem)) {
return;
}
}

If you authorize I could send pull request for it.

@slaff
Copy link
Contributor

slaff commented Jul 22, 2015

Hi @ericovasconcelos you can fork the repo, add your changed to the forked repo and create a pull request. Make sure to add tests for the thing(s) that you are fixing and use psr-2 coding standards.

@slaff
Copy link
Contributor

slaff commented Jul 23, 2015

If we have an entry that has the following syntax "**/" then the code should look for items that end with and ignore them. I will try to add this change in the coming days.

slaff pushed a commit that referenced this issue Jul 23, 2015
slaff pushed a commit that referenced this issue Jul 23, 2015
See issue #69.
Compiled new phar file with that functionality.
slaff pushed a commit that referenced this issue Jul 24, 2015
See issue #69.
Compiled new phar file with that functionality.
@slaff slaff closed this as completed Jul 24, 2015
@marcelotmelo
Copy link

Hello, I know it is a closed issue but I don't think that what was implemented is correct at all.
At the Syntax section of the docs (https://github.com/zendtech/zendserver-sdk-java/wiki/Deployment-Properties-File#syntax) it states that:
"As a result, the whole file with its content (if it is a directory) is considered.

file name with **/ prefix, e.g.:

**/.svn

As a result, all files with specified name will be considered. It should be used only for exclusion."
This means files that have that prefix would be ignored.
What was implemented is that files that have the suffix matching the pattern will be ignored (lines 466 to 470 of the ZpkInvokable class).

@marcelotmelo
Copy link

I've written a fix, but have not yet properly tested it. I'll fork the repo and make a pull request as soon as possible.

slaff pushed a commit that referenced this issue Jul 31, 2015
@slaff
Copy link
Contributor

slaff commented Jul 31, 2015

@marcelotmelo Check the latest version.

@marcelotmelo
Copy link

@slaff I have just checked and tested. Still does not work as intended - any files that are underneath a .svn directory are still being included. Create a .svn directory inside the directory that is included in scriptsdir.include. Inside this .svn directory create a couple of files and run the packZpk. The files that are inside the .svn directory still are included.

@slaff
Copy link
Contributor

slaff commented Aug 3, 2015

@marcelotmelo Please, provide sample directory structure, deployment.xml and deployment.properties so that we can test.

@marcelotmelo
Copy link

I made a pull request. The project.zip inside the test/samples contains a comprehensive directory structure and deployment files.

slaff pushed a commit that referenced this issue Aug 12, 2015
This list is applied for all entries in deployment properties file. By default, it consists of the following files:

**/.svn
**/.git
**/.cvs

It is possible to add/remove files from it by modifying the project's deployment.properties file.

Related to issue #69.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants