Collect together utilities for maintenance - EXPORTS.ALL WHEREIS.HASH etc
This commit is contained in:
parent
64b2a4978a
commit
6b5817a279
1
lispusers/MEDLEY-FIX-DIRS
Normal file
1
lispusers/MEDLEY-FIX-DIRS
Normal file
@ -0,0 +1 @@
|
||||
(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "INTERLISP")
(FILECREATED "16-Jan-2021 22:07:03" |{DSK}<home>larry>ilisp>medley>lispusers>MEDLEY-FIX-DIRS.;8| 3195
|changes| |to:| (FNS MEDLEY-FIX-DIRS MAKE-WHEREIS-HASH FIX-MEDLEY-LINKS)
(VARS MEDLEY-FIX-DIRSCOMS)
|previous| |date:| "16-Jan-2021 00:39:09"
|{DSK}<home>larry>ilisp>medley>lispusers>MEDLEY-FIX-DIRS.;5|)
(PRETTYCOMPRINT MEDLEY-FIX-DIRSCOMS)
(RPAQQ MEDLEY-FIX-DIRSCOMS ((FNS FIX-MEDLEY-LINKS MEDLEY-FIX-DIRS)
(VARS MEDLEY-FIX-DIRS)
(FILES COMPAREDIRECTORIES WHERE-IS)
(FNS MAKE-EXPORTS-ALL MAKE-WHEREIS-HASH)))
(DEFINEQ
(FIX-MEDLEY-LINKS
(LAMBDA NIL (* \; "Edited 16-Jan-2021 21:27 by larry")
(|ShellCommand| "scripts/fixlinks")
(|ShellCommand| "/bin/sh /tmp/doit")))
(MEDLEY-FIX-DIRS
(LAMBDA NIL (* \; "Edited 4-Jan-2021 15:42 by larry")
(|for| X |in| MEDLEY-FIX-DIRS |join| (FIX-DIRECTORY-DATES (MEDLEYDIR (PRINT X T))))))
)
(RPAQQ MEDLEY-FIX-DIRS ("sources" "library" "lispusers" "internal/library" "greetfiles"
"docs>Documentation Tools" "cltl2" "clos" "makesysout"))
(FILESLOAD COMPAREDIRECTORIES WHERE-IS)
(DEFINEQ
(MAKE-EXPORTS-ALL
(LAMBDA NIL (* \; "Edited 15-Jan-2021 13:57 by larry")
(* "Edited May 3, 2018 by Ron Kaplan--relative to MEDLEYDIR/lispcore/. Don't know why it does the CORE/RENAME")
(*
"Edited Aug 17 94 by Sybalsky -- point it to /king/export/lispcore as the truth directory.")
(*
"Edited July 5, 1990 by Sybalsky -- point it to Pele as the truth directory.")
(*
"Edited September 29, 1986 by van Melle")
(CNDIR (MEDLEYDIR "sources"))
(LOAD 'FILESETS)
(RENAMEFILE (GATHEREXPORTS EXPORTFILES '{CORE}EXPORTS.ALL)
(MEDLEYDIR "libary" "EXPORTS.ALL" T))))
(MAKE-WHEREIS-HASH
(LAMBDA NIL (* \; "Edited 16-Jan-2021 22:04 by larry")
(LET ((FILING.ENUMERATION.DEPTH 1)
HASHFILE)
(DRIBBLE (MEDLEYDIR "loadups" "WHEREIS.HASH.DRIBBLE" T))
(SETQ HASHFILE (XCL::WHERE-IS-NOTICE (MEDLEYDIR "loadups" "XWHEREIS.HASH" T)
:FILES
(|for| X |in| MEDLEY-FIX-DIRS |collect|
(CONCAT (MEDLEYDIR X)
"*.;"))
:NEW T))
(RENAMEFILE HASHFILE (MEDLEYDIR "loadups" "WHEREIS.HASH" T))
(DRIBBLE))))
)
(DECLARE\: DONTCOPY
(FILEMAP (NIL (720 1170 (FIX-MEDLEY-LINKS 730 . 939) (MEDLEY-FIX-DIRS 941 . 1168)) (1397 3172 (
MAKE-EXPORTS-ALL 1407 . 2402) (MAKE-WHEREIS-HASH 2404 . 3170)))))
STOP
|
||||
BIN
lispusers/MEDLEY-FIX-DIRS.LCOM
Normal file
BIN
lispusers/MEDLEY-FIX-DIRS.LCOM
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
loadups/WHEREIS.HASH.DRIBBLE
Normal file
1
loadups/WHEREIS.HASH.DRIBBLE
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
scripts/fixlinks
Executable file
7
scripts/fixlinks
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# first find the files, calculate hash, sort by version then by hash+name excluding version
|
||||
find . -type f -print0 | xargs -0 -n200 shasum | sort -t '~' --key=2,2n | sort -s -t '~' --key=1,1 >/tmp/medleyfiles
|
||||
|
||||
# now process the file list into the commands to fix up the links
|
||||
awk -f scripts/fixlinks.awk /tmp/medleyfiles >/tmp/doit
|
||||
9
scripts/fixlinks.awk
Executable file
9
scripts/fixlinks.awk
Executable file
@ -0,0 +1,9 @@
|
||||
BEGIN {hash="0"; gc = 0;}
|
||||
function processgroup(group, gc) {
|
||||
printf("# processing group of %d files -- ",gc);
|
||||
for (i=1; i <= gc; i++) printf("'%s' ",group[i]);
|
||||
printf("\n");
|
||||
printf("rm '%s' && ln '%s' '%s'\n", group[gc],group[1], group[gc]);
|
||||
}
|
||||
hash == $1 && 1 == index($2, group[1]) {gc = gc + 1; group[gc] = $2; }
|
||||
hash != $1 || 1 != index($2, group[1]) { if (gc > 1) processgroup(group, gc); delete group; hash = $1; gc = 1; group[gc] = $2;}
|
||||
Loading…
x
Reference in New Issue
Block a user