[Pkg-jed-commit] r198 - trunk/packages/jed-extra/utils

Guenter Milde milde-guest at costa.debian.org
Tue Nov 15 15:30:11 UTC 2005


Author: milde-guest
Date: 2005-11-15 15:30:09 +0000 (Tue, 15 Nov 2005)
New Revision: 198

Added:
   trunk/packages/jed-extra/utils/prepare-build.sh
Modified:
   trunk/packages/jed-extra/utils/sort-modes.sl
Log:
made sort-modes jed-script usable
added prepare-build.sh an experimental script to build the package


Added: trunk/packages/jed-extra/utils/prepare-build.sh
===================================================================
--- trunk/packages/jed-extra/utils/prepare-build.sh	2005-11-15 11:23:36 UTC (rev 197)
+++ trunk/packages/jed-extra/utils/prepare-build.sh	2005-11-15 15:30:09 UTC (rev 198)
@@ -0,0 +1,38 @@
+milde at horst:~/.jed/pkg-jed/trunk/packages/jed-extra/utils > milde at horst:~/.jed/pkg-jed/trunk/packages/jed-extra/utils > milde at horst:~/.jed/pkg-jed/trunk/packages/jed-extra/utils > #                          -*- ishell-mode -*-
+# this is an experimental script that helps me test-build jed-extra
+# (c) 2005 Guenter Milde
+
+# prepare an unpacked source tree with debian dir for package build
+VERSION=2.0
+
+cd `locate "*pkg-jed/trunk/packages/jed-extra"`
+
+debian/rules get-orig-source
+# Debian policy says:
+
+tar -xzf jed-extra_$VERSION.orig.tar.gz
+
+# rm -R jed-extra-$VERSION
+# mv mode jed-extra-$VERSION
+install --directory jed-extra-$VERSION
+cp -uRf mode/* jed-extra-$VERSION
+rm -Rf mode
+
+jed-script utils/sort-modes.sl
+
+cp -uRf debian jed-extra-$VERSION
+
+cd jed-extra-$VERSION/debian
+rm -Rf .svn
+rm -Rf */.svn
+
+
+#dpatch --strict apply-all --verbose
+
+debuild -us -uc
+
+
+
+
+
+

Modified: trunk/packages/jed-extra/utils/sort-modes.sl
===================================================================
--- trunk/packages/jed-extra/utils/sort-modes.sl	2005-11-15 11:23:36 UTC (rev 197)
+++ trunk/packages/jed-extra/utils/sort-modes.sl	2005-11-15 15:30:09 UTC (rev 198)
@@ -1,6 +1,8 @@
 % This script produces an jed-exrta.install list
 % that lets dh_install put the files in the right place
 % 
+% call from the directory that contains jed-extra-$VER/ and debian/
+% 
 % (c) 2005 Günter Milde
 % Released under the terms of the GNU General Public License 
 % (version 2 or later)
@@ -16,10 +18,13 @@
 private variable VER = "2.0";
 
 % the list of modes and their categories
-private variable modelist = "../debian/contents.txt";
+private variable modelist = "debian/contents.txt";
+private variable target_file = "debian/jed-extra.install";
 
-private variable orig_dir = "../jed-extra-" + VER;
-
+% orig-source
+private variable orig_dir = "jed-extra-" + VER;
+  
+  
 % dirs to sort into...
 private variable lib_dir = "usr/share/jed/jed-extra";
 private variable colors_dir = path_concat(lib_dir, "colors");
@@ -53,13 +58,10 @@
 % ----
 
 % Variables for internale use
-private variable cwd=getcwd(), rv, line, mode, file, dest, fp;
-private variable category, modes = Assoc_Type[String_Type, ""];
+private variable cwd=getcwd(), rv, line, mode, file,
+  dest, fp, category, modes = Assoc_Type[String_Type, ""];
 
 
-modelist = expand_filename(path_concat(buffer_dirname(), modelist));
-orig_dir = expand_filename(path_concat(buffer_dirname(), orig_dir));
-
 % read in modelist
 % ----------------
 
@@ -75,18 +77,16 @@
    % skip comments, empty lines, and continuations
    if (orelse{length(line) < 2 }{line[0] == "#"})
      continue;
-   % show(line[0], line[1]);
    modes[line[1]] = line[0];
 }
 
-% show(modes);
 
 rv = fclose(fp);
 
 % write an install file
 % ---------------------
 
-() = find_file(path_concat(buffer_dirname(), "../debian/jed-extra.install"));
+() = find_file(target_file);
 erase_buffer();
 
 % debian specific installation tasks
@@ -103,14 +103,14 @@
 
    if (andelse{category == ""}{file_status(path_concat(orig_dir, mode)) == 2})
      {
-        vshow("skipping: unknown '%s'", mode);
+        vmessage("skipping: unknown '%s'", mode);
         continue;
      }
    dest = destinations[category];
    if (dest == "")
      { 
         if (verbose)
-          vshow("skipping: %s '%s'", category, mode);
+          vmessage("skipping: %s '%s'", category, mode);
         continue;
      }
    % prepend the common part of the path
@@ -119,19 +119,16 @@
 
 save_buffer();
 
-show_string("Missing modes");
+message("Missing modes");
 
 % delete the ones we do not install
 foreach (assoc_get_keys(modes))
 {
    mode = ();
-   if (length(where(modes[mode] == ["X", "O"])))
-     assoc_delete_key(modes, mode);
+   !if (length(where(modes[mode] == ["X", "O"])))
+     vmessage("%s %s", mode, modes[mode]);
 }
 
-    
-show(modes);
-
 % reset the working dir
 rv = chdir(cwd);
 
@@ -150,7 +147,7 @@
 % Preparation
 % -----------
 
-rv = chdir(buffer_dirname());
+rv = chdir(dir);
 show(getcwd);
 % set up a working directory hierarchy
 
@@ -169,7 +166,7 @@
           rv = mkdir(path);
      }
    if (rv != 0)
-     vshow("error creating '%s', %s", path, errno_string());
+     vmessage("error creating '%s', %s", path, errno_string());
 }
 
 mk_build_dir("");  % create build_dir itself
@@ -188,14 +185,14 @@
    category = modes[mode];
    if (andelse{category == ""}{file_status(path_concat(orig_dir, mode)) == 2})
      {
-        vshow("skipping: unknown '%s'", mode);
+        vmessage("skipping: unknown '%s'", mode);
         continue;
      }
    dest = destinations[category];
    if (dest == "")
      { 
         if (verbose)
-          vshow("skipping: %s '%s'", category, mode);
+          vmessage("skipping: %s '%s'", category, mode);
         continue;
      }
    % prepend the common part of the path
@@ -204,7 +201,7 @@
    % 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());
+     vmessage("error copying '%s/*' to '%s', %s", mode, dest, errno_string());
    
    % OS independent SLang variant of sorting
    % foreach (listdir(mode))
@@ -216,11 +213,11 @@
    %      !if (file_status(dest))
    %        verror("dest %s missing %d", dest, file_status(dest));
    %      if (verbose)
-   %        vshow("copying %s", file);
+   %        vmessage("copying %s", file);
    %      rv = copy_file(file,
    %                     path_concat(dest, file));
    %      if (rv == 0)
-   %        vshow("error copying '%s' to '%s', %s", 
+   %        vmessage("error copying '%s' to '%s', %s", 
    %              file, dest, errno_string());
    %   }
 }




More information about the Pkg-jed-commit mailing list