Changeset 1384 for trunk/locker/sbin


Ignore:
Timestamp:
Dec 22, 2009, 6:05:14 PM (15 years ago)
Author:
ezyang
Message:
Make parallel find /actually/ work with Wizard autoinstalls.
File:
1 edited

Legend:

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

    r1372 r1384  
    5555sub version ($) {
    5656    my $dirname = shift;
    57     open my $h, "$dirname/.scripts/version";
    58     return (<$h>)[-1];
     57    $uid = stat($dirname)->uid;
     58    open my $h, "sudo -u #$uid git describe --tags 2>/dev/null |";
     59    chomp($val = <$h>);
     60    return $val;
    5961}
    6062
     
    6769    while (my $f = <$files>) {
    6870        chomp $f;
    69         my $old_style;
    70         $old_style = ($f =~ s!/\.scripts-version$!!);
    71         if (! $old_style) {
    72             $f =~ s!/\.scripts$!!;
     71        my $new_style;
     72        $new_style = ($f =~ s!/\.scripts$!!);
     73        if (! $new_style) {
     74            $f =~ s!/\.scripts-version$!!;
    7375        }
    7476        if (! updatable($f)) {
     
    7678            next;
    7779        }
    78         $v = $old_style ? old_version($f) : version($f);
     80        $v = $new_style ? version($f) : old_version($f);
    7981        print $out "$f:$v";
    8082    }
Note: See TracChangeset for help on using the changeset viewer.