diff --git a/build.sh b/build.sh index 20aefbd..067ec24 100755 --- a/build.sh +++ b/build.sh @@ -22,12 +22,14 @@ case ${1} in log_msg fail "Error: unknown build script specified."; exec cat build.usage; fi; - for __ in $(split , "${ARG_RESTART_SCRIPT_AT}"); do - if ! match_list "${VALID_BUILD_LEVELS}" , "${__}"; then - log_msg fail "Error: unknown build level specified."; - exec cat build.usage; - fi; - done; + if [ "${ARG_RESTART_SCRIPT_AT}" != diff ]; then + for __ in $(split , "${ARG_RESTART_SCRIPT_AT}"); do + if ! match_list "${VALID_BUILD_LEVELS}" , "${__}"; then + log_msg fail "Error: unknown build level specified."; + exec cat build.usage; + fi; + done; + fi; else ARG_RESTART_SCRIPT="${2}"; ARG_RESTART_SCRIPT_AT=ALL; fi; shift; ;; diff --git a/build.usage b/build.usage index 2048aec..624f66c 100644 --- a/build.usage +++ b/build.usage @@ -1,5 +1,5 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-c] [-h] [-i level.name.build] - [-r ALL|level.name.build[:step]] [-t[.gz|.bz2|.xz] [-x] + [-r ALL|level.name.build[:diff|:step[,...]]] [-t[.gz|.bz2|.xz] [-x] -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build; defaults to debug. This currently only controls CFLAGS. @@ -8,11 +8,13 @@ usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-c] [-h] [-i level.name.bui -i level.name.build Insert link to pkg.build for the specified build script. All consecutive scripts with higher build levels will be renamed automatically. - -r ALL|level.name.build[:step] + -r ALL|level.name.build[:step[,...]] Restart all or the specified build script(s) completely or at the optionally specified build step. Currently defined - build steps are: fetch extract build_dir autoconf patch configure - clean build install. + build steps are: fetch extract build_dir autoconf patch + configure clean build install. + -r level.name.build:diff + Automatically produce diff(1). -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing ${PREFIX} sans ${WORKDIR} and ${PREFIX}/src/midipix_build and ${WORKDIR} sans top- level regular files at the end of a build with zero failures. The diff --git a/pkg.build b/pkg.build index 03309d8..6d44e3a 100644 --- a/pkg.build +++ b/pkg.build @@ -3,6 +3,21 @@ # parse_with_pkg_name ${SCRIPT_FNAME%[0-9][0-9]*} ${2} ${PKG_BUILD_NAMES}; +if [ "${ARG_RESTART_SCRIPT_AT}" = diff ]; then + printf "" > ${MIDIPIX_BUILD_PWD}/${PKG_SUBDIR}.local.patch.new; + for __ in $(find ${PKG_SUBDIR} -name \*.orig); do + if [ -e ${__%.orig} ]; then + echo diff -Nru ${__} ${__%.orig}; + set +o errexit; diff -Nru ${__} ${__%.orig} \ + >> ${MIDIPIX_BUILD_PWD}/${PKG_SUBDIR}.local.patch.new; __=${?}; set -o errexit; + if [ ${__} -ge 2 ]; then + exit 1; + fi; + fi; + done; + ls -la ${MIDIPIX_BUILD_PWD}/${PKG_SUBDIR}.local.patch.new; + exit 0; +fi; if ! is_build_script_done fetch; then if test_cmd pkg_${PKG_NAME}_fetch; then pkg_${PKG_NAME}_fetch;