You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2015/06/04 11:52:35 UTC

[GitHub] incubator-brooklyn pull request: Change version only on the line f...

GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/678

    Change version only on the line following the version tag

    Previously the script changed versions in the whole file, regardless of version tags.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/incubator-brooklyn fix/change-version

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/678.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #678
    
----
commit 9c5e8524ed76afaf5a59ff790d2d90e60b3b459e
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2015-06-04T09:52:08Z

    Change version only on the line following the version tag
    
    Previously the script changed versions in the whole file, regardless of version tags.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Change version only on the line f...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/678#discussion_r31716800
  
    --- Diff: usage/scripts/change-version.sh ---
    @@ -63,7 +63,7 @@ FILES_COUNT=`echo $FILES | wc | awk '{print $2}'`
     if [ ${FILES_COUNT} -ne 0 ]; then
         # search for files containing version markers
         sed -i.bak -e "/${VERSION_MARKER}/s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    -    sed -i.bak -e "/${VERSION_MARKER_NL}/n;s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    +    sed -i.bak -e "/${VERSION_MARKER_NL}/{n;s/${CURRENT_VERSION}/${NEW_VERSION}/g;}" $FILES
    --- End diff --
    
    for next line should use `MY_VERSION_BELOW`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Change version only on the line f...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/678#discussion_r31716722
  
    --- Diff: usage/scripts/change-version.sh ---
    @@ -63,7 +63,7 @@ FILES_COUNT=`echo $FILES | wc | awk '{print $2}'`
     if [ ${FILES_COUNT} -ne 0 ]; then
         # search for files containing version markers
         sed -i.bak -e "/${VERSION_MARKER}/s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    -    sed -i.bak -e "/${VERSION_MARKER_NL}/n;s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    +    sed -i.bak -e "/${VERSION_MARKER_NL}/{n;s/${CURRENT_VERSION}/${NEW_VERSION}/g;}" $FILES
    --- End diff --
    
    I'm not sure if this is working.
    
    I created a test file:
    
    ```
    1.2.0-SNAPSHOT # MY_VERSION
    
    some text
    
    1.2.0-SNAPSHOT
    
    some more text
    
    # MY_VERSION
    1.2.0-SNAPSHOT
    
    blah
    
    1.2.0-SNAPSHOT
    # MY_VERSION
    ```
    
    And I ran `$BROOKLYN_REPO/usage/scripts/change-version.sh MY 1.2.0-SNAPSHOT 1.2.0-CHANGED`.
    
    The output file was:
    
    ```
    1.2.0-CHANGED # MY_VERSION
    
    some text
    
    1.2.0-SNAPSHOT
    
    some more text
    
    # MY_VERSION
    1.2.0-SNAPSHOT
    
    blah
    
    1.2.0-SNAPSHOT
    # MY_VERSION
    ```
    
    i.e. it didn't change it on the line after "# MY_VERSION".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Change version only on the line f...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/678


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Change version only on the line f...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/678#discussion_r31718321
  
    --- Diff: usage/scripts/change-version.sh ---
    @@ -63,7 +63,7 @@ FILES_COUNT=`echo $FILES | wc | awk '{print $2}'`
     if [ ${FILES_COUNT} -ne 0 ]; then
         # search for files containing version markers
         sed -i.bak -e "/${VERSION_MARKER}/s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    -    sed -i.bak -e "/${VERSION_MARKER_NL}/n;s/${CURRENT_VERSION}/${NEW_VERSION}/g" $FILES
    +    sed -i.bak -e "/${VERSION_MARKER_NL}/{n;s/${CURRENT_VERSION}/${NEW_VERSION}/g;}" $FILES
    --- End diff --
    
    Great, hadn't realised that (and didn't just look at the code!). Works well. Merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---