From d97238fb33efca637e532ddbc0c6a79c644458a9 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 21 Dec 2006 01:17:43 +0100 Subject: [PATCH] trim stepmake --- stepmake/bin/install-dot-exe.sh | 25 ---- stepmake/bin/install-layout.sh | 12 -- stepmake/bin/ls-latex.py | 212 -------------------------------- stepmake/bin/package-zet.sh | 44 ------- stepmake/bin/package-zip.sh | 59 --------- stepmake/bin/package-zip32.sh | 139 --------------------- stepmake/bin/packagepython.py | 161 ------------------------ stepmake/bin/release.py | 103 ---------------- stepmake/bin/stepdirs.sh | 47 ------- 9 files changed, 802 deletions(-) delete mode 100755 stepmake/bin/install-dot-exe.sh delete mode 100644 stepmake/bin/install-layout.sh delete mode 100644 stepmake/bin/ls-latex.py delete mode 100755 stepmake/bin/package-zet.sh delete mode 100644 stepmake/bin/package-zip.sh delete mode 100644 stepmake/bin/package-zip32.sh delete mode 100755 stepmake/bin/packagepython.py delete mode 100755 stepmake/bin/release.py delete mode 100755 stepmake/bin/stepdirs.sh diff --git a/stepmake/bin/install-dot-exe.sh b/stepmake/bin/install-dot-exe.sh deleted file mode 100755 index 1881b2de8b..0000000000 --- a/stepmake/bin/install-dot-exe.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# install-dot-exe.sh -- add .exe for cygnus gnu-windows -# hack for doos install - -realinstall=install - -args='' -while [ $# -ne 0 ] -do - x=`echo $1 | sed 's@//@/@g'` - case $1 in - -*) args="$args $x" - ;; - - *) if [ -f $1.exe ]; then - args="$args $x.exe" - else - args="$args $x" - fi - ;; - esac - shift -done - -$realinstall $args diff --git a/stepmake/bin/install-layout.sh b/stepmake/bin/install-layout.sh deleted file mode 100644 index 4e54a99564..0000000000 --- a/stepmake/bin/install-layout.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# install-layout.sh --- build an installation layout -# -prefix=$HOME/usr -dirs='bin src/patches src/releases lib/texmf/tex lib/texmf/mf/source/public' - -for i in $dirs; do - if [ ! -e $prefix/$i ]; then - echo +mkdir -p $prefix/$i - mkdir -p $prefix/$i - fi -done diff --git a/stepmake/bin/ls-latex.py b/stepmake/bin/ls-latex.py deleted file mode 100644 index 3c97ed9791..0000000000 --- a/stepmake/bin/ls-latex.py +++ /dev/null @@ -1,212 +0,0 @@ -#!@PYTHON@ - -# name isn't really appropriate now ... - -name = 'ls-latex' -version = '0.1' - -import sys -import os -import string -import __main__ -import glob -import re - -format_names = {'ps.gz': 'Compressed PostScript', - 'html' : 'HTML' - } - -def gulp_file(f): - try: - i = open(f) - i.seek (0, 2) - n = i.tell () - i.seek (0,0) - except: - sys.stderr.write ("can't open file: %s\n" % f) - return '' - s = i.read (n) - if len (s) <= 0: - sys.stderr.write ("gulped empty file: %s\n" % f) - i.close () - return s - -class Latex_head: - def __init__ (self): - self.author = '' - self.title = '' - self.date = '' - self.format = '' - -def read_latex_header (s): - header = Latex_head() - m = re.search(r'\\author{([^}]+)}', s) - if m: - header.author = m.group (1) - - m = re.search (r'\\title{([^}]+)}',s ) - if m: - header.title = m.group (1) - - header.formats = ['ps.gz'] - return header - - -def read_bib_header (s): - m = re.search ('% *AUTHOR *= *(.*)\n',s) - - header = Latex_head() - - if m: - header.author = m.group (1) - - m = re.search ('% *TITLE *= *(.*)\n',s ) - if m: - header.title = m.group (1) - - header.formats = ['html'] - return header - - -def read_pod_header (s): - header = Latex_head () - - i = re.search( '[^\n \t]', s) - s = s[i:] - i = re.search( '\n\n', s) - s = s[i+2:] - i = re.search( '\n\n', s) - header.title = s[:i] - - header.formats = ['html'] - return header - -def read_texinfo_header (s): - header = Latex_head () - - m = re.search( '@settitle (.*)\n', s) - if m: - header.title = m.group (1) - m = re.search( '@author (.*)\n', s) - if m: - header.author = m.group (1) - - header.formats = ['html', 'ps.gz'] - return header - -# urg -# should make a 'next_parens ' -yo_article_re = re.compile ('article(\\([^)]*\\))[ \t\n]*(\\([^)]*\\))') -yo_report_re = re.compile ('report(\\([^)]*\\))[\t\n ]*(\\([^)]*\\))') -yo_sect_re = re.compile ('sect(\\([^)]*\\))') -yo_chapter_re = re.compile ('chapter(\\([^)]*\\))') - -def read_yodl_header (s): - header = Latex_head () - report = yo_report_re.search (s) - article = 0 - sect = 0 - chapter = 0 - if report: - header.author = report.group (2) - header.title = yo_report_re.group (1) - else: - article = yo_article_re.search (s) - if article: - header.author = article.group (2) - header.title = article.group (1) - else: - chapter = yo_chapter_re.search (s) - if chapter: - header.title = chapter.group (1) - else: - sect = yo_sect_re.search (s) - if sect: - header.title = sect.group (1) - - header.formats = ['html'] - return header - - -def print_html_head (l,o,h): - pre =o - - fn = pre + h.basename - - t = h.filename - if h.title : - t = t + ': '+ h.title - - l.write ('
  • %s ' % t) - - if h.author: - l.write ('

    by %s

    ' % h.author) - - for f in h.formats: - l.write ('(%s)' % (fn, f, format_names [f])) - l.write ('
  • \n') - -def help (): - sys.stdout.write (r"""Usage: ls-latex [OPTIONS]... FILE... -Generate html index file for FILE... - -Options: --h, --help print this help -""") - sys.exit (0) - -import getopt - -(options, files) = getopt.getopt(sys.argv[1:], - 'e:h', ['help', 'prefix=', 'title=']) - -tex = '' -output ='' -pre = '' -title = '' -for opt in options: - o = opt[0] - a = opt[1] - if o == '--prefix': - pre = a - elif o == '--title': - title = a - elif o == '-h' or o == '--help': - help () - - -l = sys.stdout - -l.write (r"""%s - -

    %s

    ') - diff --git a/stepmake/bin/package-zet.sh b/stepmake/bin/package-zet.sh deleted file mode 100755 index 4f0b79e620..0000000000 --- a/stepmake/bin/package-zet.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# package-zet.sh --- help configure a StepMake package's sourcetree -# normally invoked by a script like: -# -# zet-pack.sh ( e.g.: ". bin/zet-lily.sh") -# -PACKAGE=`echo $PACKAGE_NAME | tr '[a-z]' '[A-Z]'` -package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` -# -# You should set ${PACKAGE}_SOURCEDIR to the latest unpacked source dir, -# it will default to: -# -# $sources/$package (e.g.: LILYPOND_SOURCEDIR=/home/fred/usr/src/lilypond) -# - - -PACKAGE_SOURCEDIR=`eval echo '\$'${PACKAGE}_SOURCEDIR` -if [ "x$PACKAGE_SOURCEDIR" = "x" ]; then - eval ${PACKAGE}_SOURCEDIR="$prefix/src/$package" - export ${PACKAGE}_SOURCEDIR - PACKAGE_SOURCEDIR=`eval echo '\$'${PACKAGE}_SOURCEDIR` -fi -# -# and create links to here, if necessary -# -sourcetree=`basename \`pwd\`` -if [ "x$sourcetree" != "x$package" ]; then - (cd ..; rm -f $package 2>&1 > /dev/null) - (cd ..; ln -s $sourcetree $package) -fi -# -if [ ! -r $sources ]; then - (cd ..; ln -s `pwd` $sources) -fi -# -mkdir -p $prefix/bin -result=`echo $PATH | grep "$HOME/usr/bin"` -if [ "x$result" = "x" ]; then - PATH=$PATH:$HOME/usr/bin -fi -result=`echo $PATH | grep "$sources/$package/bin"` -if [ "x$result" = "x" ]; then - PATH=$PATH:$sources/$package/bin -fi diff --git a/stepmake/bin/package-zip.sh b/stepmake/bin/package-zip.sh deleted file mode 100644 index e325688fdd..0000000000 --- a/stepmake/bin/package-zip.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# package-zip.sh --- make a windoze distribution - -set -x - -if [ $# -lt 2 ]; then - echo "Usage: package-zip.sh PACKAGE_SOURCEDIR FILE..." - exit 2 -fi - -topdir=$1 -shift -. $topdir/VERSION - -VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL -if [ "x$MY_PATCH_LEVEL" != "x" ]; then - VERSION=$VERSION.$MY_PATCH_LEVEL -fi - -package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` -name=$package-$VERSION -ZIP="zip -r -9" -builddir="/tmp/$package-doos" - -{ cd $topdir/..; PACKAGE_ROOTDIR=`pwd`; export PACKAGE_ROOTDIR; } - -zip="$PACKAGE_ROOTDIR/doos/zip/$name.exe.zip" - - -if [ ! -e $PACKAGE_ROOTDIR/doos/zip ]; then - doo mkdir -p $PACKAGE_ROOTDIR/doos/zip -fi - -set -x - -cd $PACKAGE_ROOTDIR/doos || exit 1 - -rm -rf $package-* - -tar xzf $PACKAGE_ROOTDIR/releases/$name.tar.gz || exit 1 -cd $name - -export PATH=/usr/doos/bin:$PATH -./configure --host=i386-pc-linux --target=i386-pc-cygwin32 --prefix=/usr --enable-debugging --enable-printing --enable-checking - -make -make -C Documentation info || true -rm -rf $builddir -make prefix="$builddir/usr" DOTEXE=.exe install -make prefix="$builddir/usr" installextradoc - -rm -f $zip -(cd $builddir; $ZIP $zip $*) -# urg -true "Wrote: $zip" - -# huh? -# ln out/$name.exe.zip $zip - diff --git a/stepmake/bin/package-zip32.sh b/stepmake/bin/package-zip32.sh deleted file mode 100644 index 75039f9504..0000000000 --- a/stepmake/bin/package-zip32.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/sh -# package-zip32.sh --- make a windoze formated distribution - -set -x - -if [ $# -lt 1 ]; then - echo "Usage: $0 PACKAGE_SOURCEDIR" - exit 2 -fi - -srcdir=$1 -shift - -. $srcdir/VERSION - -VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL -if [ "x$MY_PATCH_LEVEL" != "x" ]; then - VERSION=$VERSION.$MY_PATCH_LEVEL -fi - -package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'` -name=$package-$VERSION -ZIP_CMD="zip -r -9" - -here=`pwd` -cd $srcdir/.. -PACKAGE_ROOTDIR=`pwd` -export PACKAGE_ROOTDIR -cd $here - -RELEASE_DIR="$PACKAGE_ROOTDIR/bin.releases/winnt" -ZIP_FILE="$RELEASE_DIR/$name.bin.zip" - - -if [ ! -e $RELEASE_DIR ]; then - mkdir -p $RELEASE_DIR -fi - -distdir=/tmp/${name} - -# -# Maybe we can get away without reconfiguring -# -# rm -f ${srcdir}/config.cache -# PYTHON=${PYTHON:-python} ${srcdir}/configure --prefix=${distdir} \ -# --srcdir=${srcdir} - -if ! make ; then - echo "make failed" - exit 1 -fi - -# failure allowed -#make -C Documentation info - -if ! make install ; then - echo "make install failed" - exit 1 -fi - -#if ! make -C Documentation/man WWW ; then -# echo "make -C documentation/man WWW failed" -# exit 1 -#fi - -if ! make -C Documentation/ntweb WWW ; then - echo "make -C documentation/ntweb WWW failed" - exit 1 -fi - -# -# Post install clean up -# -CYGWIN_LIB=$PACKAGE_ROOTDIR/distfiles/winnt/cygwin1.dll -if [ ! -e $CYGWIN_LIB ]; then - echo "Unable to locate $CYGWIN_LIB" - exit 1 -fi - -# -# copy cygwin lib into bin -# -cp $CYGWIN_LIB $distdir/bin - -ASH_EXE=$PACKAGE_ROOTDIR/distfiles/winnt/ash.exe -if [ ! -e $ASH_EXE ]; then - echo "Unable to locate $ASH_EXE" - exit 1 -fi - -# -# copy ash into bin -# -cp $ASH_EXE $distdir/bin - -GUILE_SCM=$PACKAGE_ROOTDIR/distfiles/winnt/ice-9 -if [ ! -e $GUILE_SCM ]; then - echo "Unable to locate $GUILE_SCM" - exit 1 -fi - -# -# copy guile init files into share/lilypond -# -echo "copy $GUILE_SCM to $distdir/share/lilypond" -cp -r $GUILE_SCM $distdir/share/lilypond - -# -# Rename python files to .py -# -mv $distdir/bin/lilypond $distdir/bin/lilypond.py -mv $distdir/bin/convert-mudela $distdir/bin/convert-mudela.py -mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py - -# -# copy man documentation to doc directory -# -#mkdir $distdir/doc -#cp Documentation/man/out/*.html $distdir/doc - -# -# copy web documentation to web directory -# -mkdir $distdir/web -for i in index.html guile-1.3.4-gnu-windows.patch angels.ly -do - cp Documentation/ntweb/out/$i $distdir/web || exit 1 -done - -# -# Zip it up -# -cd $distdir/.. -$ZIP_CMD $ZIP_FILE $name -echo "Wrote $ZIP_FILE" -rm -rf $name -exit 0 - - diff --git a/stepmake/bin/packagepython.py b/stepmake/bin/packagepython.py deleted file mode 100755 index 51a0d8af0e..0000000000 --- a/stepmake/bin/packagepython.py +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/python - - -#ugh. junkme. - -# packagepython.py -- implement general StepMake-wide python stuff -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997--2006 Han-Wen Nienhuys -# Jan Nieuwenhuizen - -import re -import string - -import sys -import os -import getopt - -make_assign_re = re.compile ('^([A-Z_]*)=(.*)$') - -def read_makefile (fn): - file = open (fn) - lines = file.readlines() - - mi = pa = mj = 0 - mp = '' - - make_dict = {} - for l in lines: - m = make_assign_re.search (l) - if m: - nm = m.group (1) - val = m.group (2) - make_dict[nm] = val - return make_dict - -class Package: - def __init__ (self, dirname): - dict = read_makefile (dirname + '/VERSION') - version_list = [] - for x in [ 'MAJOR_VERSION', 'MINOR_VERSION', 'PATCH_LEVEL']: - version_list.append (string.atoi (dict[x])) - version_list.append (dict['MY_PATCH_LEVEL']) - self.topdir = dirname - self.groupdir = self.topdir + '/..' - self.patch_dir = self.groupdir + '/patches/' - self.release_dir = self.groupdir + '/releases/' - self.test_dir = self.groupdir + '/test/' - self.version = tuple(version_list) - self.Name = dict['PACKAGE_NAME'] - self.name = string.lower (self.Name) - if self.name == 'lilypond': - self.nickname = 'lelie' - else: - self.nickname = self.name - self.NAME = string.upper (self.Name) - - -class Packager: - def __init__ (self): - try: - m= os.environ['MAILADDRESS'] - except KeyError: - m= '(address unknown)' - self.mail= m - try: - m= os.environ['WEBMASTER'] - except KeyError: - m= self.mail - self.webmaster= m - - -def full_version_tup(tup): - t = [0,0,0,''] - for i in range (4): - try: - t[i] = tup[i] - except IndexError: - break - return tuple(t) - -def split_my_patchlevel (str): - m = re.match ('(.*?)([0-9]*)$', str) - return (m.group (1), string.atoi (m.group (2))) - -def next_version(tup): - l = list(full_version_tup (tup)) - t3name=t3num='' - if l[3]: - (t3name,t3num)= split_my_patchlevel (l[3]) - if t3num: - t3num = '%d' % (t3num + 1) - else: - t3num = t3name ='' - else: - l[2] = l[2] +1 - - return tuple(l[0:3] + [t3name + t3num]) - -def prev_version(tup): - l = list(full_version_tup (tup)) - t3name=t3num='' - if l[3]: - (t3name, t3num) = split_my_patchlevel (l[3]) - if t3num and t3num - 1 > 0: - t3num = '%d' %(t3num - 1) - else: - t3num = t3name ='' - - else: - l[2] = l[2] -1 - - return tuple(l[0:3] + [t3name + t3num]) - -def version_tuple_to_str(tup): - tup = full_version_tup (tup) - if tup[3]: - my = '.' + tup[3] - else: - my = '' - return ('%d.%d.%d' % tup[0:3]) + my - -def version_str_to_tuple(str): - t = string.split(str, '.') - mypatch = '' - if len (t) >= 4: - mypatch = string.join (t[3:], '.') - return (string.atoi(t[0]), string.atoi(t[1]), string.atoi(t[2]), mypatch) - -def version_compare (ltup, rtup): - rtup = full_version_tup (ltup) - rtup = full_version_tup (rtup) - for i in (0,1,2): - if ltup[i] - rtup[i]: return ltup[i] - rtup[i] - if ltup[3] and rtup[3]: - (lname, lnum) = split_my_patchlevel (ltup[i]) - (rname, rnum) = split_my_patchlevel (rtup[3]) - if lname != rname: - raise 'ambiguous' - return sign (lnum - rnum) - if ltup[3]: - return 1 - else: - return -1 - -if __name__ == '__main__': - p = Package ('.') - v= p.version - print v, prev_version(v), next_version(v) - pv=(0,1,1,'jcn4') - print version_tuple_to_str(pv), prev_version(pv), next_version(pv) - print version_tuple_to_str((0,1,1,'')) - print full_version_tup ((0,1)) - - -def dump_file(f, s): - i = open(f, 'w') - i.write(s) - i.close () - diff --git a/stepmake/bin/release.py b/stepmake/bin/release.py deleted file mode 100755 index 90703a2597..0000000000 --- a/stepmake/bin/release.py +++ /dev/null @@ -1,103 +0,0 @@ -#!@PYTHON@ -# release.py - -import os -import packagepython -import getopt -import string -import sys -import time - -(options, files) = getopt.getopt (sys.argv[1:], 'ho:p:', - ['help', 'outdir=', 'package=']) - -def help (): - sys.stdout.write (r"""Usage: release [OPTIONS]... -Make a tarball and patch. - -Options: - -o, --outdir=DIR specify where to leave patches - -h, --help print this help - -p, --package=DIR specify package""" -) - sys.exit (0) - - -topdir = '' -outdir = '.' - -for opt in options: - o = opt[0] - a = opt[1] - if o == '-h' or o == '--help': - help () - elif o == '-p' or o == '--package': - topdir = a - elif o == '--outdir' or o == '-o': - outdir = a - -sys.path.append (topdir + '/stepmake/bin') - -package = packagepython.Package (topdir) -os.chdir (package.topdir) - -release_version = packagepython.version_tuple_to_str (package.version) -basename = string.join ((package.name, release_version), '-') -tarball = basename + '.tar.gz' -out_tarfile = os.path.join (outdir, tarball) -release_tarfile = os.path.join (package.release_dir, tarball) - -if os.path.exists (out_tarfile): - os.unlink (out_tarfile) - -changelog_name = os.path.join (topdir, 'ChangeLog') -lines = open (changelog_name).readlines () -release_marker = '\t* VERSION: %(release_version)s' % vars () -if not package.version[3] \ - and lines[2][0:len (release_marker) - 1] != release_marker: - sys.stderr.write ("warning: ChangeLog: adding VERSION: %s\n" \ - % release_version) - user_changelog_entry = time.strftime ('%Y-%m-%d') \ - + ' ' + os.environ['EMAIL'] - changelog = open (changelog_name, 'w') - changelog.write (user_changelog_entry) - changelog.write ('\n\n') - changelog.write (release_marker) - changelog.write ('\n\n') - changelog.writelines (lines) - changelog.close () - -status = os.system ('make dist') -if status: - raise 'make dist failed' - -if os.path.exists (release_tarfile): - os.unlink (release_tarfile) - -os.link (out_tarfile, release_tarfile) - -diff_py = package.topdir + '/stepmake/bin/package-diff.py' -diff_py_options = '--outdir=%(outdir)s --package=%(topdir)s' % vars () -status = os.system (string.join ((sys.executable, diff_py, diff_py_options))) -if status: - raise 'make diff failed' - -previous_tuple = packagepython.prev_version (package.version) -previous_version = packagepython.version_tuple_to_str (previous_tuple) - -diff_base = string.join ((package.name, previous_version, release_version), - '-') -diff_name = diff_base + '.diff.gz' - -out_diff = os.path.join (outdir, diff_name) -release_diff = os.path.join (package.patch_dir, diff_name) - -if not os.path.exists (out_diff): - sys.stderr.write ("error: cannot open: %s\n" % out_diff) - sys.exit (1) - -if os.path.exists (release_diff): - os.unlink (release_diff) - -os.link (out_diff, release_diff) - diff --git a/stepmake/bin/stepdirs.sh b/stepmake/bin/stepdirs.sh deleted file mode 100755 index fbda8e9b3c..0000000000 --- a/stepmake/bin/stepdirs.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# stepdirs.sh - -help () { - echo "Usage: stepmake/bin/stepdirs.sh" -} - -if [ $# -ne 0 ]; then - help - exit 2 -fi - -if [ ! -r stepmake ]; then - help - exit 2 -fi - -if [ -r VERSION ]; then - . ./VERSION - if [ "x$PACKAGE_NAME" = "xStepMake" ]; then - help - exit 2 - fi -fi - -dirs="RedHat doos patches releases test" - -echo -n "Checking StepMake layout..." -for i in $dirs; do - if [ ! -r ../$i ]; then - missing="$missing ../$i" - fi -done - -if [ "x$missing" = "x" ]; then - echo ok - exit 0 -fi - -echo - -echo "Creating missing directories:" -for i in $missing; do - (set -x; mkdir $i) -done - -echo done -- 2.39.5