Skip to content

Commit

Permalink
update framework
Browse files Browse the repository at this point in the history
  • Loading branch information
bisqwit committed Nov 6, 2008
1 parent 9006718 commit 536bdee
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 15 deletions.
77 changes: 67 additions & 10 deletions depfun.mak
@@ -1,7 +1,7 @@
# This is Bisqwit's generic depfun.mak, included from Makefile.
# The same file is used in many different projects.
#
# depfun.mak version 1.5.1
# depfun.mak version 1.6.0
#
# Required vars:
#
Expand Down Expand Up @@ -55,8 +55,61 @@ depend dep: .depend

-include .depend

git_rm: ;
@- git rm -fr --cached '*' &> /dev/null

archpak: ${ARCHFILES} ;
git_add: ${ARCHFILES} ;
git add --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
@if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
@if [ -f makediff.php ]; then git add makediff.php; fi

git_push_branch: ;
sed 's@^ref: refs/heads/@@' < .git/HEAD > .git/PUSHED_HEAD

git_pop_branch: ;
git checkout `cat .git/PUSHED_HEAD`

git_release: ${ARCHFILES} ;
git commit -a -m 'Release version ${VERSION} (dev)' || \
git commit --amend -a -m 'Release version ${VERSION} (dev)' # commit in dev brach
sed 's@^ref: refs/heads/@@' < .git/HEAD > .git/PUSHED_HEAD
git checkout release || git checkout -b release
git merge --no-commit `cat .git/PUSHED_HEAD`
git rm -fr --cached '*' &> /dev/null
git add --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
@if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
@if [ -f makediff.php ]; then git add makediff.php; fi
git commit -a -m 'Release version ${VERSION}' # commit in release
@- mkdir ${ARCHDIR} 2>/dev/null
git-archive --format=tar --prefix=${ARCHNAME}/ HEAD > ${ARCHDIR}${ARCHNAME}.tar
git checkout `cat .git/PUSHED_HEAD`
@make arch_finish_pak
@make omabin_link${DEPFUN_OMABIN}

git_test_release: ${ARCHFILES}
git commit --allow-empty -a -m 'Test release ${VERSION} (dev)' # commit in dev branch
git-update-server-info
sed 's@^ref: refs/heads/@@' < .git/HEAD > .git/PUSHED_HEAD
git checkout release || git checkout -b release
grep refs/heads/release .git/info/refs | sed 's/ .*//' > .git/RELEASE_HEAD
git merge --no-commit `cat .git/PUSHED_HEAD`
git rm -fr --cached '*' &> /dev/null
git add --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
@if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
@if [ -f makediff.php ]; then git add makediff.php; fi
git commit -a -m 'Test release' # commit in release
rm -rf test_release
git-archive --format=tar --prefix=test_release/ HEAD | tar xvf - | sed 's/^/ /'
git reset --hard `cat .git/RELEASE_HEAD` # undo release AND dev release
git checkout `cat .git/PUSHED_HEAD`
git-gc --quiet
@echo
@echo ----------------------------------------------------------------------
@echo 'Would-be release extracted to test_release/ -- go ahead and try it.'
@echo ----------------------------------------------------------------------
@echo

UNUSED_archpak: ${ARCHFILES} ;
@if [ "${ARCHNAME}" = "" ]; then echo ARCHNAME not set\!;false;fi
- mkdir ${ARCHNAME} ${ARCHDIR} 2>/dev/null
cp --parents -lfr ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile ${ARCHNAME}/ 2>&1 >/dev/null | while read line;do cp --parents -fr "`echo "$$line"|sed 's/.*${ARCHNAME}\///;s/'\''.*//'`" ${ARCHNAME}/; done
Expand All @@ -71,25 +124,29 @@ archpak: ${ARCHFILES} ;
find ${ARCHNAME}/ -not -type d | rev | sort | rev >> .paktmp.txt
#find ${ARCHNAME}/|/ftp/backup/bsort >.paktmp.txt
tar -c --no-recursion -f ${ARCHDIR}${ARCHNAME}.tar -T.paktmp.txt
rm -f .paktmp.txt

