summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-21 16:46:12 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-21 22:54:32 -0700
commit94f84da1f6ef5d05439e582012eb5349de618e41 (patch)
tree0250f0e3c6dcd69be0c84d8a7eeefebca7a24dc8 /source4/script
parent10da4b042250ca13deca40d11320451a06663d2e (diff)
downloadsamba-94f84da1f6ef5d05439e582012eb5349de618e41.tar.gz
samba-94f84da1f6ef5d05439e582012eb5349de618e41.tar.bz2
samba-94f84da1f6ef5d05439e582012eb5349de618e41.zip
s4-land: Print commands that are being run.
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/land-remote.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/source4/script/land-remote.py b/source4/script/land-remote.py
index 2ac1eb6c1a..3635e1b328 100755
--- a/source4/script/land-remote.py
+++ b/source4/script/land-remote.py
@@ -16,25 +16,35 @@ parser.add_option("--mail-to", help="Email address to send build/test output to"
(opts, args) = parser.parse_args()
+if not opts.foreground and not opts.mail_to:
+ print "Not running in foreground and --mail-to not specified."
+ sys.exit(1)
+
+print "%s$ mktemp -d" % opts.host
f = subprocess.Popen(["ssh", opts.host, "mktemp", "-d"], stdout=subprocess.PIPE)
(stdout, stderr) = f.communicate()
+if f.returncode != 0:
+ sys.exit(1)
remote_tmpdir = stdout.rstrip()
print "Remote tempdir: %s" % remote_tmpdir
-if subprocess.call(["ssh", opts.host, "git", "clone", "git://git.samba.org/samba.git", "%s/repo" % remote_tmpdir]) != 0:
- sys.exit(1)
+remote_args = ["git", "clone", "git://git.samba.org/samba.git", "%s/repo" % remote_tmpdir]
+print "%s$ %s" % (opts.host, " ".join(remote_args))
+subprocess.check_call(["ssh", opts.host] + remote_args)
print "Pushing local branch"
-subprocess.call(["git", "push", "--force", "git+ssh://%s/%s/repo" % (opts.host, remote_tmpdir), "HEAD:refs/heads/land"])
-args = ["ssh", "-A", opts.host, "python", "%s/repo/source4/script/land.py" % remote_tmpdir]
+print "$ " + " ".join(args)
+subprocess.check_call(["git", "push", "--force", "git+ssh://%s/%s/repo" % (opts.host, remote_tmpdir), "HEAD:refs/heads/land"])
+remote_args = ["python", "%s/repo/source4/script/land.py" % remote_tmpdir]
if opts.mail_to:
- args.append("--mail-to=%s" % opts.mail_to)
+ remote_args.append("--mail-to=%s" % opts.mail_to)
if not opts.foreground:
- args.append("--daemon")
+ remote_args.append("--daemon")
if opts.dry_run:
- args.append("--dry-run")
-args.append("--branch=land")
-args.append(os.path.join(remote_tmpdir, "repo"))
-print "Running remotely: %s" % " ".join(args)
+ remote_args.append("--dry-run")
+remote_args.append("--branch=land")
+remote_args.append(os.path.join(remote_tmpdir, "repo"))
+print "%s$ %s" % (opts.host, " ".join(remote_args))
+args = ["ssh", "-A", opts.host] + remote_args
sys.exit(subprocess.call(args))