monotone

monotone Commit Details

Date:2008-12-07 21:46:49 (10 years 6 months ago)
Author:Tony Cooper
Branch:net.venge.monotone.contrib.mtn-browse
Commit:7e688a5053d69413c1a68eeb299dfa23e5950119
Parents: 46a0445fc5174703355d703a8f563ce9bdf2c2fe
Message:Added the in-place development installer script.

Changes:
Adevl-install (full)
Pdevl-install
mtn:execute true

File differences

devl-install
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/perl
##############################################################################
#
# File Name - devl-install
#
# Description - Perl Linux development `installer' for mtn-browse
#
# Author - A.E.Cooper.
#
# Legal Stuff - Copyright (c) 2007 Anthony Edward Cooper
# <aecooper@coosoft.plus.com>.
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation;
# either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307 USA.
#
##############################################################################
#
##############################################################################
#
# Global Data For This Module
#
##############################################################################
# ***** DIRECTIVES *****
require 5.008;
use strict;
use warnings;
# ***** REQUIRED PACKAGES *****
# Standard Perl and CPAN modules.
use Cwd;
use File::Basename;
use IO::Dir;
use IO::File;
#
##############################################################################
#
# Routine - Main Body Of Code
#
# Description - This is the main body of code for the install script.
#
# Data - @_ : The command line arguments.
# Return Value : Unix exit code.
#
##############################################################################
{
my($globs_file,
$infile,
$input,
$lib_dir,
$mas_dir,
$outfile,
$prefix_dir);
print("Linux development in-place installer for mtn-browse\n\n");
$globs_file = "/usr/share/mime/globs";
$prefix_dir = getcwd();
while (1)
{
print("Where is your MIME globs file? [" . $globs_file . "]: ");
chomp($input = <STDIN>);
($input) = ($input =~ m/^\s*(.*)\s*$/);
if ($input ne "")
{
if (! -f $input)
{
print("Error: File `" . $input . "' is unreadable.\n");
next;
}
$globs_file = $input;
}
print("Where is your mtn-browse workspace? [" . $prefix_dir . "]: ");
chomp($input = <STDIN>);
($input) = ($input =~ m/^\s*(.*)\s*$/);
if ($input ne "")
{
if (-e $input && (! -d $input || ! -w $input))
{
print("Error: Directory `" . $input . "' is unwritable or not "
. "a directory.\n");
next;
}
$prefix_dir = $input;
}
$lib_dir = $prefix_dir . "/lib";
$mas_dir = dirname(getcwd()) . "/automate-stdio/lib/Monotone";
print("Where is the Monotone::AutomateStdio (MAS) library? ["
. $mas_dir . "]: ");
chomp($input = <STDIN>);
($input) = ($input =~ m/^\s*(.*)\s*$/);
if ($input ne "")
{
if (-e $input && (! -d $input || ! -w $input))
{
print("Error: Directory `" . $input . "' is unwritable or not "
. "a directory.\n");
next;
}
$mas_dir = $input;
}
print("\nInstallation options are:\n");
print("GLOBS_FILE = " . $globs_file . "\n");
print("PREFIX_DIR = " . $prefix_dir . "\n");
print("LIB_DIR = " . $lib_dir . "\n");
print("MAS DIR = " . $mas_dir . "\n");
print("\nAccept these? [N]: ");
chomp($input = <STDIN>);
if ($input =~ m/^\s*[yY]\s*$/)
{
last;
}
}
# Install `executable'.
die("IO::File failed with $!")
if (! defined($infile = IO::File->new("mtn-browse", "r")));
die("IO::File failed with $!")
if (! defined($outfile = IO::File->new("mtn-browse.out", "w")));
while (defined($input = $infile->getline()))
{
my $orig = $input;
$input =~ s/\@INST:LIB_DIR\@/$lib_dir/g;
$input =~ s/\@INST:GLOBS_FILE\@/$globs_file/g;
$input =~ s/\@INST:PREFIX_DIR\@/$prefix_dir/g;
$outfile->print("#" . $orig) if ($orig ne $input);
$outfile->print($input);
}
$infile->close();
$outfile->close();
$infile = $outfile = undef;
unlink("mtn-browse");
rename("mtn-browse.out", "mtn-browse");
chmod(0755, "mtn-browse");
# Do the pixmap symlinks.
system("cd ${lib_dir}/ui ; ln -s pixmaps/*.png .");
# Link in Monotone::AutomateStdio.
system("cd ${lib_dir}/perl ; ln -s $mas_dir .");
exit(0);
}

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status