blob: aaa4d86b5ad597af4ceba9e6185c6135391fd703 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/sh
set -ex
VERSION=$2
ORIG_ZIP=`readlink -f "$3"`
ZIP_LOC=`dirname "${ORIG_ZIP}"`
REAL_DIR="${ZIP_LOC}/ldraw-parts-${VERSION}+ds"
REAL_TAR="${ZIP_LOC}/ldraw-parts_${VERSION}+ds.orig.tar.xz"
REAL_DIR_BASE=`basename "$REAL_DIR"`
mkdir -p "$REAL_DIR"
# extract and remove the zip
tar -C "${REAL_DIR}" -xf "${ORIG_ZIP}"
rm "${ORIG_ZIP}"
# recover mklist.c and headers from mklist1_6.zip
unzip -q "${REAL_DIR}/mklist1_6.zip" mklist.c include/*.h -d "${REAL_DIR}"
# remove all zip archives (they contain compiled *.exe and old source)
# remove mklist.exe
rm "${REAL_DIR}/"*.zip "${REAL_DIR}/mklist.exe"
# repack source tarball
# gz would be 47% larger than xz
XZ_OPT=-v9e tar --remove-files --directory "${ZIP_LOC}" -cJf "${REAL_TAR}" "${REAL_DIR_BASE}"
exit 0
|