rm -rf ${ARCHNAME}
rm -rf .paktmp.txt ${ARCHNAME}
@make arch_finish_pak

arch_finish_pak:
- if [ "${NOBZIP2ARCHIVES}" = "" ]; then bzip2 -9 >${ARCHDIR}${ARCHNAME}.tar.bz2 < ${ARCHDIR}${ARCHNAME}.tar; fi
if [ "${NOGZIPARCHIVES}" = "" ]; then gzip -f9 ${ARCHDIR}${ARCHNAME}.tar; fi
rm -f ${ARCHDIR}${ARCHNAME}.tar

# Makes the packages of various types...
pak: archpak ;
UNUSED_pak: archpak ;
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR} 1; fi

omabin_link${DEPFUN_OMABIN}:
- @rm -f /WWW/src/arch/${ARCHNAME}.tar.{bz2,gz}
- ln -f ${ARCHDIR}${ARCHNAME}.tar.{bz2,gz} /WWW/src/arch/
if [ -f progdesc.php ]; then cp -p --remove-destination progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php 2>/dev/null || cp -fp progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php; fi

# This is Bisqwit's method to install the packages to web-server...
omabin${DEPFUN_OMABIN}: archpak
UNUSED_omabin${DEPFUN_OMABIN}: archpak
if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR}; fi
#- @rm -f /WWW/src/arch/${ARCHNAME}.{zip,rar,tar.{bz2,gz}}
#- ln -f ${ARCHDIR}${ARCHNAME}.{zip,rar,tar.{bz2,gz}} /WWW/src/arch/
- @rm -f /WWW/src/arch/${ARCHNAME}.tar.{bz2,gz}
- ln -f ${ARCHDIR}${ARCHNAME}.tar.{bz2,gz} /WWW/src/arch/
if [ -f progdesc.php ]; then cp -p --remove-destination progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php 2>/dev/null || cp -fp progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php; fi
@make omabin_link${DEPFUN_OMABIN}

install${DEPFUN_INSTALL}: ${INSTALLPROGS}
- if [ ! "${BINDIR}" = "" ]; then mkdir --parents $(BINDIR) 2>/dev/null; mkdir $(BINDIR) 2>/dev/null; \
Expand Down
10 changes: 5 additions & 5 deletions makediff.php
Expand Up @@ -4,7 +4,7 @@
# The same program is used in many different projects to create
# a diff file version history (patches).
#
# makediff.php version 3.0.5
# makediff.php version 3.0.6

# Copyright (C) 2000,2002 Bisqwit (http://bisqwit.iki.fi/)

Expand Down Expand Up @@ -39,10 +39,10 @@ function ShellFix($s)
function calcversion($versionstring)
{
$k = '.'.str_replace('.', '..', $versionstring).'.';
$k = ereg_replace('([^0-9])([0-9][0-9][0-9][0-9][^0-9])', '\1-\2', $k);
$k = ereg_replace('([^0-9])([0-9][0-9][0-9][^0-9])', '\1--\2', $k);
$k = ereg_replace('([^0-9])([0-9][0-9][^0-9])', '\1---\2', $k);
$k = ereg_replace('([^0-9])([0-9][^0-9])', '\1----\2', $k);
$k = ereg_replace('([^0-9])([0-9][0-9a-z][0-9a-z][0-9a-z][^0-9a-z])', '\1-\2', $k);
$k = ereg_replace('([^0-9])([0-9][0-9a-z][0-9a-z][^0-9a-z])', '\1--\2', $k);
$k = ereg_replace('([^0-9])([0-9][0-9a-z][^0-9a-z])', '\1---\2', $k);
$k = ereg_replace('([^0-9])([0-9][^0-9a-z])', '\1----\2', $k);
$k = str_replace('.', '', $k);
$k = str_pad($k, 6*5, '-');
# Reverse:
Expand Down

0 comments on commit 536bdee

Please sign in to comment.