[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compartmentalizing the 8.3 problem into the msdos directory

From: Paul Eggert
Subject: Compartmentalizing the 8.3 problem into the msdos directory
Date: Mon, 31 Jan 2011 01:29:18 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

[Renaming the thread from "Files from gnulib".]

On 01/28/2011 06:20 AM, Eli Zaretskii wrote:

> Then perhaps I don't understand your suggestion.  Could you describe
> it in its entirety, starting with how file-name clashes would be
> detected, how their alternative names would be determined, and how all
> this would work with make-dist and configuring and building the MS-DOS
> port?

Here's how it works.

File name clashes are detected by doschk, since that's reliable.

Alternative names are determined by a file msdos/fnchange.prs
that contains lines that look like this:

   semantic-utest-c.el     sem-ut-c.el
   semantic-utest.el       sem-ut.el

where the left column gives the original base name, and the right
column gives the base name as renamed under MS-DOS.

After make-dist creates the distribution tree, it calls a new script
msdos/fncheck.sh that does the MS-DOS-specific file name checking and
generation; make-dist fails if msdos/fncheck.sh fails.

msdos/fncheck.sh creates a file msdos/fnchange.lst that is suitable for
use by djtar to unpack the tarball on MS-DOS.  msdos/fncheck.sh
guarantees that djtar, when used with msdos/fnchange.lst, will not
generate any name clashes; so if there's a typo in fnchange.prs this
is caught at "make dist" time.

Once the files are unpacked on MS-DOS, the MS-DOS build procedure
first finds all instances of the left column in fnchange.prs in the
source code, and substitutes the right column.  Then it builds as usual.

The general outline is similar to what's done with GDB.  But the
improvement over GDB is that "make dist" checks for clashes reliably,
and this catches the usual glitches where people forget to update
fnchange.prs after creating clashing names.

Here's a draft implementation of all of the above (except that the
MS-DOS side is left as an exercise for the reader :-).  I haven't
committed this.

=== modified file 'make-dist'
--- make-dist   2011-01-31 08:12:52 +0000
+++ make-dist   2011-01-31 09:05:07 +0000
@@ -413,6 +413,7 @@
 echo "Making links to \`msdos'"
 (cd msdos
  ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos
+ ln fncheck.sh fnchange.prs ../${tempdir}/msdos
  ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos)
 echo "Making links to \`nextstep'"
@@ -525,6 +526,9 @@
 echo "Removing unwanted files"
 find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name 
'=*' -o -name 'TAGS' \) -exec rm -f {} \;
+echo "Making file map for MS-DOS"
+(cd ${tempdir} && msdos/fncheck.sh) || exit
 if [ "${make_tar}" = yes ]; then
   echo "Looking for $default_gzip"

# List of file base names that need to be renamed in MS-DOS due to its
# 8+3 limitations.  The second column is the base name under MS-DOS.
# The assumption is that each such file is renamed within its
# directory under MS-DOS, and that all directory names are OK.

org-complete.el         o-complete.el
org-complete.elc        o-complete.elc
semantic-ia-utest.el    sem-ia-utest.el
semantic-utest-c.el     sem-ut-c.el
semantic-utest.el       sem-ut.el
testsppreplaced.c       tpprplcd.c

msdos/fncheck.sh (this file should be executable)
#! /bin/sh

export LC_ALL=C

if (doschk) </dev/null >/dev/null 2>&1; then
  echo >&2 "$0: warning: doschk not installed; skipping MS-DOS checks"

<msdos/fnchange.prs || exit

find .??* * -print | sort | awk '
    while (0 < (getline <"msdos/fnchange.prs")) {
      if ($1 ~ /^[^#]/ && $2) renamed[$1] = $2
    file = $0
    basename = $file
    sub(/.*\//, "", basename)
    if (renamed[basename]) {
      renamed_file = file
      sub(/[^/]*$/, "", renamed_file)
      renamed_file = renamed_file renamed[basename]
      printf "@V@/%s @V@/%s\n", file, renamed_file > "msdos/fnchange.lst"
      print renamed_file
    } else {
      print file
' | $doschk | awk '
  /^The following files are not valid DOS file names:$/,  /^$/ { next }
  /^The following resolve to the same SysV file names:$/, /^$/ { next }
  /^The following file names are too long for SysV:$/,    /^$/ { next }
  { print; status = 1 }
  END { exit status }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]