~ubuntu-branches/ubuntu/wily/scribus/wily

« back to all changes in this revision

Viewing changes to OSX-package/linktools/ingest.py

  • Committer: Package Import Robot
  • Author(s): Mattia Rizzolo
  • Date: 2014-06-13 09:50:56 UTC
  • mfrom: (3.2.13 sid)
  • Revision ID: package-import@ubuntu.com-20140613095056-ym1hudn35qm0vmww
Tags: 1.4.2.dfsg.2+r18267-0.1ubuntu1
* Merge from Debian unstable. (LP: #1329662) Remaining changes:
  + Build-depend on libtiff-dev rather than libtiff4-dev.
  + Recommend icc-profiles-free.
  + Add call to dh_python2 in debian/rules, version build-dep for
    python-all-dev, and remove hard coded python dependency. This is to
    generate the proper python:Depends basend on the content of the scripts,
    instead of use a generic, non-versioned, python depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
import os
4
 
import sys
5
 
import osxtools
6
 
 
7
 
def usage():
8
 
        print """
9
 
 Usage: ingest.py bundle [-x lib] [-s fw]
10
 
 
11
 
        Copies all dependent libraries and frameworks into the app bundle.
12
 
        System libraries (/usr/lib*, /System/Library) are not copied.
13
 
        Fixes the dependencies in all executabels contained in bundle.
14
 
        
15
 
        bundle: the path to the *.app bundle
16
 
        -x lib: dont move lib into the bundle. 
17
 
        -s fw:  only move the referenced libarry file from framework fw 
18
 
                        into the bundle, not the complete framework
19
 
        """
20
 
 
21
 
 
22
 
if len(sys.argv) <= 1 or sys.argv[1] == "-?" :
23
 
        usage()
24
 
        sys.exit(0)
25
 
 
26
 
 
27
 
 
28
 
exceptions = []
29
 
strippedfws = []
30
 
bundle = None
31
 
 
32
 
argp = 1
33
 
 
34
 
while argp < len(sys.argv) :
35
 
        if sys.argv[argp] == '-x' :
36
 
                exceptions.append(sys.argv[argp + 1])
37
 
                argp = argp + 2
38
 
        elif sys.argv[argp][0:2] == '-x' :
39
 
                exceptions.append(sys.argv[argp][2:])
40
 
                argp = argp + 1
41
 
        elif sys.argv[argp] == '-s' :
42
 
                strippedfws.append(sys.argv[argp + 1])
43
 
                argp = argp + 2
44
 
        elif  sys.argv[argp][0:2] == '-s' :
45
 
                strippedfws.append(sys.argv[argp][2:])
46
 
                argp = argp + 1
47
 
        elif  sys.argv[argp][0:1] == '-' :
48
 
                print "Error: unknown option: " + sys.argv[argp]
49
 
                usage()
50
 
                sys.exit(1)
51
 
        elif bundle == None:
52
 
                bundle = sys.argv[argp]
53
 
                argp = argp + 1
54
 
        else:
55
 
                print "Error: more than one bundle path specified!"
56
 
                usage()
57
 
                sys.exit(1)
58
 
 
59
 
if bundle == None:      
60
 
        print "Error: no bundle path specified!"
61
 
        usage()
62
 
        sys.exit(1)
63
 
 
64
 
if not os.path.isabs(bundle):
65
 
        bundle = os.path.join(os.getenv("PWD"), bundle)
66
 
        
67
 
if not os.path.isdir(bundle):
68
 
        print "Error: '" + bundle + "' is no bundle path!"
69
 
        usage()
70
 
        sys.exit(1)
71
 
 
72
 
osxtools.ingest(bundle, exceptions, strippedfws)