~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to toolkit/mozapps/installer/pkgcp.pl

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
3
 
# This Source Code Form is subject to the terms of the Mozilla Public
4
 
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
 
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
 
 
7
 
 
8
 
# pkgcp.pl -
9
 
#
10
 
# Parse a package file and copy the specified files for a component
11
 
# from the given source directory into the given destination directory
12
 
# for packaging by the install builder.
13
 
#
14
 
# Todo:
15
 
#       - port to MacPerl
16
 
#       - change warn()s to die()s to enforce updating package files.
17
 
#       - change var names to standard form
18
 
 
19
 
# load modules
20
 
use Getopt::Long;
21
 
use File::Basename;
22
 
use Cwd;
23
 
 
24
 
# initialize variables
25
 
%components        = ();        # list of components to copy
26
 
$srcdir           = "";         # root directory being copied from
27
 
$destdir          = "";         # root directory being copied to
28
 
$package          = "";         # file listing files to copy
29
 
$os               = "";         # os type (MacOS, MSDOS, Unix, OS/2)
30
 
$verbose          = 0;          # shorthand for --debug 1
31
 
$debug            = 0;          # controls amount of debug output
32
 
$help             = 0;          # flag: if set, print usage
33
 
 
34
 
 
35
 
# get command line options
36
 
$return = GetOptions(
37
 
                        "source|s=s",           \$srcdir,
38
 
                        "destination|d=s",      \$destdir,
39
 
                        "file|f=s",             \$package,
40
 
                        "os|o=s",               \$os,
41
 
                        "component|c=s",        \@components,
42
 
                        "help|h",               \$help,
43
 
                        "debug=i",              \$debug,
44
 
                        "verbose|v",            \$verbose,
45
 
                        "flat|l",               \$flat,
46
 
                        "<>",                   \&do_badargument
47
 
                        );
48
 
 
49
 
# set debug level
50
 
if ($verbose && !($debug)) {
51
 
        $debug = 1;
52
 
} elsif ($debug != 0) {
53
 
        $debug = abs ($debug);
54
 
        ($debug >= 2) && print "debug level: $debug\n";
55
 
}
56
 
 
57
 
# check usage
58
 
if (! $return)
59
 
{
60
 
        die "Error: couldn't parse command line options.  See \'$0 --help' for options.\nExiting...\n";
61
 
}
62
 
 
63
 
# ensure that Packager.pm is in @INC, since we might not be called from
64
 
# mozilla/toolkit/mozapps/installer.
65
 
$top_path = $0;
66
 
if ( $os eq "dos" ) {
67
 
  $top_path =~ s/\\/\//g;
68
 
}
69
 
push(@INC, dirname($top_path));
70
 
require Packager;
71
 
 
72
 
if ( $os eq "os2" ) {
73
 
  $cwd = cwd();
74
 
  if ($srcdir !~ /^.:+/) {
75
 
    $srcdir = $cwd."/".$srcdir;
76
 
  }
77
 
  $os = "unix";
78
 
}
79
 
Packager::Copy($srcdir, $destdir, $package, $os, $flat, $help, $debug, @components);
80
 
 
81
 
#
82
 
# This is called by GetOptions when there are extra command line arguments
83
 
# it doesn't understand.
84
 
#
85
 
sub do_badargument
86
 
{
87
 
        warn "Warning: unknown command line option specified: @_.\n";
88
 
}
89
 
 
90
 
 
91
 
# EOF