transforms/autopyc
changeset 1907 446472de62e9
parent 196 816e398e992c
child 3898 acd7f120a52a
--- a/transforms/autopyc	Mon May 19 10:28:03 2014 +0100
+++ b/transforms/autopyc	Mon May 19 07:37:20 2014 -0700
@@ -18,12 +18,20 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 # Don't bother specifying each .pyc file.  Allow individual actions to
 # override this by setting pkg.tmp.autopyc to false.
 <transform file path=.*\.py$ -> default pkg.tmp.autopyc true>
-<transform file pkg.tmp.autopyc=true -> emit file path=%(path)c>
+<transform file hardlink pkg.tmp.autopyc=true path=usr/lib/python2\.(.*)\.py$ -> default pkg.tmp.pyversion 2.X>
+<transform file hardlink pkg.tmp.autopyc=true path=usr/lib/python3\.(.*)/.*\.py$ -> default pkg.tmp.pyversion 3.%<1>>
+
+<transform file pkg.tmp.pyversion=2\.X -> emit file path=%(path)c>
+<transform hardlink pkg.tmp.pyversion=2\.X -> emit hardlink path=%(path)c target=%(target)c>
+
+<transform file pkg.tmp.pyversion=3\.([0-9])(.*) path=.*/(.*)\.py$ -> emit file path=/usr/lib/python3.%<1>%<2>/__pycache__/%<3>.cpython-3%<1>.pyc>
+<transform hardlink pkg.tmp.pyversion=3\.(.*) -> emit hardlink path=%(path)c target=%(target)c>
+
 <transform file pkg.tmp.autopyc=.* -> delete pkg.tmp.autopyc .*>
-<transform hardlink path=.*\.py$ -> emit hardlink path=%(path)c target=%(target)c>
+<transform pkg.tmp.pyversion=.* -> delete pkg.tmp.pyversion .*>