]> git.pld-linux.org Git - packages/automake.git/blob - automake-py_compile.patch
This commit was manufactured by cvs2git to create branch 'AC-branch'.
[packages/automake.git] / automake-py_compile.patch
1 diff -aurN automake-1.9.3.orig/lib/am/python.am automake-1.9.3/lib/am/python.am
2 --- automake-1.9.3.orig/lib/am/python.am        2004-01-28 21:50:43.000000000 +0100
3 +++ automake-1.9.3/lib/am/python.am     2004-11-08 13:57:57.149780216 +0100
4 @@ -53,7 +53,7 @@
5  ## Byte-compile must be done at install time, since file times are
6  ## encoded in the actual files.
7         test -z "$$dlist" || \
8 -       PYTHON=$(PYTHON) $(py_compile) --basedir "$(DESTDIR)$(%NDIR%dir)" $$dlist
9 +       PYTHON=$(PYTHON) $(py_compile) --basedir "$(DESTDIR)$(%NDIR%dir)" --destdir "$(DESTDIR)" $$dlist
10  endif %?INSTALL%
11  
12  
13 diff -aurN automake-1.9.3.orig/lib/py-compile automake-1.9.3/lib/py-compile
14 --- automake-1.9.3.orig/lib/py-compile  2004-01-12 23:56:48.000000000 +0100
15 +++ automake-1.9.3/lib/py-compile       2004-11-08 14:00:18.155344112 +0100
16 @@ -35,16 +35,27 @@
17  
18  basedir=
19  
20 -case "$1" in
21 -  --basedir)
22 -    basedir=$2
23 -    if test -z "$basedir"; then
24 -      echo "$0: Missing argument to --basedir." 1>&2
25 -      exit 1
26 -    fi
27 -    shift 2
28 -    ;;
29 -  -h|--h*)
30 +loop=true
31 +while test "x$loop" = "xtrue"
32 +do
33 +  case "$1" in
34 +    --basedir)
35 +      basedir=$2
36 +      if test -z "$basedir"; then
37 +        echo "$0: Missing argument to --basedir." 1>&2
38 +        exit 1
39 +      fi
40 +      shift 2
41 +      ;;
42 +    --destdir)
43 +      destdir=$2
44 +      if test -z "$destdir"; then
45 +        echo "$0: Missing argument to --destdir." 1>&2
46 +        exit 1
47 +      fi
48 +      shift 2
49 +      ;;
50 +    -h|--h*)
51      cat <<\EOF
52  Usage: py-compile [--help] [--version] [--basedir DIR] FILES..."
53  
54 @@ -53,13 +64,17 @@
55  
56  Report bugs to <bug-automake@gnu.org>.
57  EOF
58 -    exit 0
59 -    ;;
60 -  -v|--v*)
61 -    echo "py-compile $scriptversion"
62 -    exit 0
63 -    ;;
64 -esac
65 +      exit 0
66 +      ;;
67 +    -v|--v*)
68 +      echo "py-compile $scriptversion"
69 +      exit 0
70 +      ;;
71 +    *)
72 +      loop=false
73 +      ;;
74 +  esac
75 +done
76  
77  if [ $# = 0 ]; then
78      echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
79 @@ -69,9 +84,22 @@
80  # if basedir was given, then it should be prepended to filenames before
81  # byte compilation.
82  if [ -z "$basedir" ]; then
83 -    trans="path = file"
84 +    trans="    path = file"
85  else
86 -    trans="path = os.path.join('$basedir', file)"
87 +    trans="    path = os.path.join('$basedir', file)"
88 +fi
89 +
90 +# if destdir was given, then it should be stripped from path when storing
91 +# the intended file name
92 +if [ -z "$destdir" ]; then
93 +    transdfile="    dfile = path"
94 +else
95 +    transdfile="
96 +    if path.startswith('$destdir'):
97 +        dfile = path.split('$destdir')[1]
98 +    else:
99 +        dfile = path
100 +    "
101  fi
102  
103  $PYTHON -c "
104 @@ -80,12 +108,13 @@
105  files = '''$*'''
106  print 'Byte-compiling python modules...'
107  for file in string.split(files):
108 -    $trans
109 +$trans
110 +$transdfile
111      if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
112         continue
113      print file,
114      sys.stdout.flush()
115 -    py_compile.compile(path)
116 +    py_compile.compile(path, dfile=dfile)
117  print" || exit $?
118  
119  # this will fail for python < 1.5, but that doesn't matter ...
120 @@ -95,12 +124,13 @@
121  files = '''$*'''
122  print 'Byte-compiling python modules (optimized versions) ...'
123  for file in string.split(files):
124 -    $trans
125 +$trans
126 +$transdfile
127      if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
128         continue
129      print file,
130      sys.stdout.flush()
131 -    py_compile.compile(path)
132 +    py_compile.compile(path, dfile=dfile)
133  print" 2>/dev/null || :
134  
135  # Local Variables:
This page took 0.076196 seconds and 3 git commands to generate.