The Subversion repository is here.
Return to searchproduct CVS log | Up to [RISC OS Open] / apache / Admin / bin |
File:
[RISC OS Open] / apache / Admin / bin / searchproduct
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jun 9 20:35:27 2008 UTC (16 years ago) by rool
Branches: MAIN
CVS tags: HEAD
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jun 9 20:35:27 2008 UTC (16 years ago) by rool
Branches: MAIN
CVS tags: HEAD
Clean reimport of sanitised Admin directory.
1: #!/bin/perl 2: # 3: # Copyright 2008 Castle Technology Ltd 4: # 5: # Licensed under the Apache License, Version 2.0 (the "License"); 6: # you may not use this file except in compliance with the License. 7: # You may obtain a copy of the License at 8: # 9: # http://www.apache.org/licenses/LICENSE-2.0 10: # 11: # Unless required by applicable law or agreed to in writing, software 12: # distributed under the License is distributed on an "AS IS" BASIS, 13: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14: # See the License for the specific language governing permissions and 15: # limitations under the License. 16: # 17: # 18: # $Id: searchproduct,v 1.1 2008/06/09 20:35:27 rool Exp $ 19: # 20: # Script used to search for a specific product in the modules file. 21: # It reports the revision of the products file that contains the product. 22: # 23: # This script is useful to find out what build a product was included on. 24: # The script is slow because it has to get every version of the modules 25: # file and search for the product in that version. 26: # 27: # To run it you must be in the same directory as the modules file. 28: # 29: # Author: Cleandro Viana 30: # 31: 32: sub usage { 33: print "\nUsage: search PRODUCT COMPONENTTOSEARCHFOR\n\n"; 34: print "i.e searchproduct DI5101 ghw-0_89\n\n"; 35: exit 0; 36: } 37: unless ($ARGV[0]) { 38: &usage(); 39: } 40: 41: unless ($ARGV[1]) { 42: &usage(); 43: } 44: 45: $product_file="Products/$ARGV[0]/modules"; 46: 47: if ((system("cvs","co","-r","HEAD",$product_file)>>8)) { 48: $string = "\n\nERROR: cvs checkout of product file $product_file. failed...\n"; 49: print $string; 50: exit 0; 51: } 52: if ( ! -f "$product_file" ) { 53: print "\nCan not locate modules file... exiting ...\n\n"; 54: exit 0; 55: } 56: 57: chdir("Products/$ARGV[0]"); 58: 59: @REVS = `cvs -z9 log modules | grep "^revision" | sed 's/revision //g' | sort -t . -n +1 -0 +2 -1 +3 -2 +4 -3 +5 -4 +6 -5 +7 -6 +8 -9 +9 -10 -r`; 60: 61: print "\n$ARGV[1] found on:\n"; 62: 63: foreach $rev (@REVS) { 64: chop $rev; 65: $a = `cvs -z9 update -r $rev modules`; 66: $item = `grep -i "$ARGV[1]" modules`; 67: if ( $item ) { 68: print "\n\t $rev "; 69: } 70: else { 71: print "."; 72: } 73: } 74: 75: exit 0; 76: