Permalink
Browse files

Initial commit.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
0 parents commit a63cea8c97dbc3102185ee20ab6b543336273bf2 @trofi committed Mar 17, 2012
Showing with 107 additions and 0 deletions.
  1. +1 −0 README
  2. +36 −0 check_hackage_homepage.sh
  3. +18 −0 find_empty.sh
  4. +4 −0 run_repoman.sh
  5. +48 −0 validate_prepare.sh
1 README
@@ -0,0 +1 @@
+Various scripts to check simple QA issues in gentoo overlays.
@@ -0,0 +1,36 @@
+#!/bin/bash -e
+
+check_homepage() {
+ local hp=$1
+ local pn=$2
+
+ hp=${hp#HOMEPAGE=\"}
+ hp=${hp%\"}
+ hp=${hp#http://hackage.haskell.org/package/}
+ hp=${hp#http://hackage.haskell.org/cgi-bin/hackage-scripts/package/}
+
+ pn=${pn#MY_PN=}
+ pn=${pn#\"}
+ pn=${pn%\"}
+ if [[ $pn != $hp ]]; then
+ echo "FIX HACKAGE HOMEPAGE: $e: ${hp} -> ${pn}"
+ sed -e "/HOMEPAGE/ s/$hp/$pn/" -i "${e}"
+ fi
+}
+
+find . -type f -name '*.ebuild' | while read e
+do
+ my_pn=
+ homepage=
+
+ while read l
+ do
+ [[ $l == *"HOMEPAGE="*"hackage"* ]] && homepage=$l
+ [[ $l == *"MY_PN="* ]] && my_pn=$l
+
+ if [[ -n $my_pn ]] && [[ -n $homepage ]]; then
+ check_homepage "$homepage" "$my_pn"
+ break
+ fi
+ done < "$e"
+done
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+[[ -z $1 ]] && {
+ echo "usage $0 <ebuild-tree>"
+ exit 1
+}
+
+tree_root=$1
+
+shopt -s nullglob
+
+for c in $(< "$tree_root/profiles/categories"); do
+ for pkg in "$tree_root"/$c/*; do
+ is_empty() { [[ -z $@ ]]; }
+ [[ $pkg != */CVS ]] && [[ $pkg != */metadata.xml ]] &&
+ is_empty $pkg/*.ebuild && echo "${pkg#${tree_root}/}"
+ done
+done
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+repoman full -d > repoman-QA-`date +%F-%T`.log
+
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# parse args
+
+be_verbose=
+dump_errors=
+get_opt() {
+ local result=0
+ case "$1" in
+ --verbose) be_verbose=yes ;;
+ --dump-errors) dump_errors=yes ;;
+ --) result=1 ;;
+ --) echo "WARN: unknown option '$1'"; result=1 ;;
+ *) result=1 ;;
+ esac
+
+ return $result
+}
+
+v() { [[ -n $be_verbose ]] && echo "$@"; }
+
+while get_opt "$1"; do
+ shift
+done
+
+[[ -z $1 ]] && {
+ echo "usage: $0 [--verbose] [--dump-errors] <ebuild-tree>..."
+ exit 1
+}
+
+# real work
+
+errors_file=$(mktemp)
+for ebuild_tree in "$@"; do
+
+ find "$ebuild_tree" -type f -name '*.ebuild' | while read e
+ do
+ v "TEST: $e"
+ ebuild "$e" clean
+
+ NO_GITIFY=yes FEATURES=noauto \
+ ebuild "$e" fetch unpack prepare \
+ >"$errors_file" 2>&1 \
+ || { echo "FAILED: $e"; [[ -n $dump_errors ]] && cat "$errors_file"; }
+ ebuild "$e" clean
+ done
+done
+rm -f "$errors_file"

0 comments on commit a63cea8

Please sign in to comment.