Changeset 1285 for trunk


Ignore:
Timestamp:
Aug 1, 2009, 3:20:35 AM (15 years ago)
Author:
ezyang
Message:
Implement searching for Wizard autoinstalls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/locker/sbin/parallel-find.pl

    r1284 r1285  
    2828}
    2929
     30sub old_version ($) {
     31    my $dirname = shift;
     32    open my $h, "$dirname/.scripts-version";
     33    return (<$h>)[-1];
     34}
     35
    3036sub version ($) {
    3137    my $dirname = shift;
    32     open my $h, "$dirname/.scripts-version";
     38    open my $h, "$dirname/.scripts/version";
    3339    return (<$h>)[-1];
    3440}
     
    3844    my $homedir = shift;
    3945
    40     open my $files, "find $homedir/web_scripts -xdev -name .scripts-version 2>/dev/null |";
     46    open my $files, "find $homedir/web_scripts -xdev -name .scripts-version -o -name .scripts 2>/dev/null |";
    4147    open my $out, ">$dump/$user";
    4248    while (my $f = <$files>) {
    4349        chomp $f;
    44         $f =~ s!/\.scripts-version$!!;
     50        my $old_style;
     51        $old_style = ($f =~ s!/\.scripts-version$!!);
     52        if (! $old_style) {
     53            $f =~ s!/\.scripts$!!;
     54        }
    4555        if (! updatable($f)) {
    4656            print STDERR "not updatable: $f";
    4757            next;
    4858        }
    49         $v = version($f);
     59        $v = $old_style ? old_version($f) : version($f);
    5060        print $out "$f:$v";
    5161    }
Note: See TracChangeset for help on using the changeset viewer.