Skip to content

Commit 9396346

Browse files
committed
put zip to make-distribution.sh
1 parent 0d2baf7 commit 9396346

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

make-distribution.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ cp "$SPARK_HOME"/conf/*.template "$DISTDIR"/conf
228228
cp "$SPARK_HOME/README.md" "$DISTDIR"
229229
cp -r "$SPARK_HOME/bin" "$DISTDIR"
230230
cp -r "$SPARK_HOME/python" "$DISTDIR"
231+
zip -r "$DISTDIR"/python/lib/pyspark.zip "$SPARK_HOME"/python/lib/pyspark
231232
cp -r "$SPARK_HOME/sbin" "$DISTDIR"
232233
cp -r "$SPARK_HOME/ec2" "$DISTDIR"
233234

project/SparkBuild.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -361,20 +361,12 @@ object PySparkAssembly {
361361
// to be included in the assembly. We can't just add "python/" to the assembly's resource dir
362362
// list since that will copy unneeded / unwanted files.
363363
resourceGenerators in Compile <+= resourceManaged in Compile map { outDir: File =>
364-
val src = new File(BuildCommons.sparkHome, "python/pyspark")
365-
366-
val zipFile = new File(BuildCommons.sparkHome , "python/lib/pyspark.zip")
367-
IO.delete(zipFile)
368-
def entries(f: File):List[File] =
369-
f :: (if (f.isDirectory) IO.listFiles(f).toList.flatMap(entries(_)) else Nil)
370-
IO.zip(entries(src).map(
371-
d => (d, d.getAbsolutePath.substring(src.getParent.length +1))),
372-
zipFile)
373-
374364
val dst = new File(outDir, "pyspark")
375365
if (!dst.isDirectory()) {
376366
require(dst.mkdirs())
377367
}
368+
369+
val src = new File(BuildCommons.sparkHome, "python/pyspark")
378370
copy(src, dst)
379371
}
380372
)

0 commit comments

Comments
 (0)