summaryrefslogtreecommitdiffstats
path: root/usr.bin/sgmlfmt/sgmlfmt.pl
diff options
context:
space:
mode:
authorjfieber <jfieber@FreeBSD.org>1996-09-29 17:34:05 +0000
committerjfieber <jfieber@FreeBSD.org>1996-09-29 17:34:05 +0000
commit20976a339124b3996073f1e5df6712d053fe0bb0 (patch)
tree7770ec7d994ec4eba354df715b5136492d8f6a5e /usr.bin/sgmlfmt/sgmlfmt.pl
parentb67c1c3e27ae58ea4759b339c9149bf1e1752d8c (diff)
downloadFreeBSD-src-20976a339124b3996073f1e5df6712d053fe0bb0.zip
FreeBSD-src-20976a339124b3996073f1e5df6712d053fe0bb0.tar.gz
Change the behavior of the -links option. Instead of actually
creating a symbolic link from foo.html (from <label name="foo">) to the numbered file, a shell script is built that can be used to make the links at a later time (read: after installation in the target directory).
Diffstat (limited to 'usr.bin/sgmlfmt/sgmlfmt.pl')
-rwxr-xr-xusr.bin/sgmlfmt/sgmlfmt.pl21
1 files changed, 8 insertions, 13 deletions
diff --git a/usr.bin/sgmlfmt/sgmlfmt.pl b/usr.bin/sgmlfmt/sgmlfmt.pl
index f5bcea0..4ae1514 100755
--- a/usr.bin/sgmlfmt/sgmlfmt.pl
+++ b/usr.bin/sgmlfmt/sgmlfmt.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: sgmlfmt.pl,v 1.11 1996/09/08 20:40:52 jfieber Exp $
+# $Id: sgmlfmt.pl,v 1.12 1996/09/09 14:15:28 jfieber Exp $
# Copyright (C) 1996
# John R. Fieber. All rights reserved.
@@ -597,7 +597,8 @@ sub navbar {
# extlink
#
-# creates a symbolic link from the name in a reference to the numbered
+# Build a shell script to create symbolic links from the name in
+# a reference to the numbered
# html file. Since the file number that any given section has is
# subject to change as the document goes through revisions, this allows
# for a fixed target that separate documents can hook into.
@@ -613,18 +614,12 @@ sub extlink {
$file = "$ref.html";
- if (-e $file) {
- if (-l $file) {
- unlink($file);
- symlink($fn, $file);
- }
- else {
- print "Warning: $file exists and is not a symbolic link\n";
- }
- }
- else {
- symlink($fn, $file);
+ if (!fileno(LINKFILE)) {
+ print "Opening $fileroot.ln\n";
+ open(LINKFILE, ">${fileroot}.ln");
}
+
+ print LINKFILE "ln -fs $fn $file\n";
}
# Now, read the command line and take appropriate action
OpenPOWER on IntegriCloud