Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/tmux Add instructions and a helper script to im...
details: https://anonhg.NetBSD.org/src/rev/7e3ef460e8fc
branches: trunk
changeset: 763095:7e3ef460e8fc
user: jmmv <jmmv%NetBSD.org@localhost>
date: Thu Mar 10 09:10:41 2011 +0000
description:
Add instructions and a helper script to import tmux.
diffstat:
external/bsd/tmux/README | 13 ++++
external/bsd/tmux/prepare-import.sh | 111 ++++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+), 0 deletions(-)
diffs (132 lines):
diff -r 5b11f8dbe19c -r 7e3ef460e8fc external/bsd/tmux/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tmux/README Thu Mar 10 09:10:41 2011 +0000
@@ -0,0 +1,13 @@
+To update tmux to a new version:
+
+- Use prepare-import.sh to regenerate the dist directory.
+- Use configure from the distfile to generate new config.{h,mk} files.
+- Copy the generated config.h to usr.bin/tmux.
+- Update usr.bin/tmux/Makefile according to config.mk (in particular, the
+ list of files used from compat/ and the required libraries).
+- Update the list of source files in usr.bin/tmux/Makefile with the new
+ dist/*.c listing.
+- cvs import the contents of the new dist directory.
+- Commit the changes to the reachover Makefiles.
+- Update doc/3RDPARTY with the new tmux version.
+- Add a note to doc/CHANGES about the new version.
diff -r 5b11f8dbe19c -r 7e3ef460e8fc external/bsd/tmux/prepare-import.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/tmux/prepare-import.sh Thu Mar 10 09:10:41 2011 +0000
@@ -0,0 +1,111 @@
+#! /bin/sh
+# $NetBSD: prepare-import.sh,v 1.1 2011/03/10 09:10:41 jmmv Exp $
+#
+# Use this script to recreate the 'dist' subdirectory from a newly released
+# distfile. The script takes care of unpacking the distfile, removing any
+# files that are not relevant to NetBSD and checking if there are any new
+# files in the new release that need to be addressed.
+#
+# See the README file for general instructions.
+#
+
+set -e
+
+ProgName=${0##*/}
+
+CLEAN_PATTERNS=
+CLEAN_PATTERNS="${CLEAN_PATTERNS} [A-Z]*"
+CLEAN_PATTERNS="${CLEAN_PATTERNS} configure*"
+
+err() {
+ echo "${ProgName}:" "${@}" 1>&2
+ exit 1
+}
+
+log() {
+ echo "${ProgName}:" "${@}"
+}
+
+backup_dist() {
+ if [ -d dist.old ]; then
+ log "Removing dist; dist.old exists"
+ rm -rf dist
+ else
+ log "Backing up dist as dist.old"
+ mv dist dist.old
+ fi
+}
+
+extract_distfile() {
+ local distfile="${1}"; shift
+ local distname="${1}"; shift
+
+ log "Extracting ${distfile}"
+ tar -xzf "${distfile}"
+ [ -d "${distname}" ] || err "Distfile did not create ${distname}"
+ log "Renaming ${distname} to dist"
+ mv "${distname}" dist
+}
+
+get_distname() {
+ local distfile="${1}"; shift
+ basename "${distfile}" | sed -e 's,\.tar.*,,'
+}
+
+cleanup_dist() {
+ log "Removing unnecessary files from dist"
+ ( cd dist && rm -rf ${CLEAN_PATTERNS} )
+}
+
+extract_version() {
+ local version=$(grep '^VERSION[ \t]*=' dist/Makefile | \
+ cut -d '=' -f 2 | sed -e 's,[ \t]*,,g')
+ log "Version is ${version}"
+ echo "${version}" >usr.bin/tmux/version.txt
+}
+
+diff_dirs() {
+ local old_dir="${1}"; shift
+ local new_dir="${1}"; shift
+
+ local old_list=$(mktemp -t tmux-import.XXXXXX)
+ local new_list=$(mktemp -t tmux-import.XXXXXX)
+ local diff=$(mktemp -t tmux-import.XXXXXX)
+ trap "rm -f '${old_list}' '${new_list}' '${diff}'; exit 1" \
+ HUP INT QUIT TERM
+
+ ( cd "${old_dir}" && find . | sort >>"${old_list}" )
+ ( cd "${new_dir}" && find . | sort >>"${new_list}" )
+
+ diff -u "${old_list}" "${new_list}" | grep '^+\.' >>"${diff}" || true
+ if [ -s "${diff}" ]; then
+ log "New files found"
+ diff -u "${old_list}" "${new_list}" | grep '^+\.'
+ log "Check if any files have to be cleaned up and update" \
+ "the prepare-import.sh script accordingly"
+ else
+ log "No new files; all good!"
+ fi
+
+ rm -f "${old_list}" "${new_list}" "${diff}"
+}
+
+main() {
+ [ ${#} -eq 1 ] || err "Must provide a distfile name"
+ local distfile="${1}"; shift
+
+ [ -f Makefile -a -f prepare-import.sh ] || \
+ err "Must be run from the src/external/bsd/tmux subdirectory"
+
+ local distname="$(get_distname ${distfile})"
+
+ backup_dist
+ extract_distfile "${distfile}" "${distname}"
+ extract_version
+ cleanup_dist
+ diff_dirs dist.old dist
+ log "Don't forget to validate usr.bin/tmux/version.txt and to update" \
+ "the version in doc/3RDPARTY"
+}
+
+main "${@}"
Home |
Main Index |
Thread Index |
Old Index