Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-06-26 09:31:04 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-06-26 09:31:04 (GMT)
commitd0f143a268283377041a0d903645a790391f54d4 (patch)
tree50d8887a95b228cecc66706e917d5841a5b1c379
parent8ef2647b209aa42c056fe2507e9d17bd2d02bef9 (diff)
Ensure send-patches is run inside source modules
-rwxr-xr-xscripts/shell/send-patches10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/shell/send-patches b/scripts/shell/send-patches
index e15aaa8..d420357 100755
--- a/scripts/shell/send-patches
+++ b/scripts/shell/send-patches
@@ -1,12 +1,18 @@
#!/usr/bin/python
import argparse
+import os
import re
import subprocess
import sys
GIT_CONFIG_SETUP = "sugar-build.send-patches.setup"
+shell_dir = os.path.abspath(os.path.dirname(__file__))
+scripts_dir = os.path.dirname(shell_dir)
+root_dir = os.path.dirname(scripts_dir)
+source_dir = os.path.join(root_dir, "source")
+
def get_git_config(name, is_global=False):
args = ["git", "config"]
@@ -83,6 +89,10 @@ def setup():
set_git_config(GIT_CONFIG_SETUP, "true")
+if os.path.dirname(os.getcwd()) != source_dir:
+ print "The command must be run inside one of the source modules."
+ sys.exit(1)
+
parser = argparse.ArgumentParser()
parser.add_argument("--setup", action="store_true",
help="interactive configuration")