aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-09-17 14:12:37 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2003-09-17 14:12:37 +0000
commit1bc38e6e6aa3af9e207aeb7baf2d6960cf33d999 (patch)
tree307928b68c1de6a23c41775122714f17872f4987 /packages
parent93d1293d7d273544504d88cf25b419bb275aaff8 (diff)
script for adding things to a user's .pdrc
svn path=/trunk/; revision=991
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/darwin_pkg/pdrc-parser.pl62
1 files changed, 62 insertions, 0 deletions
diff --git a/packages/darwin_pkg/pdrc-parser.pl b/packages/darwin_pkg/pdrc-parser.pl
new file mode 100755
index 00000000..6bc0ac6d
--- /dev/null
+++ b/packages/darwin_pkg/pdrc-parser.pl
@@ -0,0 +1,62 @@
+#!/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 zexy",
+ "$EXTERNALS",
+ "$HELP"
+ );
+
+ foreach $line (@pdrc) {
+ addLineToPdrc ($line);
+ }
+
+} else {
+ print "ERROR: no home: $ENV{'HOME'}\n";
+}