Sync Drupal Distribution Profile With GIT Managed Project

As managing my Drupal distribution - DruStack, with both Drupal.org version and GitHub version, one of the daily duty is to keep their submodules in synchonize. E.g. in case drupal-org.make say we would like to fetch drustack_core as below:

projects[drustack_core][download][branch] = 7.x-23.x
projects[drustack_core][download][type] = git
projects[drustack_core][download][url] = http://git.drupal.org/project/drustack_core.git
projects[drustack_core][subdir] = drustack

In GitHub submodule I need to check out the corresponding branch with "7.x-23.x". Moreover, in case drupal-org.make say we would like to fetch multiflex3 as below:

projects[multiflex3][subdir] = contrib
projects[multiflex3][version] = 3.2

In GitHub submodule I should check out the corresponding tag with "7.x-3.2", too.

So How to sync it in a handy way?

cat profiles/drustack/drupal-org.make | grep branch | while read LINE; do \
    echo $LINE; \
    PROJECT=`echo $LINE | sed 's/projects\[\(.*\)\]\[download\].* = \(.*\)/\1/g'`; \
    BRANCH=`echo $LINE | sed 's/projects\[\(.*\)\]\[download\].* = \(.*\)/\2/g'`; \
    GIT="git --git-dir=`find . -type f -name '.git' | grep \"\/$PROJECT\/\" | grep -v libraries`"; \
    $GIT fetch; \
    $GIT checkout $BRANCH; \
    $GIT pull; \
    $GIT status; \
done

cat profiles/drustack/drupal-org.make | grep version | while read LINE; do \
    echo $LINE; \
    PROJECT=`echo $LINE | sed 's/projects\[\(.*\)\]\[version\].* = \(.*\)/\1/g'`; \
    TAG="7.x-`echo $LINE | sed 's/projects\[\(.*\)\]\[version\].* = \(.*\)/\2/g'`"; \
    GIT="git --git-dir=`find . -type f -name '.git' | grep \"\/$PROJECT\/\" | grep -v libraries`"; \
    $GIT fetch; \
    $GIT checkout $TAG; \
    $GIT status; \
done

Add new comment

Restricted HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • HTML tags will be transformed to conform to HTML standards.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.