aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2013-09-11 16:30:58 +0200
committerAndré Erdmann <dywi@mailerd.de>2013-09-11 16:47:28 +0200
commit5426d0432058b148bbf65b022fc57d5d9b46c774 (patch)
tree3caef0db237616a4f7eb17cee680bc6293bfc3b5 /bin
parentmove run_tests to bin/ (diff)
downloadR_overlay-5426d0432058b148bbf65b022fc57d5d9b46c774.tar.gz
R_overlay-5426d0432058b148bbf65b022fc57d5d9b46c774.tar.bz2
R_overlay-5426d0432058b148bbf65b022fc57d5d9b46c774.zip
move scripts/ to bin/
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build/create_manifest.sh29
-rwxr-xr-xbin/build/do_pydoc.sh13
-rwxr-xr-xbin/build/roverlay_rst2html.sh13
-rwxr-xr-xbin/debug/find_invalid.py88
4 files changed, 143 insertions, 0 deletions
diff --git a/bin/build/create_manifest.sh b/bin/build/create_manifest.sh
new file mode 100755
index 0000000..7f9a01c
--- /dev/null
+++ b/bin/build/create_manifest.sh
@@ -0,0 +1,29 @@
+#!/bin/sh -xeu
+SCRIPTS=""
+SCRIPT_DIRS="bin/install"
+FILES="README"
+PYDIRS="roverlay"
+
+# config files, docs?
+
+[ -x setup.py ]
+echo setup.py
+
+for x in $SCRIPTS; do
+ [ -x "$x" ]
+ echo "$x"
+done
+
+for x in ${SCRIPT_DIRS}; do
+ find "$x" -executable -type f -print
+done
+
+for x in $FILES; do
+ [ -e "$x" ]
+ echo "$x"
+done
+
+for x in $PYDIRS; do
+ [ -d "$x" ]
+ find "$x" -name '*.py' -print
+done
diff --git a/bin/build/do_pydoc.sh b/bin/build/do_pydoc.sh
new file mode 100755
index 0000000..e6a227f
--- /dev/null
+++ b/bin/build/do_pydoc.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -xe
+
+into="${1:?}"
+
+cd "$into"
+[ -e ./roverlay ]
+
+find roverlay/ -name "*.py" | \
+ sed -e 's,\/,.,g' -e 's,[.]__init__[.]py$,,' -e 's,[.]py$,,' | \
+ xargs pydoc -w && \
+ ln -fs roverlay.html index.html && \
+ rm -f -- roverlay
+
diff --git a/bin/build/roverlay_rst2html.sh b/bin/build/roverlay_rst2html.sh
new file mode 100755
index 0000000..a3450db
--- /dev/null
+++ b/bin/build/roverlay_rst2html.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -u
+die_usage() { echo "usage: $0 <rst file> <html file>"; exit 1; }
+
+[ $# -eq 2 ] || die_usage
+
+from="${1}"
+to="${2}"
+
+[ -r "${from}" ] || die_usage
+
+TITLE='Automatically Generated Overlay of R packages'
+
+rst2html.py --title "${TITLE}" --date "${from}" "${to}"
diff --git a/bin/debug/find_invalid.py b/bin/debug/find_invalid.py
new file mode 100755
index 0000000..6ccb04b
--- /dev/null
+++ b/bin/debug/find_invalid.py
@@ -0,0 +1,88 @@
+#!/usr/bin/python
+# This file is part of roverlay
+#
+# scans a directory for bad overlay creation results:
+# * empty dirs
+# * missing metadata/Manifest)
+# In contrast to repoman, it does verify that overlay creation succeeded,
+# not that every ebuild is correct.
+#
+# usage: find_invalid.py <overlay>
+
+import os
+import sys
+
+MISSING_METADATA = set()
+MISSING_MANIFEST = set()
+EMPTY = set()
+
+no_metadata = MISSING_METADATA.add
+no_manifest = MISSING_MANIFEST.add
+empty = EMPTY.add
+
+if len ( sys.argv ) != 2:
+ sys.stderr.write ( "usage: {} <dir>\n".format ( sys.argv [0] ) )
+ sys.exit ( os.EX_USAGE )
+
+topdir = os.path.abspath ( sys.argv [1] )
+
+if not os.path.isdir ( topdir ):
+ sys.stderr.write ( "{!r} isn't a directory!\n".format ( topdir ) )
+ sys.exit ( os.EX_USAGE )
+
+def ebuild_check ( filenames ):
+ man = False
+ mtd = False
+ eb = False
+ for f in filenames:
+ if f.endswith ( '.ebuild' ):
+ eb = True
+
+ elif f == 'metadata.xml':
+ mtd = True
+
+ elif f == 'Manifest':
+ man = True
+
+ if eb and mtd and man:
+ return ( True, True, True )
+
+ return ( eb, mtd, man )
+
+
+for dpath, dnames, fnames in os.walk ( topdir ):
+ here = dpath.replace ( topdir, "<overlay root>" )
+
+ e = ebuild_check ( fnames )
+
+ if e[0]:
+
+ if not e[1]:
+ # metadata missing
+ no_metadata ( here )
+
+ if not e[2]:
+ # manifest missing
+ no_manifest ( here )
+
+ elif len ( dnames ) == 0 and len ( fnames ) == 0:
+ empty ( here )
+
+
+ALL_OK = not ( MISSING_METADATA or MISSING_MANIFEST or EMPTY )
+
+if MISSING_METADATA:
+ print ( "*** The following ebuild directories have no metadata file:" )
+ print ( '\n'.join ( sorted ( MISSING_METADATA ) ) )
+
+if MISSING_MANIFEST:
+ print ( "*** The following ebuild directories have no Manifest file:" )
+ print ( '\n'.join ( sorted ( MISSING_MANIFEST ) ) )
+
+if EMPTY:
+ print ( "*** The following dirs are empty:" )
+ print ( '\n'.join ( sorted ( EMPTY ) ) )
+
+
+if ALL_OK:
+ print ( "everything looks ok" )