From de4a3a7924ebc3f709607e37339f6a32ddfbc69a Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Tue, 18 Feb 2014 13:29:27 +0400 Subject: [PATCH] =?UTF-8?q?MIRSPORTA-260=20=D0=9E=D1=82=D1=81=D1=83=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D0=B5=20=D0=BA=D0=B0?= =?UTF-8?q?=D1=80=D1=82=D0=B8=D0=BD=D0=BA=D0=B8=20=D0=BD=D0=B0=2010=D0=B1?= =?UTF-8?q?=D0=B0=D0=BB=D0=BB=D0=BE=D0=B2=20"=D0=BE=D0=B1=D1=85=D0=BE?= =?UTF-8?q?=D0=B4"=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20=D1=81=20?= =?UTF-8?q?=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D0=BC=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=B8=20=D0=BF=D0=BE=D0=BF=D1=8B=D1=82?= =?UTF-8?q?=D0=BA=D0=B5=20=D1=84=D0=BE=D1=80=D1=81=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=20push-update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- File.class.php | 3 ++- push-update.sh | 81 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/File.class.php b/File.class.php index d912c32..db2574f 100644 --- a/File.class.php +++ b/File.class.php @@ -86,7 +86,8 @@ abstract class File * @var $this Image */ if (!array_key_exists($size, $this->variants)) { - if ($force_create && $this->getIsNoEmpty()) { + $original_file_path = Config::get('PATH_WEB_ROOT') . '/' . $this->getWebName(); + if ($force_create && $this->getIsNoEmpty() && file_exists($original_file_path)) { Upload::imageVariant($this, $size); } else { $this->variants[$size] = new ImageVariant(); diff --git a/push-update.sh b/push-update.sh index 9d02fe1..9db0a29 100755 --- a/push-update.sh +++ b/push-update.sh @@ -1,6 +1,8 @@ #!/bin/bash +REMOTE_REPOSITORY='origin' +REMOTE_BRANCH='master' PATH_LIB='/lib/Image' -PROJECTS=( "/var/www/10ballov" "/var/www/predelanet" "/var/www/zelenoemore" "/var/www/d753_common" ) +PROJECTS=( "/var/www/10ballov" "/var/www/predelanet" "/var/www/zelenoemore" "/var/www/d753_common" "/var/www/d753_predelanet" "/var/www/d753_10ballov" ) if [ ! -f "CHANGELOG.md" ] then echo "CHANGELOG.md not exists\n" @@ -31,7 +33,7 @@ then git commit -m "Update CHANGELOG.md" > /dev/null && git tag -d "$VERSION" >/dev/null && git tag "$VERSION" >/dev/null && - git push --tags >/dev/null 2>/dev/null + git push "${REMOTE_REPOSITORY}" --tags >/dev/null 2>/dev/null } || { echo -e "Cannot push released tag into remote repository\n" exit 1 @@ -39,50 +41,51 @@ then else VERSION=$VERSION_PREVIOUS fi -git push >/dev/null || exit 1 +git push "${REMOTE_REPOSITORY}" HEAD:"${REMOTE_BRANCH}" >/dev/null || exit 1 -MESSAGE="\nUpdate ${PATH_LIB} on ${VERSION}\n" +MESSAGE="Update ${PATH_LIB} on ${VERSION}" CURRENT_DIR=`pwd` for project in "${PROJECTS[@]}" do - echo -e "Update lib for ${project}...\n" - { + echo -e "Update lib for ${project}...\n" + { cd "${project}${PATH_LIB}" && - git fetch >/dev/null 2>/dev/null && + git fetch "${REMOTE_REPOSITORY}" >/dev/null 2>/dev/null && git checkout "$VERSION" 2>/dev/null; - } || { - echo -e "Failed to checkout lib on tag ${VERSION}\n" && - exit 1; + } || { + echo -e "Failed to checkout lib on tag ${VERSION}\n" && + exit 1; } - cd "${project}" - LIB_DIR=`echo ${PATH_LIB#'/'}` - git diff-index --quiet HEAD "$LIB_DIR" - LIB_NEW_COMMITS=`echo $?` - if [ $LIB_NEW_COMMITS == 1 ] - then - { - git reset >/dev/null && - git add "$LIB_DIR" >/dev/null && - git commit -m "$MESSAGE" >/dev/null - } || { - echo -e "Failed to update lib for ${project}\n" - exit 1 - } - if [ $project == "/var/www/d753_common" ] - then - { - git push origin master > /dev/null && - cd /var/www/d753_predelanet/ && ./merge-from-master.sh > /dev/null - cd /var/www/d753_10ballov/ && ./merge-from-master.sh > /dev/null - } || { - echo -e "Failed to update dependency d753 branches... Please resolve that problem by hand\n" - exit 1 - } - fi - else - echo -e "Already update\n" - fi + +# cd "${project}" +# LIB_DIR=`echo ${PATH_LIB#'/'}` +# git diff-index --quiet HEAD "$LIB_DIR" +# LIB_NEW_COMMITS=`echo $?` +# if [ $LIB_NEW_COMMITS == 1 ] +# then +# { +# git reset >/dev/null && +# git add "$LIB_DIR" >/dev/null && +# git commit -m "$MESSAGE" >/dev/null +# } || { +# echo -e "Failed to update lib for ${project}\n" +# exit 1 +# } +# if [ $project == "/var/www/d753_common" ] +# then +# { +# git push origin master > /dev/null && +# cd /var/www/d753_predelanet/ && ./merge-from-master.sh > /dev/null +# cd /var/www/d753_10ballov/ && ./merge-from-master.sh > /dev/null +# } || { +# echo -e "Failed to update dependency d753 branches... Please resolve that problem by hand\n" +# exit 1 +# } +# fi +# else +# echo -e "Already update\n" +# fi done echo -e "All operations succeed\n" -exit 0 \ No newline at end of file +exit 0