michael@0: #!/usr/sbin/perl michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # Compose lowercase alphabet michael@0: @alphabet = ( "a", "b", "c", "d", "e", "f", "g", "h", michael@0: "i", "j", "k", "l", "m", "n", "o", "p", michael@0: "q", "r", "s", "t", "u", "v", "w", "x", michael@0: "y", "z" ); michael@0: michael@0: # Compute year michael@0: $year = (localtime)[5] + 1900; michael@0: michael@0: # Compute month michael@0: $month = (localtime)[4] + 1; michael@0: michael@0: # Compute day michael@0: $day = (localtime)[3]; michael@0: michael@0: # Compute base build number michael@0: $version = sprintf( "%d%02d%02d", $year, $month, $day ); michael@0: $directory = sprintf( "%s\/%s\/%d%02d%02d", $ARGV[0], $ARGV[1], $year, $month, $day ); michael@0: michael@0: # Print out the name of the first version directory which does not exist michael@0: #if( ! -e $directory ) michael@0: #{ michael@0: print $version; michael@0: #} michael@0: #else michael@0: #{ michael@0: # # Loop through combinations michael@0: # foreach $ch1 (@alphabet) michael@0: # { michael@0: # foreach $ch2 (@alphabet) michael@0: # { michael@0: # $version = sprintf( "%d%02d%02d%s%s", $year, $month, $day, $ch1, $ch2 ); michael@0: # $directory = sprintf( "%s\/%s\/%d%02d%02d%s%s", $ARGV[0], $ARGV[1], $year, $month, $day, $ch1, $ch2 ); michael@0: # if( ! -e $directory ) michael@0: # { michael@0: # print STDOUT $version; michael@0: # exit; michael@0: # } michael@0: # } michael@0: # } michael@0: #} michael@0: