File: stag-templates2scripts.pl

package info (click to toggle)
libdbix-dbstag-perl 0.12-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid
  • size: 1,420 kB
  • sloc: perl: 6,152; sql: 588; xml: 221; lisp: 59; makefile: 20
file content (40 lines) | stat: -rwxr-xr-x 872 bytes parent folder | download | duplicates (3)
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
#!/usr/local/bin/perl

# cjm@fruitfly.org

use strict;
use Carp;
use Getopt::Long;

my $bindir = $ENV{DBSTAG_TEMPLATE_BINDIR};
GetOptions("bindir|b"=>\$bindir);

my @dirs = @ARGV;
if (!@dirs) {
    @dirs = split(/:/, $ENV{DBSTAG_TEMPLATE_DIRS});
    print "You did not specify directories on the command line\n";
    print "I will use these\n";
    print "$_\n" foreach @dirs;
    print "\nOK? [yes/no] ";
    my $ok = <STDIN>;
    if ($ok !~ /^y/i) {
	print "Bye!\n";
	exit 0;
    }
}
if (!$bindir) {
    $bindir = "/usr/local/bin";
    print "You did not specify -b (path to template generated binaries) on the command line\n or in \$DBSTAG_TEMPLATE_BINDIR";
    print "I will use this: $bindir\n";
    print "$_\n" foreach @dirs;
    print "\nOK? [yes/no] ";
    my $ok = <STDIN>;
    if ($ok !~ /^y/i) {
	print "Bye!\n";
	exit 0;
    }
}

foreach my $dir (@dirs) {

}