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
|
#!/usr/bin/perl
#
# Hans-Christoph Steiner <hans@eds.org>
#
# This script adds things to the user's .pdrc to support the
# included external libs and a personal external/help folder
# for each user.
# this script has a bug in it: it doesn't create
# the dirs $EXTERNALS and $HELP
#----------------------------------------------------------------------------#
sub addLineToPdrc {
my $addline = shift(@_);
$DESTFILE = "$home/.pdrc";
if ( ! -e $DESTFILE ) {
my $now = time;
utime $now, $now, $DESTFILE;
}
if ( ! `grep -- \'$addline\' \"$DESTFILE\"` ) {
print "Adding: $addline\n";
`echo $addline >> $DESTFILE`;
} else { print "( found: $addline )\n"; }
}
#----------------------------------------------------------------------------#
# if the user has a home dir, add stuff to it
if ( -d $ENV{'HOME'} ) {
$home = $ENV{'HOME'};
print "Found home dir: $home\n";
# create place for users to install their own help/externals
$EXTERNALS="$home/Library/Pd/Externals";
$HELP="$home/Library/Pd/Help";
if ( ! -d "$EXTERNALS" ) { mkdir("$EXTERNALS"); }
if ( ! -d "$HELP" ) { mkdir("$HELP"); }
@pdrc = (
"-listdev",
"-lib Gem",
"-lib iemlib1",
"-lib iemlib2",
"-lib iem_mp3",
"-lib iem_t3_lib",
"-lib pdp",
"-lib xsample",
"-lib zexy",
"-path $EXTERNALS",
"-helppath $HELP"
);
foreach $line (@pdrc) {
addLineToPdrc ($line);
}
} else {
print "ERROR: no home: $ENV{'HOME'}\n";
}
|