Skip to content

Allow filtered updates of packages matching a regex - #1178

Merged
mavnn merged 7 commits into
fsprojects:masterfrom
mavnn:master
Oct 30, 2015
Merged

mavnn merged 7 commits into
fsprojects:masterfrom
mavnn:master

Conversation

@mavnn

@mavnn mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor

Especially useful for situations like "update all packages that start with my organisations prefix"

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

do you have a small sample for this? Then I could add a regression test

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

Of course.

Given dependency file:

source https://nuget.org/api/v2

nuget Castle.Windsor                           
nuget NUnit                             
nuget Microsoft.AspNet.WebApi.SelfHost

Then:

paket update nuget Microsoft.* --filter should update AspNet

paket update nuget [MN].* --filter will update NUnit and AspNet but leave Castle.Windsor untouched.

Without the --filter flag, package names are treated as exact matches. This is potentially important as . is a special character in regexs.

Comment thread src/Paket.Core/PackageResolver.fs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove that case and express it as UpdateFiltered of GroupName * PackageFilter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, escape .s and treat it as a filter? I think it would work. Hope your regression tests are good up to date though! :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give me a few minutes and I'll see if all the tests pass.

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

image

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

My code obviously rules :)

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

Mind pushing that test to my master branch? I'll add it to the pull request.

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

Ah, ok - I'll grab it.

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

40ecd39

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

you need to run build.cmd runintegrationtests since we don't execute that target during standard build

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

Should having working unit and integration tests now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this test as it's expectation didn't seem meaningful anymore. With pattern based updates, a pattern that didn't match any packages should be a no-op, not an exception.

The update package command still checks that the specific named package exists before calling UpdateFiltered

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

Could also please write one or two samples in the docs of the update command?

@mavnn
mavnn merged commit 27f7f2f into fsprojects:master Oct 30, 2015
@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

@forki crap. Push to wrong remote by mistake. Sorry.

@mavnn

mavnn commented Oct 30, 2015

Copy link
Copy Markdown
Contributor Author

/me goes off to change default push repository

@forki

forki commented Oct 30, 2015

Copy link
Copy Markdown
Member

no worries ;-)

forki added a commit that referenced this pull request Oct 30, 2015
@pms1969 pms1969 mentioned this pull request Jan 12, 2016
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

Successfully merging this pull request may close these issues.

2 participants