summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Erdmann2012-06-26 15:42:43 (GMT)
committerAndré Erdmann2012-06-26 15:42:43 (GMT)
commitfe770adcf35feaa79977fc7b78de26ab8e3766b0 (patch)
tree270f215517496945874e3c61b24ff5f64e86777f
parent895e95d2bfcf84dd956cc2e745e73d8ad5dca005 (diff)
test scripts
-rw-r--r--Makefile7
-rwxr-xr-xrun_sync.py40
-rwxr-xr-xrun_sync_and_overlaycreation.py45
3 files changed, 91 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 07dce33..7e60eb1 100644
--- a/Makefile
+++ b/Makefile
@@ -8,13 +8,18 @@ PY = python$(PYVER)
LOGDIR = ./log
+SYNC = ./run_sync.py
PY_NOP = ./nop.py
PY_OVL = ./run_overlaycreation.py
.PHONY: default dummy \
test test-nop nop \
test-seewave seewave \
- clean-log
+ clean-log \
+ download
+
+download: test-nop $(SYNC)
+ $(PY) $(SYNC)
default: dummy test
diff --git a/run_sync.py b/run_sync.py
new file mode 100755
index 0000000..8d50d85
--- /dev/null
+++ b/run_sync.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+from sys import exit
+from sys import argv as ARGV
+
+if True in ( x in ARGV for x in ( '--help', '-h', '?' ) ):
+ print ( '\n'.join ( (
+ "usage: %s <args>" % ARGV[0],
+ "* args ::= [arg]*",
+ "* arg ::= --write|--show|--help",
+ "** write ^= write overlay (somewhere in /tmp by default)",
+ "** show ^= print overlay to stdout",
+ ) ) )
+ exit ( 0 )
+
+import roverlay
+
+from roverlay.overlay.creator import OverlayCreator
+from roverlay.remote import RepoList
+
+SHOW = False
+WRITE = False
+
+for i, x in enumerate ( ARGV ):
+ if i == 0:
+ pass
+ elif x == '--show':
+ SHOW = True
+ elif x == '--write':
+ WRITE = True
+
+o = OverlayCreator()
+o.can_write_overlay = WRITE
+
+r = RepoList()
+r.load()
+
+r.sync()
+
+if not ( WRITE or SHOW ):
+ print ( "Use '--show' or '--write' if you want ebuild/metadata/Manifest output." )
diff --git a/run_sync_and_overlaycreation.py b/run_sync_and_overlaycreation.py
new file mode 100755
index 0000000..b7e472a
--- /dev/null
+++ b/run_sync_and_overlaycreation.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+from sys import exit
+from sys import argv as ARGV
+
+if True in ( x in ARGV for x in ( '--help', '-h', '?' ) ):
+ print ( '\n'.join ( (
+ "usage: %s <args>" % ARGV[0],
+ "* args ::= [arg]*",
+ "* arg ::= --write|--show|--help",
+ "** write ^= write overlay (somewhere in /tmp by default)",
+ "** show ^= print overlay to stdout",
+ ) ) )
+ exit ( 0 )
+
+import roverlay
+
+from roverlay.overlay.creator import OverlayCreator
+from roverlay.remote import RepoList
+
+SHOW = False
+WRITE = False
+
+for i, x in enumerate ( ARGV ):
+ if i == 0:
+ pass
+ elif x == '--show':
+ SHOW = True
+ elif x == '--write':
+ WRITE = True
+
+o = OverlayCreator()
+o.can_write_overlay = WRITE
+
+r = RepoList()
+r.load()
+
+r.sync()
+r.add_packages ( o.add_package )
+o.run()
+
+if SHOW: o.show_overlay()
+o.close ( write=True )
+
+if not ( WRITE or SHOW ):
+ print ( "Use '--show' or '--write' if you want ebuild/metadata/Manifest output." )