From 04a59db1ff5afbdc7c1af05e1f86e0a6e072f9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Mon, 4 Apr 2011 02:21:31 +0000 Subject: [PATCH] Add function to update fingerprints. May come in handy some day. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41175 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/hta_committer.sh | 51 +++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/tools/hta_committer.sh b/src/tools/hta_committer.sh index 75fe343e65..0d0aa1d5fe 100755 --- a/src/tools/hta_committer.sh +++ b/src/tools/hta_committer.sh @@ -17,8 +17,8 @@ Options - in order of intended workflow: --download Download tarball of language . - E.g retries of 0k file. - Or a language still unknown locally. + E.g retries of 0k file. + Or a language still unknown locally. --unpack Unpack all tarballs in a big pile. @@ -34,12 +34,12 @@ Options - in order of intended workflow: --diff Show diffs for all languages. Paged. Divided by language. ---diff Show diff for language . Paged. +--diff Show diff for language . Paged. --commit Commit all languages, as separate commits. - A standard message will be used for each. - ("Catalog update for language xx.") - You will be asked for svn password once per language. + A standard message will be used for each. + ("Catalog update for language xx.") + You will be asked for svn password once per language. CAVEAT! :: hta_committer currently fails to commit a langauge if one of the catkey files resides in a newly added folder, @@ -50,6 +50,13 @@ Options - in order of intended workflow: --delete Delete tarballs and tempfolder. +--fix_fingerprints Force expected fingerprints on catkeys that fail to build. + + Don't use this unless the fingerprints broke due to your + editing of catalog entries, and you need the fingerprints + to be updated. (It's a brute-force approach, including two + full "jam clean". Caveat emptor.) + '********************************************' '* This script is probably not safe. *' @@ -287,6 +294,33 @@ RemoveTempDirectoryIfEmpty() } +FixFingerprintsOfFailingCatalogs() +{ + # Find the catalogs that won't build. + bad_catalogs=$( \ + echo $( \ + jam catalogs 2>&1 \ + | awk '-Fsource-catalog ' '{print$2}' \ + | awk '-F - error' '{print$1}' \ + | sort -u)); + + # Find the present and the expected fingerprints. + # Produce a script to replace present fingerprints with the expected ones. + jam catalogs 2>&1 \ + | grep 'instead of' \ + | awk '-Fafter load ' '{print$2}' \ + | awk '-F. The catalog data' '{print$1}' \ + | sed 's/ instead of /\t/g' | sed 's/[()]//g' \ + | awk '{print "sed -i s/" $2 "/" $1 "/g"}' \ + | awk "{ print \$0\" $bad_catalogs\" }" \ + > hta_fingerprint_correction_script.sh; + + chmod u+x hta_fingerprint_correction_script.sh; + $(hta_fingerprint_correction_script.sh); + rm hta_fingerprint_correction_script.sh +} + + if [ $# -eq 1 ] ; then case "$1" in --help) @@ -359,6 +393,11 @@ if [ $# -eq 1 ] ; then CommitAllLanguages exit ;; + --fix_fingerprints) + AssertCurrentDirIsSubversionTrunk + FixFingerprintsOfFailingCatalogs + exit + ;; *) usage exit 1