Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libpsibuild.sh for addind REV_DATE param #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions scripts/posix/libpsibuild.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# use REV_DATE to build Psi+ in state before this date:
[ -n "${REV_DATE}" ]
REV_NEED=$?
#[ ${REV_NEED} -ne 0 ] && REV_DATE=`date -dnext-week +%Y-%m-%d` # this line can be removed, but it shows emaple of REV_DATE format
# do not forget, that REV_DATE always allow you to get revision before "master".
# it will not give you "master" even if you set date to 9999-12-31. (i wrote this in 2014 year.)
# so if you want "master", then don't use REV_DATE, leave it as empty string.

# do not update anything from repositories until required
WORK_OFFLINE=${WORK_OFFLINE:-0}

Expand Down Expand Up @@ -78,6 +86,8 @@ QCONFDIR Каталог с банирником qconf при руч
SYSLIBDIRNAME Имя системного каталога с библиотеками (lib64/lib32/lib)
Автодетектится если не указана
PLUGINS_PREFIXES Список префиксов плагинов через пробел (generic/unix/etc)
REV_DATE Собрать Psi+ из кода свежести до этой даты (например:
2012-01-15)
END
;;
*) cat <<END
Expand All @@ -100,6 +110,7 @@ QCONFDIR qconf's binary directory when compiled manually
SYSLIBDIRNAME System libraries directory name (lib64/lib32/lib)
Autodetected when not given
PLUGINS_PREFIXES Space-separated list of plugin prefixes (generic/unix/etc)
REV_DATE Build Psi+ in state before this date (e.g.: 2012-01-15)
END
esac
exit 0
Expand Down Expand Up @@ -449,6 +460,7 @@ git_fetch() {
[ $WORK_OFFLINE = 0 ] && {
cd "${target}"
[ -n "${comment}" ] && log "Update ${comment} .."
git checkout master || die "git checkout to master failed"
git pull || die "git update failed"
cd "${curd}"
} || true
Expand All @@ -460,6 +472,15 @@ git_fetch() {
}
[ $WORK_OFFLINE = 0 -o $forcesubmodule = 1 ] && {
cd "${target}"
if [ ${REV_NEED} -eq 0 ]; then
REV=`git rev-list master -n 1 --first-parent --before=${REV_DATE}`
if [ -z "${REV}" ]; then
log "!!!WARNING: git revision before ${REV_DATE} does not exist (remote=${remote}, target=${target})"
else
log "checkout to ${REV} (${REV_DATE}) .."
git checkout "${REV}" || die "git checkout to ${REV} (${REV_DATE}) failed"
fi
fi
git submodule update --init || die "git submodule update failed"
}
cd "${curd}"
Expand Down