[haiku-commits] r41175 - haiku/trunk/src/tools

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 4 Apr 2011 04:21:32 +0200 (CEST)

Author: kirilla
Date: 2011-04-04 04:21:31 +0200 (Mon, 04 Apr 2011)
New Revision: 41175
Changeset: https://dev.haiku-os.org/changeset/41175

Modified:
   haiku/trunk/src/tools/hta_committer.sh
Log:
Add function to update fingerprints. May come in handy some day.

Modified: haiku/trunk/src/tools/hta_committer.sh
===================================================================
--- haiku/trunk/src/tools/hta_committer.sh      2011-04-03 17:36:20 UTC (rev 
41174)
+++ haiku/trunk/src/tools/hta_committer.sh      2011-04-04 02:21:31 UTC (rev 
41175)
@@ -17,8 +17,8 @@
 
 --download <lang>      Download tarball of language <lang>.
 
-                               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 @@
 
 
 --diff                 Show diffs for all languages. Paged. Divided by 
language.
---diff <lang>  Show diff for language <lang>. Paged.
+--diff <lang>          Show diff for language <lang>. 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,7 +50,14 @@
 
 --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 @@
 }
 
 
+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 @@
                        CommitAllLanguages
                        exit
                        ;;
+               --fix_fingerprints)
+                       AssertCurrentDirIsSubversionTrunk
+                       FixFingerprintsOfFailingCatalogs
+                       exit
+                       ;;
                *)
                        usage
                        exit 1


Other related posts:

  • » [haiku-commits] r41175 - haiku/trunk/src/tools - jonas