-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmakepoll.pl
More file actions
executable file
·89 lines (75 loc) · 1.74 KB
/
makepoll.pl
File metadata and controls
executable file
·89 lines (75 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#! /usr/bin/perl
#$cmd = "make poll";
$cmd = "make put";
# Cheesy ls wrapper. Dir MUST end in /.
sub dirls($)
{
my $dir = shift @_;
my @r = `ls $dir`;
foreach (@r)
{
chomp $_;
$_ = $dir . $_;
}
return @r;
}
@files = ( 'Makefile' );
# push @files, dirls('src');
push @files, 'WritWorthy.lua';
push @files, 'WritWorthy.xml';
push @files, 'WritWorthy_Alchemy.lua';
push @files, 'WritWorthy_AutoQuest.lua';
push @files, 'WritWorthy_Enchanting.lua';
push @files, 'WritWorthy_I18N.lua';
push @files, 'WritWorthy_Log.lua';
push @files, 'WritWorthy_Know.lua';
push @files, 'WritWorthy_Provisioning.lua';
push @files, 'WritWorthy_RequiredSkill.lua';
push @files, 'WritWorthy_MatListWindow.lua';
push @files, 'WritWorthy_Smithing.lua';
push @files, 'WritWorthy_Util.lua';
push @files, 'WritWorthy_Window.lua';
push @files, 'lang/en.lua';
push @files, 'lang/en2.lua';
push @files, 'Bindings.xml';
push @files, 'lang/en.lua';
print join("\n", @files) . "\n";
@prev_mtime = ();
$sleep_sec = 2;
$dot_period_sec = 10;
$dot_sleep_sec = 0;
sub mod_time()
{
@mtime = ();
foreach $file (@files)
{
# print("FILE: $file .\n");
@x = lstat $file;
push @mtime, $x[9];
}
return @mtime;
}
for ( ; ; )
{
@mtime = mod_time();
if (join(" ", @mtime) ne join(" ", @prev_mtime))
{
clear_screen();
print `$cmd 2>&1`;
print STDERR "\n... waiting for changes ";
}
@prev_mtime = mod_time();
sleep $sleep_sec;
$dot_sleep_sec += $sleep_sec;
if ($dot_period_sec <= ++$dot_sleep_sec)
{
$dot_sleep_sec = 0;
print STDERR ".";
}
}
sub clear_screen()
{
my $clear = "\e[2J";
my $cursorhome = "\e[H";
print "$clear$cursorhome";
}