From 7bee587c7f6694e88a69ebaec66d7447b0e30b7b Mon Sep 17 00:00:00 2001 From: Patrice Clement Date: Tue, 8 Aug 2017 01:45:34 +0200 Subject: remove obsolete directory --- src/obsolete/bsfix/JXSLT.java | 141 -------------- src/obsolete/bsfix/Makefile | 36 ---- src/obsolete/bsfix/bsfix | 8 - src/obsolete/bsfix/bsfix-eclipse.py | 105 ---------- src/obsolete/bsfix/bsfix.py | 80 -------- src/obsolete/bsfix/build-xml-source-target.xslt | 28 --- src/obsolete/bsfix/rewrite2-speed-test.sh | 47 ----- src/obsolete/bsfix/tests/build.xml | 247 ------------------------ 8 files changed, 692 deletions(-) delete mode 100644 src/obsolete/bsfix/JXSLT.java delete mode 100644 src/obsolete/bsfix/Makefile delete mode 100755 src/obsolete/bsfix/bsfix delete mode 100755 src/obsolete/bsfix/bsfix-eclipse.py delete mode 100755 src/obsolete/bsfix/bsfix.py delete mode 100644 src/obsolete/bsfix/build-xml-source-target.xslt delete mode 100755 src/obsolete/bsfix/rewrite2-speed-test.sh delete mode 100644 src/obsolete/bsfix/tests/build.xml diff --git a/src/obsolete/bsfix/JXSLT.java b/src/obsolete/bsfix/JXSLT.java deleted file mode 100644 index 3b580f2..0000000 --- a/src/obsolete/bsfix/JXSLT.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2004, Jan Brinkmann - * Copyright (c) 2004, Karl Trygve Kalleberg - * Copyright (c) 2004, Thomas Matthijs - * Copyright (c) 2004, Gentoo Foundation - * - * Licensed under the GNU General Public License, v2 - * - */ - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; -import java.io.*; - -public class JXSLT -{ - public static void printHelp() - { - System.err - .println("Usage: java JXSLT ( -v || -s -t ) -x -i -o "); - } - - public static void main(String[] args) - { - // check if there are enough options given - if (args.length <= 8) - { - System.err.println("missing options"); - printHelp(); - System.exit(1); - } - - // detailed parsing of command line arguments - File oldXmlFile = null, newXmlFile = null, xsltFile = null; - String source = null, target = null; - int i = 0; - while (i < args.length) - { - boolean match = false; - String[] options = { - "-v", "--version", "-s", "--source", "-t", "--target", "-x", "--xsltsource", "-i", "--oldxml", "-o", "--newxml" - }; - - if (args[i].substring(0, 1).equals("-")) - { - if (args[i+1].substring(0, 1).equals("-")) { - System.err.println("missing argument for '"+args[i]+"'"); - printHelp(); - System.exit(1); - } - - int j = 0; - while (j < options.length) - { - if (options[j].equals(args[i])) - { - match = true; - break; - } - ++j; - } - - if (match != true) - { - System.err.println("invalid option '" + args[i] + "'"); - printHelp(); - System.exit(1); - } - } - - if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--version")) - { - target = source = args[i + 1]; - } else if (args[i].equalsIgnoreCase("-s") || args[i].equalsIgnoreCase("--source")) - { - source = args[i + 1]; - } else if (args[i].equalsIgnoreCase("-t") || args[i].equalsIgnoreCase("--target")) - { - target = args[i + 1]; - } else if (args[i].equalsIgnoreCase("-x") - || args[i].equalsIgnoreCase("--xsltsource")) - { - xsltFile = new File(args[i + 1]); - } else if (args[i].equalsIgnoreCase("-i") || args[i].equalsIgnoreCase("--oldxml")) - { - oldXmlFile = new File(args[i + 1]); - } else if (args[i].equalsIgnoreCase("-o") || args[i].equalsIgnoreCase("--newxml")) - { - newXmlFile = new File(args[i + 1]); - } - - ++i; - } - - // check if files exist - Source xmlSource = null, xsltSource = null; - if (oldXmlFile.exists()) - { - xmlSource = new StreamSource(oldXmlFile); - } else - { - System.out.println("xml sourcefile doesn't exist"); - System.exit(1); - } - - if (xsltFile.exists()) - { - xsltSource = new StreamSource(xsltFile); - } else - { - System.out.println("xslt sourcefile doesn't exist"); - System.exit(1); - } - Result result = new StreamResult(newXmlFile); - - // create a new transformer and perform a transformation - TransformerFactory transFact = TransformerFactory.newInstance(); - Transformer trans = null; - try - { - trans = transFact.newTransformer(xsltSource); - trans.setParameter("source", source); - trans.setParameter("target", target); - trans.transform(xmlSource, result); - System.out.println(oldXmlFile + " transformed to " + newXmlFile); - System.exit(0); - } catch (TransformerConfigurationException e) - { - e.printStackTrace(); - } catch (TransformerException e) - { - e.printStackTrace(); - } - } -} diff --git a/src/obsolete/bsfix/Makefile b/src/obsolete/bsfix/Makefile deleted file mode 100644 index 87b0e32..0000000 --- a/src/obsolete/bsfix/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2004 Karl Trygve Kalleberg -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/Makefile,v 1.4 2005/01/02 02:30:12 axxo Exp $ - -include ../../makedefs.mak - -all: - -dist: - mkdir -p ../../$(distdir)/src/bsfix - cp Makefile bsfix build-xml-source-target.xslt xml-rewrite.py xml-rewrite-2.py xml-rewrite-3.py class-version-verify.py ../../$(distdir)/src/bsfix - -install: all - install -m 0755 bsfix $(bindir)/ - install -d $(DESTDIR)/usr/share/javatoolkit/lib - install build-xml-source-target.xslt ${DESTDIR}/usr/share/javatoolkit/ - install -m 0755 xml-rewrite.py ${bindir}/ - install -m 0755 xml-rewrite-2.py ${bindir}/ - install -m 0755 xml-rewrite-3.py ${xmlrewritedir}/ - install -m 0755 class-version-verify.py ${bindir}/ - -testdir:=tests - -test: - # Dom based stuff - cat $(testdir)/build.xml | ./xml-rewrite-2.py -g > /dev/null - # Sax based stuff - cat $(testdir)/build.xml | ./xml-rewrite-2.py \ - --change -e javac -e xjavac -a classpath -v '$${gentoo.classpath}' | grep gentoo.classpath > /dev/null - cp $(testdir)/build.xml $(testdir)/test.xml - ./xml-rewrite-2.py -f $(testdir)/test.xml \ - --change -e javac -e xjavac -a classpath -v '$${gentoo.classpath}' - grep gentoo.classpath $(testdir)/test.xml > /dev/null - rm $(testdir)/test.xml diff --git a/src/obsolete/bsfix/bsfix b/src/obsolete/bsfix/bsfix deleted file mode 100755 index 7d7dc79..0000000 --- a/src/obsolete/bsfix/bsfix +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash -# -# Copyright (c) 2004, Karl Trygve Kalleberg -# Copyright (c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 - -java -cp /usr/share/javatoolkit/lib/ JXSLT $@ diff --git a/src/obsolete/bsfix/bsfix-eclipse.py b/src/obsolete/bsfix/bsfix-eclipse.py deleted file mode 100755 index 3109b7d..0000000 --- a/src/obsolete/bsfix/bsfix-eclipse.py +++ /dev/null @@ -1,105 +0,0 @@ -#! /usr/bin/python2 -# -# Copyright(c) 2004, Karl Trygve Kalleberg -# Copyright(c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 -# -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/bsfix-eclipse.py,v 1.1 2004/12/20 19:13:05 karltk Exp $ - -# -# Usage: -# -# bsfix-eclipse --prefix /usr/lib/eclipse-3 --versions 3.0.0,3.0.1 --varnames eclipse_classpath build.properties -# - -import os -import re -import sys -import optparse - -import javatoolkit.parser as parser -from javatoolkit.classpath import Classpath - -from javatoolkit import die - -__author__ = "Karl Trygve Kalleberg " -__version__ = "0.1.0" -__productname__ = "bsfix-eclipse" -__description__ = "Gentoo Eclipse Build Script Fixer" - -def find_best_version(path, vers): - for ver in vers: - x = re.sub("[0-9].[0-9].[0-9]", ver, path) - if os.path.exists(x): - return ver - return None - -def resolve_version(doc, var, versions, prefix): - - node = doc.find_node(var) - oldcp = Classpath(parser.expand(doc, node.value)) - newcp = Classpath() - - for i in range(len(oldcp)): - entry = oldcp[i] - if entry.startswith(prefix): - ver = find_best_version(entry, versions) - if ver is None: - die(2, "Failed to resolve " + entry) - - substed_entry = re.sub("[0-9].[0-9].[0-9]", ver, entry) - newcp.append(substed_entry) - else: - newcp.append(entry) - - node.value = str(newcp) - return node - -""" -Print program version to stdout. -""" -def print_version(): - print __productname__ + "(" + __version__ + ") - " + \ - __description__ - print "Author(s): " + __author__ - -""" -Parse command line arguments -""" -def parse_args(): - - parser = optparse.OptionParser(version="%prog " + __version__ ) - - parser.add_option("-p", "--prefix-path", dest="prefix_path", - default="", help="path of Eclipse installation") - - parser.add_option("-a", "--allowed-versions", dest="versions", - default=".", help="versions to check for (comma separated)") - - parser.add_option("-n", "--varnames", dest="varnames", - default=".", help="attribute names to be considered as classpaths (comma separated)") - - (opts, args) = parser.parse_args() - opts.varnames = opts.varnames.split(",") - opts.versions = opts.versions.split(",") - - return (opts, args) - -def main(): - - (options, args) = parse_args() - - for arg in args: - - doc = parser.buildproperties.parse(open(arg)) - if doc == None: - raise "File not readable, '" + arg + "'" - - for var in options.varnames: - resolve_version(doc, var, options.versions, options.prefix_path) - - doc.dump() - -if __name__ == "__main__": - main() diff --git a/src/obsolete/bsfix/bsfix.py b/src/obsolete/bsfix/bsfix.py deleted file mode 100755 index 9aafe7d..0000000 --- a/src/obsolete/bsfix/bsfix.py +++ /dev/null @@ -1,80 +0,0 @@ -#! /usr/bin/python2 -# -# Copyright(c) 2004, Karl Trygve Kalleberg -# Copyright(c) 2004, Gentoo Foundation -# -# Licensed under the GNU General Public License, v2 -# -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/bsfix.py,v 1.1 2004/12/20 19:13:05 karltk Exp $ - -import os -import re -import sys -import optparse - -import javatoolkit.parser as parser -from javatoolkit.classpath import Classpath - -def find_best_version(path, vers): - for ver in vers: - x = re.sub("[0-9].[0-9].[0-9]", ver, path) - if os.path.exists(x): - return ver - return None - -""" -Parse command line arguments. -""" -def parse_args(args): - - basedir = os.getcwd() - - parser = optparse.OptionParser(version="%prog " + __version__ ) - - parser.add_option("-a", "--attribute", dest="attribute", - default="", help="select this attribute") - - parser.add_option("-r", "--replace", dest="replace", - default=".", help="where to store the generated files") - - parser.add_option("-c", "--cache-file", dest="cachefile", - default=basedir + "/cache3.db", help="where to store the cache") - - parser.add_option("-m", "--manifest-file", dest="manifestfile", - default=basedir + "/manifest.synctool", help="where to store the manifest file") - - parser.add_option("-u", "--update-mode", dest="update_mode", - default="quick", help="update mode, either 'generate' or 'quick'") - - parser.add_option("-v", "--verbose", dest="verbosity", - default=3, help="verbosity") - - return parser.parse_args() - - -if __name__ == "__main__": - - infile = sys.argv[1] - r = parser.buildproperties.parse(open(infile)) - - alt_versions = sys.argv[2:] - - n = parser.find_node(r, "eclipse_classpath") - cp = Classpath(n.value) - - for i in range(len(cp)): - x = cp[i] - t = parser.expand(r, x) - if t.startswith("/usr/lib/eclipse-3"): - ver = find_best_version(t, alt_versions) - if ver is None: - print "Failed to resolve " + x - sys.exit(2) - - y = re.sub("[0-9].[0-9].[0-9]", ver, x) - cp[i] = y - - n.value = str(cp) - - r.dump() - diff --git a/src/obsolete/bsfix/build-xml-source-target.xslt b/src/obsolete/bsfix/build-xml-source-target.xslt deleted file mode 100644 index fd9bceb..0000000 --- a/src/obsolete/bsfix/build-xml-source-target.xslt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/obsolete/bsfix/rewrite2-speed-test.sh b/src/obsolete/bsfix/rewrite2-speed-test.sh deleted file mode 100755 index b572206..0000000 --- a/src/obsolete/bsfix/rewrite2-speed-test.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -files="" -JAVA_PKG_BSFIX_TARGET_TAGS=${JAVA_PKG_BSFIX_TARGET_TAGS:-"javac xjavac javac.preset"} -JAVA_PKG_BSFIX_SOURCE_TAGS=${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"} - -want_source="java-1.4" -want_target="java-1.5" - -NEWPATH="./" # TODO: CHANGEME -rpath="./xmls" # TODO: CHANGEME - -for i in $(ls $rpath/b*); -do - files=" $files -f $i" -done - -clean(){ - rm -rf $rpath - cp -rf $rpath.sav $rpath -} - -old() { - xml-rewrite-2.py ${files} \ - -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \ - -a source -v ${want_source} ${output} - xml-rewrite-2.py ${files} \ - -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \ - -a target -v ${want_target} ${output} -} - -new(){ - ${NEWPATH}/xml-rewrite-2.py ${files} \ - -c --source-element ${JAVA_PKG_BSFIX_SOURCE_TAGS// / --source_elements } \ - --source-attribute source --source-value ${want_source} \ - --target-element ${JAVA_PKG_BSFIX_TARGET_TAGS// / --target_elements} \ - --target-attribute target --target-value ${want_target} \ - ${output} -} - -clean -echo "_________________time old" -time old|grep -v "ewrit" - -clean -echo "_________________time new" -time new|grep -v "ewrit" - diff --git a/src/obsolete/bsfix/tests/build.xml b/src/obsolete/bsfix/tests/build.xml deleted file mode 100644 index e8a8aa5..0000000 --- a/src/obsolete/bsfix/tests/build.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-- cgit v1.2.3-65-gdbad