From 183b24668ed7ff9cbbbec0425f1c0dfaaf481441 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Apr 06 2017 17:30:14 +0000 Subject: pkhook_version --- diff --git a/docker-builder-data/build/script/include/inc-pkall-none.sh b/docker-builder-data/build/script/include/inc-pkall-none.sh index 8889c46..02dfe0f 100644 --- a/docker-builder-data/build/script/include/inc-pkall-none.sh +++ b/docker-builder-data/build/script/include/inc-pkall-none.sh @@ -51,6 +51,10 @@ pkinstall_release() { return 0 } +pkhook_version() { + echo "$NAME" | cut -d'-' -f 2- +} + pkhook_prebuild() { return 0 } diff --git a/docker-builder-data/build/script/include/inc-pkdownload-default.sh b/docker-builder-data/build/script/include/inc-pkdownload-default.sh index 4dc3ab0..933ea03 100644 --- a/docker-builder-data/build/script/include/inc-pkdownload-default.sh +++ b/docker-builder-data/build/script/include/inc-pkdownload-default.sh @@ -3,7 +3,7 @@ # PK_ARCHIVE pkdownload() { -if ! wget -c --no-check-certificate "$PK_URL" -O $PK_ARCHIVE; then +if ! wget -c --no-check-certificate "$PK_URL" -O "$PK_ARCHIVE"; then return 1 fi } diff --git a/docker-builder-data/build/script/include/inc-pkunpack-default.sh b/docker-builder-data/build/script/include/inc-pkunpack-default.sh index 778d8da..cfcf91e 100644 --- a/docker-builder-data/build/script/include/inc-pkunpack-default.sh +++ b/docker-builder-data/build/script/include/inc-pkunpack-default.sh @@ -3,24 +3,25 @@ # PK_ARCHIVE pkunpack() { - if [ ${PK_ARCHIVE: -7} == ".tar.gz" ]; then - if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then - return 1 - fi - elif [ ${PK_ARCHIVE: -7} == ".tgz" ]; then - if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then - return 1 - fi - else - if ! tar -xf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then - return 1 - fi - fi + if [ ${PK_ARCHIVE: -7} == ".tar.gz" ]; then + if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then + return 1 + fi + elif [ ${PK_ARCHIVE: -7} == ".tgz" ]; then + if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then + return 1 + fi + else + if ! tar -xf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then + return 1 + fi + fi - if [ -z "$PK_VERSION" ]; then - PK_VERSION="$(echo "$NAME" | cut -d'-' -f 2-)" - fi - echo "$PK_VERSION" > "$UNPACK_PACKET_DIR/version-$NAME" - [ ! $? -eq 0 ] && return 1 - return 0 + if [ -z "$PK_VERSION" ]; then + PK_VERSION="$(pkhook_version)" + [ $? -eq 0 ] || return 1 + fi + echo "$PK_VERSION" > "$UNPACK_PACKET_DIR/version-$NAME" + [ $? -eq 0 ] || return 1 + return 0 } \ No newline at end of file diff --git a/docker-builder-data/build/script/include/inc-pkunpack-git.sh b/docker-builder-data/build/script/include/inc-pkunpack-git.sh index fed24a3..a04cecc 100644 --- a/docker-builder-data/build/script/include/inc-pkunpack-git.sh +++ b/docker-builder-data/build/script/include/inc-pkunpack-git.sh @@ -8,13 +8,14 @@ pkunpack() { return 1 fi - if [ -z "$PK_VERSION" ]; then - PK_VERSION="$(echo "$NAME" | cut -d'-' -f 2-)" - fi - cd "$DOWNLOAD_PACKET_DIR/$PK_DIRNAME" - local COMMIT=`git rev-parse HEAD` - [ ! $? -eq 0 ] && return 1 - echo "$PK_VERSION-$COMMIT" > "$UNPACK_PACKET_DIR/version-$NAME" - [ ! $? -eq 0 ] && return 1 + if [ -z "$PK_VERSION" ]; then + PK_VERSION="$(pkhook_version)" + [ $? -eq 0 ] || return 1 + fi + cd "$DOWNLOAD_PACKET_DIR/$PK_DIRNAME" + local COMMIT=`git rev-parse HEAD` + [ $? -eq 0 ] || return 1 + echo "$PK_VERSION-$COMMIT" > "$UNPACK_PACKET_DIR/version-$NAME" + [ $? -eq 0 ] || return 1 return 0 } diff --git a/docker-builder-data/build/script/packet/opentoonz-master.sh b/docker-builder-data/build/script/packet/opentoonz-master.sh index c504ad7..7f72a7c 100644 --- a/docker-builder-data/build/script/packet/opentoonz-master.sh +++ b/docker-builder-data/build/script/packet/opentoonz-master.sh @@ -1,7 +1,6 @@ DEPS="jpeg-9b png-1.6.26 lz4-master lzo-2.10 lzma-5.2.3 glew-2.0.0 freeglut-3.0.0 superlu-5.2.1 openblas-master boost-1.61.0 qt-5.7" DEPS_NATIVE="cmake-3.6.2" -PK_VERSION="1.1.2" PK_DIRNAME="opentoonz" PK_URL="https://github.com/opentoonz/$PK_DIRNAME.git" PK_LICENSE_FILES="README.md LICENSE.txt thirdparty/tiff-4.0.3/COPYRIGHT" @@ -14,6 +13,14 @@ if [ "$PLATFORM" = "linux" ]; then DEPS="$DEPS usb-1.0.20 sdl-2.0.5" fi +pkhook_version() { + cat "$PK_DIRNAME/toonz/sources/toonz/main.cpp" \ + | grep "const.char.\*applicationFullName.=.\"OpenToonz." \ + | cut -d \" -f 2 \ + | cut -d " " -f 2 \ + || return 1 +} + pkbuild() { local LOCAL_OPTIONS= local LOCAL_CMAKE_OPTIONS= diff --git a/docker-builder-data/build/script/packet/synfigstudio-master.sh b/docker-builder-data/build/script/packet/synfigstudio-master.sh index 4e27557..c3a717d 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-master.sh +++ b/docker-builder-data/build/script/packet/synfigstudio-master.sh @@ -34,6 +34,14 @@ PK_LICENSE_FILES="synfig-studio/AUTHORS synfig-studio/README" source $INCLUDE_SCRIPT_DIR/inc-pkall-git.sh +pkhook_version() { + cat "$PK_DIRNAME/synfig-studio/configure.ac" \ + | grep "AC_INIT" \ + | cut -d [ -f 3 \ + | cut -d ] -f 1 \ + || return 1 +} + pkbuild() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME/synfig-studio" || return 1 if ! check_packet_function $NAME build.configure; then