Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=7a88ed93c40916205a078ff16eac27b1e9f366da

commit 7a88ed93c40916205a078ff16eac27b1e9f366da
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Fri Jun 4 00:45:07 2010 +0200

add wipcheck

diff --git a/Makefile b/Makefile
index d29d04f..483acbf 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ MANS = $(subst .txt,.1,$(DOCS))

PROGRAMS = bumppkg chkdep chkworld emulgen fblint fpmdiff fwcpan fwmirror \
genchangelog mkisorelease mkpkghtml pear-makefb pootle-update \
-       portpkg repoman revdep-rebuild rpm2fpm syncemul
+       portpkg repoman revdep-rebuild rpm2fpm syncemul wipcheck

compile: $(PROGRAMS) apidocs docs
$(MAKE) -C mkiso
diff --git a/wipcheck b/wipcheck
new file mode 100755
index 0000000..23b034c
--- /dev/null
+++ b/wipcheck
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+#   wipcheck, a wip repo checker
+#
+#   Copyright (c) 2010 by Miklos Vajna <vmik...@frugalware.org>
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+#   USA.
+#
+
+# fake variable for fwmakepkg
+CHROOT=1
+
+. /etc/makepkg.conf
+. /usr/lib/frugalware/fwmakepkg
+
+die()
+{
+       echo "$@"
+       exit 1
+}
+
+[ -d source ] || die "This tool must be invoked within a WIP repo."
+
+upstream=$(git log|grep -m1 ^Merge|sed 's/.* //')
+for i in $(git log --pretty=oneline $upstream..|sed 's/^[a-f0-9]\+ \([^ 
]\+\).*/\1/'|sed 's/-[^-]\+-[^-]\+-[^-]\+$//' |sort -u)
+do
+       [ -d source/*/$i ] || continue
+       [ "$1" == "-q" ] || echo "checking $i... (dir: $(pwd) )"
+       cd source/*/$i
+       unset pkgname pkgver pkgextraver pkgrel nobuild options archs
+       export startdir=`pwd`
+       . ./FrugalBuild || die "errors parsing the FrugalBuild"
+       for j in ${arc...@]}
+       do
+               [[ "${j:0:1}" = "!" ]] && continue
+               [ -e ../../../frugalware-$j/$pkgname-$pkgver-$pkgrel-$j.fpm ] 
|| echo "$pkgname-$pkgver-$pkgrel-$j is missing"
+       done
+       cd - >/dev/null
+done
diff --git a/wipcheck.txt b/wipcheck.txt
new file mode 100644
index 0000000..d09b430
--- /dev/null
+++ b/wipcheck.txt
@@ -0,0 +1,29 @@
+= wipcheck(1)
+
+== NAME
+
+wipcheck - examines work in progress repositories
+
+== SYNOPSIS
+
+wipcheck [options]
+
+== DESCRIPTION
+
+The goal of this tool is to automatically check for trivial errors in a
+WIP repo. First just run it and wait till it dies somewhere. If you
+removed a package but a patch is still there for the removed package
+then you have directories without FrugalBuild files and the script will
+just die. Just run the re-run the script again and again till it does
+not die.
+
+Once you fixed these errors, you can run the script with the -q flag to
+see missing (to be exact: not yet synchronized by syncpkgcds) binary
+packages. The repo can be merged using fpmmerge in case that list is
+empty.
+
+== OPTIONS
+
+-q::
+       Quiet mode, just print errors and no output. Useful once you are
+       sure about the script won't die anywhere.
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to