[Pkg-jed-commit] r153 - in trunk/packages/jed-extra: . debian
Guenter Milde
milde-guest at costa.debian.org
Tue Nov 8 10:09:36 UTC 2005
Author: milde-guest
Date: 2005-11-08 10:09:36 +0000 (Tue, 08 Nov 2005)
New Revision: 153
Added:
trunk/packages/jed-extra/build-orig.tar_gz
Removed:
trunk/packages/jed-extra/debian/build-orig.tar_gz
Modified:
trunk/packages/jed-extra/debian/changelog
trunk/packages/jed-extra/debian/sort-modes.sl
Log:
moved build-orig.tar_gz
changelog update
sort-modes.sl sorts the mode files into a tmp dir:
Should we call this at build time,
or change it to prepare a files.install list and sort with
this list using dh_install?
Copied: trunk/packages/jed-extra/build-orig.tar_gz (from rev 122, trunk/packages/jed-extra/debian/build-orig.tar_gz)
Deleted: trunk/packages/jed-extra/debian/build-orig.tar_gz
===================================================================
--- trunk/packages/jed-extra/debian/build-orig.tar_gz 2005-11-08 10:03:55 UTC (rev 152)
+++ trunk/packages/jed-extra/debian/build-orig.tar_gz 2005-11-08 10:09:36 UTC (rev 153)
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ $# -eq 0 ]; then
- echo "usage: $(basename $0) version [cvs-date] (e.g. \"1.2 2005-07-08\")"
- exit 1
-fi
-
-VER=$1 # 1.2
-DATE=$2 # 2005-07-08
-
-# cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/jedmodes export \
-# ${DATE:+-D$DATE} mode
-cp -r ~/programmieren/mode/ .
-mv mode jed-extra-$VER
-
-cd jed-extra-$VER
-
-checker() { sed 1,/^[^%]/p $1 | grep -Eq 'GPL|GNU General Public License'; }
-no_gpl=
-for i in *; do
- [ -d $i ] || continue;
- if [ -f $i/$i.sl ]; then
- if ! checker $i/$i.sl; then
- case $i in
- bufed|calc|custmode|email|jedasp|keywords|sql|tar|temabbrv)
- echo "($i misses the gpl licence note)";;
- *) echo "$i not gpl"; no_gpl=1;;
- esac
- fi;
- else
- for j in $i/*.sl; do
- if ! checker $j; then
- echo "$j not gpl"
- no_gpl=1
- fi
- done
- fi
-done
-
-cd ..
-
-if [ -n "$no_gpl" ]; then
- echo
- echo "There is at least one file with unsettled copyright"
- printf "Continue [y/N] "
- read choise
- case "$choise" in
- y|Y) ;;
- *) exit 2;;
- esac
-fi
-
-tar -czf jed-extra_$VER.orig.tar.gz jed-extra-$VER
Modified: trunk/packages/jed-extra/debian/changelog
===================================================================
--- trunk/packages/jed-extra/debian/changelog 2005-11-08 10:03:55 UTC (rev 152)
+++ trunk/packages/jed-extra/debian/changelog 2005-11-08 10:09:36 UTC (rev 153)
@@ -3,14 +3,17 @@
NOT YET RELEASED!
CURRENTLY BROKEN!
+ new upstream release,
+ all modes should now work with SLang-2
+
+++ Changes by Guenter Milde <milde at users.sf.net>
- * new upstream source [changed build-orig.tar_gz]
- * updated copyright (source URI, removed explicit listing of authors)
+ * new upstream source URI
+ * updated copyright (source URI, author list, contact info)
* updated README.Debian (give customization instructions)
- * pooled initialization/customization in jed.d/50jed-extra.sl
+ * move all initialization/customization to jed.d/50jed-extra.sl
using libdir.sl for "registering" of library directories
- * changed location of jed-extra library dir to /usr/lib/jed-extra/
+ * changed location of jed-extra library dir to /usr/share/jed/jed-extra/
TODO:
+ rules to sort the upstream files into .../jed-extra/ and
Modified: trunk/packages/jed-extra/debian/sort-modes.sl
===================================================================
--- trunk/packages/jed-extra/debian/sort-modes.sl 2005-11-08 10:03:55 UTC (rev 152)
+++ trunk/packages/jed-extra/debian/sort-modes.sl 2005-11-08 10:09:36 UTC (rev 153)
@@ -1,63 +1,83 @@
% TODO?: slsh or jed-script shebang line
+_debug_info = 1;
+
% Semi-Constants
% --------------
%
% customize these ...
-
+
+% the list of modes and their categories
private variable modelist = "jedmodes-list.txt";
-private variable build_dir = "jed-extra-upstream";
-private variable tarname = build_dir;
-private variable lib_dir = "jed-extra-lib";
+
+private variable orig_dir = "jed-extra-1.2";
+
+% the dir to build the package. New Maintainer guide recomments tmp
+private variable build_dir = "tmp";
+%these will become subdirs of `build_dir'
+private variable lib_dir = "/usr/share/jed/jed-extra";
+private variable colors_dir = path_concat(lib_dir, "colors");
private variable drop_in_dir = path_concat(lib_dir, "drop-in");
+private variable verbose = 1;
+% Types
+% -----
+%
+% *A*ddition *C*olor *D*rop-In *E*nhancement
+% *O*bsolete *U*tils e*X*perimental (or e*X*otic)
+
private variable destinations = Assoc_Type[String_Type, ""];
destinations["A"] = lib_dir;
+destinations["C"] = colors_dir;
+destinations["D"] = drop_in_dir;
destinations["E"] = lib_dir;
destinations["U"] = lib_dir;
-destinations["D"] = drop_in_dir;
% Main
% ----
% Variables for internale use
-private variable cwd=getcwd(), rv, line, modedir, file, dest, fp;
+private variable cwd=getcwd(), rv, line, mode, file, dest, fp;
+private variable category, modes = Assoc_Type[String_Type, ""];
% Preparation
% -----------
-
rv = chdir(buffer_dirname());
+show(getcwd);
+% set up a working directory hierarchy
-% set up a working directory and change there
-rv = mkdir(build_dir);
-rv = chdir(build_dir);
-% the dirs to sort into
-rv = mkdir(lib_dir);
-rv = mkdir(drop_in_dir);
+% create a dir under build-dir, creating parent dirs on the fly (as `mkdir -p`)
+static define mk_build_dir(dir)
+{
+ variable d, path="";
+ % prepend the build dir and parse
+ dir = [build_dir, strtok(dir, "/")];
+ % show(dir);
+ foreach (dir)
+ {
+ d = ();
+ path = path_concat(path, d);
+ if (file_status(path) != 2)
+ rv = mkdir(path);
+ }
+ if (rv != 0)
+ vshow("error creating '%s', %s", path, errno_string());
+}
-% get the sources tar archive from Jedmodes
-% (better done in 'rules')
-# iffalse
-rv = system("wget http://jedmodes.sf.net/cvs/jedmodes.tgz")
-if (rv != 0)
- verror("could not get the upstream tar, %s", errno_string());
-# endif
+mk_build_dir(""); % create build_dir itself
+mk_build_dir(lib_dir);
+mk_build_dir(colors_dir);
+mk_build_dir(drop_in_dir);
-% unpack: this will create a directory mode/ in the build-dir
-rv = system("tar -xzf jedmodes.tgz");
-if (rv != 0)
- verror("could not unpack jedmodes.tgz, %s", errno_string());
-% Sorting
-% -------
+% read in modelist
+% ----------------
-% The source files are in subdirs of 'mode/' and should be sorted to
-% 'libdir' and 'drop_in_dir'.
% 'modelist' contains a list of modes at Jedmodes and their categorization.
-fp = fopen(path_concat("..", modelist), "r");
+fp = fopen(modelist, "r");
if (fp == NULL)
verror("fopen %s failed, %s", modelist, errno_string());
@@ -68,43 +88,62 @@
if (orelse{length(line) < 2 }{line[0] == "#"})
continue;
% show(line[0], line[1]);
- modedir = path_concat("mode", line[1]);
- dest = destinations[line[0]];
- if (dest == "")
- {
- vshow("skipping: %s ", strjoin(line, " "));
- continue;
- }
- % show(mode, dest);
- foreach (listdir(modedir))
- {
- file = ();
- rv = copy_file(path_concat(modedir, file),
- path_concat(dest, file));
- if (rv != 0)
- vshow("error copying '%s' to '%s', %s",
- path_concat(modedir, file), dest, errno_string());
- }
+ modes[line[1]] = line[0];
}
+% show(modes);
+
rv = fclose(fp);
-% pack and clean up
-% -----------------
+% Sorting
+% -------
-% (better be done in 'rules')
-#iffalse
-rv = system(sprintf("tar -czf %s.tar.gz %s", tarname, lib_dir));
-if (rv != 0)
- vshow("error packing %s, %s, %d", build_dir, errno_string(), rv);
+% The source files are in subdirs of 'jed-extra-$VER' and should be sorted to
+% 'libdir', colors_dir, and 'drop_in_dir'.
+foreach (listdir(orig_dir))
+{
+ mode = ();
+ category = modes[mode];
+ if (andelse{category == ""}{file_status(path_concat(orig_dir, mode)) == 2})
+ {
+ vshow("skipping: unknown '%s'", mode);
+ continue;
+ }
+ dest = destinations[category];
+ if (dest == "")
+ {
+ if (verbose)
+ vshow("skipping: %s '%s'", category, mode);
+ continue;
+ }
+ % prepend the common part of the path
+ mode = path_concat(orig_dir, mode);
+ dest = path_concat(build_dir, strtrim_beg(dest, "/"));
+ % show(mode, dest);
+ rv = system(sprintf("cp --backup %s/* %s", mode, dest));
+ if (rv == -1 or rv == 127)
+ vshow("error copying '%s/*' to '%s', %s", mode, dest, errno_string());
+
+ % OS independent SLang variant of sorting
+ % foreach (listdir(mode))
+ % {
+ % file = ();
+ % file = path_concat(mode, file);
+ % !if (file_status(file))
+ % verror("file %s missing %d", file, file_status(file));
+ % !if (file_status(dest))
+ % verror("dest %s missing %d", dest, file_status(dest));
+ % if (verbose)
+ % vshow("copying %s", file);
+ % rv = copy_file(file,
+ % path_concat(dest, file));
+ % if (rv == 0)
+ % vshow("error copying '%s' to '%s', %s",
+ % file, dest, errno_string());
+ % }
+}
-% (now pack the drop-in dir, if it is not a subdir of lib_dir)
-
-% clean up
-% remove "mode/", lib_dir and drop_in_dir
-#endif
-
% reset the working dir
rv = chdir(cwd);
More information about the Pkg-jed-commit
mailing list