diff --git a/deps/README b/deps/README deleted file mode 100644 index 8c81cbbaa..000000000 --- a/deps/README +++ /dev/null @@ -1,11 +0,0 @@ -ZephyrJS Dependencies -===================== - -This directory contains projects that the ZephyrJS work depends on so we can -maintain our own patches to them when necessary. - -File Descriptions ------------------ -getrepos - This will check out all the other cloned repos we have. -repos.txt - A list of all the upstream repos we have cloned locally. -update - Updates all the cloned repos with the latest code. diff --git a/deps/README.md b/deps/README.md new file mode 100644 index 000000000..2f61eaf83 --- /dev/null +++ b/deps/README.md @@ -0,0 +1,24 @@ +ZJS Dependencies +================ + +This directory contains projects that the ZJS work depends on so we can +maintain our own patches to them when necessary. + +Now we use git submodules to maintain these dependencies, so the old scripts +that were here have been removed. Use `make update` to sync the dependencies +to the commits they are supposed to be on given the version of ZJS you have +checked out. This update target runs automatically when you build normally. + +To update the commit for a dependency directory, change to the `deps` +subdirectory and check out the desired commit. Then when you look at your +`git diff` back at the root level, you will see the change and can commit it. + +For example: + +```bash +$ cd deps/zephyr +$ git checkout v1.6.0 +$ cd ../.. +$ git add deps/zephyr +$ git commit +``` diff --git a/deps/getrepos b/deps/getrepos deleted file mode 100755 index 55b4f84ff..000000000 --- a/deps/getrepos +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python3 - -# getrepos: Checks out the repos listed in repos.txt - -import os -import shutil -import subprocess -import sys - -cwd = os.getcwd() -srcdir = os.path.dirname(os.path.realpath(__file__)) -if cwd != srcdir: - print("Error: getrepos is not in the current directory") - sys.exit(1) - -with open('repos.txt', 'r') as f: - for line in f: - line = line.strip() - if not line or line[0] == '#': - continue - try: - (subdir, repo, commit) = line.split() - except ValueError: - print("Warning: line %d invalid in repos.txt, skipping..." % count) - continue - - if os.path.exists(subdir): - print("Warning: directory '%s' found, skipping..." % subdir) - continue - - subprocess.call(['git', 'clone', repo, subdir]) - os.chdir(subdir) - subprocess.call(['git', 'checkout', commit]) - os.chdir('..') - - # copy overlay, if any - overlaydir = os.path.join('overlay-%s' % subdir) - relpath = os.path.join('..', subdir) - if os.path.isdir(overlaydir): - print("Copying overlay into %s..." % subdir, end='') - sys.stdout.flush() - os.chdir(overlaydir) - for (dirpath, dirnames, filenames) in os.walk('.'): - for filename in filenames: - fullpath = os.path.join(dirpath, filename) - shutil.copy(fullpath, os.path.join(relpath, dirpath)) - os.chdir('..') - print(" done.") diff --git a/deps/update b/deps/update deleted file mode 100755 index 17ac3166b..000000000 --- a/deps/update +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python3 - -# update: Updates the repos listed in repos.txt - -import os -import shutil -import subprocess -import sys - -cwd = os.getcwd() -srcdir = os.path.dirname(os.path.realpath(__file__)) -if cwd != srcdir: - print("Error: update is not in the current directory") - sys.exit(1) - -repos = [] -with open('repos.txt', 'r') as f: - count = 0 - for line in f: - count += 1 - line = line.strip() - if not line or line[0] == '#': - continue - try: - (subdir, repo, commit) = line.split() - except ValueError: - print("Warning: line %d invalid in repos.txt, skipping..." % count) - continue - - os.chdir(subdir) - subprocess.call(['git', 'checkout', 'master']) - subprocess.call(['git', 'pull']) - if commit != 'master': - subprocess.call(['git', 'checkout', commit]) - os.chdir('..') - - # copy overlay, if any - overlaydir = os.path.join('overlay-%s' % subdir) - relpath = os.path.join('..', subdir) - if os.path.isdir(overlaydir): - print("Copying overlay into %s..." % subdir, end='') - sys.stdout.flush() - os.chdir(overlaydir) - for (dirpath, dirnames, filenames) in os.walk('.'): - for filename in filenames: - fullpath = os.path.join(dirpath, filename) - shutil.copy(fullpath, os.path.join(relpath, dirpath)) - os.chdir('..') - print(" done.")