Artifact
c42ba542bfaf7fab0faf06d4584a632837f817be7e2e1ee10d4e7a4d92efbbff:
Attachment "install_sh.diff" to
ticket [d3465c9188]
added by
stu
2022-08-03 22:23:53.
0000: 49 6e 64 65 78 3a 20 75 6e 69 78 2f 4d 61 6b 65 Index: unix/Make
0010: 66 69 6c 65 2e 69 6e 0a 3d 3d 3d 3d 3d 3d 3d 3d file.in.========
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0050: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 2d 2d 2d 20 75 ==========.--- u
0060: 6e 69 78 2f 4d 61 6b 65 66 69 6c 65 2e 69 6e 0a nix/Makefile.in.
0070: 2b 2b 2b 20 75 6e 69 78 2f 4d 61 6b 65 66 69 6c +++ unix/Makefil
0080: 65 2e 69 6e 0a 40 40 20 2d 31 34 38 2c 31 32 20 e.in.@@ -148,12
0090: 2b 31 34 38 2c 31 32 20 40 40 0a 20 23 20 54 63 +148,12 @@. # Tc
00a0: 6c 20 75 73 65 64 20 74 6f 20 6c 65 74 20 74 68 l used to let th
00b0: 65 20 63 6f 6e 66 69 67 75 72 65 20 73 63 72 69 e configure scri
00c0: 70 74 20 63 68 6f 6f 73 65 20 77 68 69 63 68 20 pt choose which
00d0: 70 72 6f 67 72 61 6d 20 74 6f 20 75 73 65 20 66 program to use f
00e0: 6f 72 0a 20 23 20 69 6e 73 74 61 6c 6c 69 6e 67 or. # installing
00f0: 2c 20 62 75 74 20 74 68 65 72 65 20 61 72 65 20 , but there are
0100: 6a 75 73 74 20 74 6f 6f 20 6d 61 6e 79 20 64 69 just too many di
0110: 66 66 65 72 65 6e 74 20 76 65 72 73 69 6f 6e 73 fferent versions
0120: 20 6f 66 20 22 69 6e 73 74 61 6c 6c 22 0a 20 23 of "install". #
0130: 20 61 72 6f 75 6e 64 3b 20 62 65 74 74 65 72 20 around; better
0140: 74 6f 20 75 73 65 20 74 68 65 20 69 6e 73 74 61 to use the insta
0150: 6c 6c 2d 73 68 20 73 63 72 69 70 74 20 74 68 61 ll-sh script tha
0160: 74 20 63 6f 6d 65 73 20 77 69 74 68 20 74 68 65 t comes with the
0170: 0a 20 23 20 64 69 73 74 72 69 62 75 74 69 6f 6e . # distribution
0180: 2c 20 77 68 69 63 68 20 69 73 20 73 6c 6f 77 65 , which is slowe
0190: 72 20 62 75 74 20 67 75 61 72 61 6e 74 65 65 64 r but guaranteed
01a0: 20 74 6f 20 77 6f 72 6b 2e 0a 20 0a 2d 49 4e 53 to work.. .-INS
01b0: 54 41 4c 4c 5f 53 54 52 49 50 5f 50 52 4f 47 52 TALL_STRIP_PROGR
01c0: 41 4d 09 3d 20 2d 73 0a 2d 49 4e 53 54 41 4c 4c AM.= -s.-INSTALL
01d0: 5f 53 54 52 49 50 5f 4c 49 42 52 41 52 59 09 3d _STRIP_LIBRARY.=
01e0: 20 2d 53 20 2d 78 0a 2b 49 4e 53 54 41 4c 4c 5f -S -x.+INSTALL_
01f0: 53 54 52 49 50 5f 50 52 4f 47 52 41 4d 09 3d 0a STRIP_PROGRAM.=.
0200: 2b 49 4e 53 54 41 4c 4c 5f 53 54 52 49 50 5f 4c +INSTALL_STRIP_L
0210: 49 42 52 41 52 59 09 3d 20 2d 78 0a 20 0a 20 49 IBRARY.= -x. . I
0220: 4e 53 54 41 4c 4c 09 09 09 3d 20 24 28 53 48 45 NSTALL...= $(SHE
0230: 4c 4c 29 20 24 28 55 4e 49 58 5f 44 49 52 29 2f LL) $(UNIX_DIR)/
0240: 69 6e 73 74 61 6c 6c 2d 73 68 20 2d 63 0a 20 49 install-sh -c. I
0250: 4e 53 54 41 4c 4c 5f 50 52 4f 47 52 41 4d 09 09 NSTALL_PROGRAM..
0260: 3d 20 24 7b 49 4e 53 54 41 4c 4c 7d 0a 20 49 4e = ${INSTALL}. IN
0270: 53 54 41 4c 4c 5f 4c 49 42 52 41 52 59 09 09 3d STALL_LIBRARY..=
0280: 20 24 7b 49 4e 53 54 41 4c 4c 7d 0a 20 49 4e 53 ${INSTALL}. INS
0290: 54 41 4c 4c 5f 44 41 54 41 09 09 3d 20 24 7b 49 TALL_DATA..= ${I
02a0: 4e 53 54 41 4c 4c 7d 20 2d 6d 20 36 34 34 0a 40 NSTALL} -m 644.@
02b0: 40 20 2d 39 37 37 2c 31 32 20 2b 39 37 37 2c 31 @ -977,12 +977,1
02c0: 32 20 40 40 0a 20 0a 20 69 6e 73 74 61 6c 6c 3a 2 @@. . install:
02d0: 20 24 28 49 4e 53 54 41 4c 4c 5f 54 41 52 47 45 $(INSTALL_TARGE
02e0: 54 53 29 0a 20 0a 20 69 6e 73 74 61 6c 6c 2d 73 TS). . install-s
02f0: 74 72 69 70 3a 0a 20 09 24 28 4d 41 4b 45 29 20 trip:. .$(MAKE)
0300: 24 28 49 4e 53 54 41 4c 4c 5f 54 41 52 47 45 54 $(INSTALL_TARGET
0310: 53 29 20 5c 0a 2d 09 09 49 4e 53 54 41 4c 4c 5f S) \.-..INSTALL_
0320: 50 52 4f 47 52 41 4d 3d 22 24 28 49 4e 53 54 41 PROGRAM="$(INSTA
0330: 4c 4c 5f 50 52 4f 47 52 41 4d 29 20 24 7b 49 4e LL_PROGRAM) ${IN
0340: 53 54 41 4c 4c 5f 53 54 52 49 50 5f 50 52 4f 47 STALL_STRIP_PROG
0350: 52 41 4d 7d 22 20 5c 0a 2d 09 09 49 4e 53 54 41 RAM}" \.-..INSTA
0360: 4c 4c 5f 4c 49 42 52 41 52 59 3d 22 24 28 49 4e LL_LIBRARY="$(IN
0370: 53 54 41 4c 4c 5f 4c 49 42 52 41 52 59 29 20 24 STALL_LIBRARY) $
0380: 7b 49 4e 53 54 41 4c 4c 5f 53 54 52 49 50 5f 4c {INSTALL_STRIP_L
0390: 49 42 52 41 52 59 7d 22 0a 2b 09 09 49 4e 53 54 IBRARY}".+..INST
03a0: 41 4c 4c 5f 50 52 4f 47 52 41 4d 3d 22 53 54 52 ALL_PROGRAM="STR
03b0: 49 50 50 52 4f 47 3d 27 73 74 72 69 70 20 24 7b IPPROG='strip ${
03c0: 49 4e 53 54 41 4c 4c 5f 53 54 52 49 50 5f 50 52 INSTALL_STRIP_PR
03d0: 4f 47 52 41 4d 7d 27 20 24 28 49 4e 53 54 41 4c OGRAM}' $(INSTAL
03e0: 4c 5f 50 52 4f 47 52 41 4d 29 20 2d 73 22 20 5c L_PROGRAM) -s" \
03f0: 0a 2b 09 09 49 4e 53 54 41 4c 4c 5f 4c 49 42 52 .+..INSTALL_LIBR
0400: 41 52 59 3d 22 53 54 52 49 50 50 52 4f 47 3d 27 ARY="STRIPPROG='
0410: 73 74 72 69 70 20 24 7b 49 4e 53 54 41 4c 4c 5f strip ${INSTALL_
0420: 53 54 52 49 50 5f 4c 49 42 52 41 52 59 7d 27 20 STRIP_LIBRARY}'
0430: 24 28 49 4e 53 54 41 4c 4c 5f 4c 49 42 52 41 52 $(INSTALL_LIBRAR
0440: 59 29 20 2d 73 22 0a 20 0a 20 69 6e 73 74 61 6c Y) -s". . instal
0450: 6c 2d 62 69 6e 61 72 69 65 73 3a 20 62 69 6e 61 l-binaries: bina
0460: 72 69 65 73 0a 20 09 40 66 6f 72 20 69 20 69 6e ries. .@for i in
0470: 20 22 24 28 4c 49 42 5f 49 4e 53 54 41 4c 4c 5f "$(LIB_INSTALL_
0480: 44 49 52 29 22 20 22 24 28 42 49 4e 5f 49 4e 53 DIR)" "$(BIN_INS
0490: 54 41 4c 4c 5f 44 49 52 29 22 20 5c 0a 20 09 09 TALL_DIR)" \. ..
04a0: 22 24 28 43 4f 4e 46 49 47 5f 49 4e 53 54 41 4c "$(CONFIG_INSTAL
04b0: 4c 5f 44 49 52 29 22 20 3b 20 64 6f 20 5c 0a 20 L_DIR)" ; do \.
04c0: 09 20 20 20 20 69 66 20 5b 20 21 20 2d 64 20 22 . if [ ! -d "
04d0: 24 24 69 22 20 5d 20 3b 20 74 68 65 6e 20 5c 0a $$i" ] ; then \.
04e0: 40 40 20 2d 32 32 32 39 2c 31 32 20 2b 32 32 32 @@ -2229,12 +222
04f0: 39 2c 31 32 20 40 40 0a 20 0a 20 44 49 53 54 52 9,12 @@. . DISTR
0500: 4f 4f 54 20 3d 20 2f 74 6d 70 2f 64 69 73 74 0a OOT = /tmp/dist.
0510: 20 44 49 53 54 4e 41 4d 45 20 3d 20 74 63 6c 24 DISTNAME = tcl$
0520: 7b 56 45 52 53 49 4f 4e 7d 24 7b 50 41 54 43 48 {VERSION}${PATCH
0530: 5f 4c 45 56 45 4c 7d 0a 20 5a 49 50 4e 41 4d 45 _LEVEL}. ZIPNAME
0540: 09 20 3d 20 74 63 6c 24 7b 4d 41 4a 4f 52 5f 56 . = tcl${MAJOR_V
0550: 45 52 53 49 4f 4e 7d 24 7b 4d 49 4e 4f 52 5f 56 ERSION}${MINOR_V
0560: 45 52 53 49 4f 4e 7d 24 7b 50 41 54 43 48 5f 4c ERSION}${PATCH_L
0570: 45 56 45 4c 7d 2d 73 72 63 2e 7a 69 70 0a 20 44 EVEL}-src.zip. D
0580: 49 53 54 44 49 52 09 20 3d 20 24 28 44 49 53 54 ISTDIR. = $(DIST
0590: 52 4f 4f 54 29 2f 24 28 44 49 53 54 4e 41 4d 45 ROOT)/$(DISTNAME
05a0: 29 0a 2d 44 49 53 54 5f 49 4e 53 54 41 4c 4c 5f ).-DIST_INSTALL_
05b0: 44 41 54 41 20 20 20 3d 20 43 50 50 52 4f 47 3d DATA = CPPROG=
05c0: 27 63 70 20 2d 70 27 20 24 28 49 4e 53 54 41 4c 'cp -p' $(INSTAL
05d0: 4c 29 20 2d 6d 20 36 34 34 0a 2d 44 49 53 54 5f L) -m 644.-DIST_
05e0: 49 4e 53 54 41 4c 4c 5f 53 43 52 49 50 54 20 3d INSTALL_SCRIPT =
05f0: 20 43 50 50 52 4f 47 3d 27 63 70 20 2d 70 27 20 CPPROG='cp -p'
0600: 24 28 49 4e 53 54 41 4c 4c 29 20 2d 6d 20 37 35 $(INSTALL) -m 75
0610: 35 0a 2b 44 49 53 54 5f 49 4e 53 54 41 4c 4c 5f 5.+DIST_INSTALL_
0620: 44 41 54 41 20 20 20 3d 20 24 28 49 4e 53 54 41 DATA = $(INSTA
0630: 4c 4c 29 20 2d 70 20 2d 6d 20 36 34 34 0a 2b 44 LL) -p -m 644.+D
0640: 49 53 54 5f 49 4e 53 54 41 4c 4c 5f 53 43 52 49 IST_INSTALL_SCRI
0650: 50 54 20 3d 20 24 28 49 4e 53 54 41 4c 4c 29 20 PT = $(INSTALL)
0660: 2d 70 20 2d 6d 20 37 35 35 0a 20 42 55 49 4c 54 -p -m 755. BUILT
0670: 49 4e 5f 50 41 43 4b 41 47 45 5f 4c 49 53 54 20 IN_PACKAGE_LIST
0680: 3d 20 63 6f 6f 6b 69 65 6a 61 72 20 68 74 74 70 = cookiejar http
0690: 20 6f 70 74 20 6d 73 67 63 61 74 20 72 65 67 69 opt msgcat regi
06a0: 73 74 72 79 20 64 64 65 20 74 63 6c 74 65 73 74 stry dde tcltest
06b0: 20 70 6c 61 74 66 6f 72 6d 0a 20 0a 20 24 28 55 platform. . $(U
06c0: 4e 49 58 5f 44 49 52 29 2f 63 6f 6e 66 69 67 75 NIX_DIR)/configu
06d0: 72 65 3a 20 24 28 55 4e 49 58 5f 44 49 52 29 2f re: $(UNIX_DIR)/
06e0: 63 6f 6e 66 69 67 75 72 65 2e 61 63 20 24 28 55 configure.ac $(U
06f0: 4e 49 58 5f 44 49 52 29 2f 74 63 6c 2e 6d 34 20 NIX_DIR)/tcl.m4
0700: 5c 0a 20 09 09 24 28 55 4e 49 58 5f 44 49 52 29 \. ..$(UNIX_DIR)
0710: 2f 61 63 6c 6f 63 61 6c 2e 6d 34 0a 20 09 63 64 /aclocal.m4. .cd
0720: 20 24 28 55 4e 49 58 5f 44 49 52 29 3b 20 61 75 $(UNIX_DIR); au
0730: 74 6f 63 6f 6e 66 0a 0a 49 6e 64 65 78 3a 20 75 toconf..Index: u
0740: 6e 69 78 2f 69 6e 73 74 61 6c 6c 2d 73 68 0a 3d nix/install-sh.=
0750: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0760: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0770: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0780: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0790: 3d 0a 2d 2d 2d 20 75 6e 69 78 2f 69 6e 73 74 61 =.--- unix/insta
07a0: 6c 6c 2d 73 68 0a 2b 2b 2b 20 75 6e 69 78 2f 69 ll-sh.+++ unix/i
07b0: 6e 73 74 61 6c 6c 2d 73 68 0a 40 40 20 2d 31 2c nstall-sh.@@ -1,
07c0: 39 20 2b 31 2c 39 20 40 40 0a 20 23 21 2f 62 69 9 +1,9 @@. #!/bi
07d0: 6e 2f 73 68 0a 20 23 20 69 6e 73 74 61 6c 6c 20 n/sh. # install
07e0: 2d 20 69 6e 73 74 61 6c 6c 20 61 20 70 72 6f 67 - install a prog
07f0: 72 61 6d 2c 20 73 63 72 69 70 74 2c 20 6f 72 20 ram, script, or
0800: 64 61 74 61 66 69 6c 65 0a 20 0a 2d 73 63 72 69 datafile. .-scri
0810: 70 74 76 65 72 73 69 6f 6e 3d 32 30 32 30 2d 30 ptversion=2020-0
0820: 37 2d 32 36 2e 32 32 3b 20 23 20 55 54 43 0a 2b 7-26.22; # UTC.+
0830: 73 63 72 69 70 74 76 65 72 73 69 6f 6e 3d 32 30 scriptversion=20
0840: 32 30 2d 31 31 2d 31 34 2e 30 31 3b 20 23 20 55 20-11-14.01; # U
0850: 54 43 0a 20 0a 20 23 20 54 68 69 73 20 6f 72 69 TC. . # This ori
0860: 67 69 6e 61 74 65 73 20 66 72 6f 6d 20 58 31 31 ginates from X11
0870: 52 35 20 28 6d 69 74 2f 75 74 69 6c 2f 73 63 72 R5 (mit/util/scr
0880: 69 70 74 73 2f 69 6e 73 74 61 6c 6c 2e 73 68 29 ipts/install.sh)
0890: 2c 20 77 68 69 63 68 20 77 61 73 0a 20 23 20 6c , which was. # l
08a0: 61 74 65 72 20 72 65 6c 65 61 73 65 64 20 69 6e ater released in
08b0: 20 58 31 31 52 36 20 28 78 63 2f 63 6f 6e 66 69 X11R6 (xc/confi
08c0: 67 2f 75 74 69 6c 2f 69 6e 73 74 61 6c 6c 2e 73 g/util/install.s
08d0: 68 29 20 77 69 74 68 20 74 68 65 0a 20 23 20 66 h) with the. # f
08e0: 6f 6c 6c 6f 77 69 6e 67 20 63 6f 70 79 72 69 67 ollowing copyrig
08f0: 68 74 20 61 6e 64 20 6c 69 63 65 6e 73 65 2e 0a ht and license..
0900: 20 23 0a 40 40 20 2d 37 31 2c 31 30 20 2b 37 31 #.@@ -71,10 +71
0910: 2c 31 31 20 40 40 0a 20 0a 20 23 20 43 72 65 61 ,11 @@. . # Crea
0920: 74 65 20 64 69 72 73 20 28 69 6e 63 6c 75 64 69 te dirs (includi
0930: 6e 67 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20 ng intermediate
0940: 64 69 72 73 29 20 75 73 69 6e 67 20 6d 6f 64 65 dirs) using mode
0950: 20 37 35 35 2e 0a 20 23 20 54 68 69 73 20 69 73 755.. # This is
0960: 20 6c 69 6b 65 20 47 4e 55 20 27 69 6e 73 74 61 like GNU 'insta
0970: 6c 6c 27 20 61 73 20 6f 66 20 63 6f 72 65 75 74 ll' as of coreut
0980: 69 6c 73 20 38 2e 33 32 20 28 32 30 32 30 29 2e ils 8.32 (2020).
0990: 0a 20 6d 6b 64 69 72 5f 75 6d 61 73 6b 3d 32 32 . mkdir_umask=22
09a0: 0a 20 0a 2b 62 61 63 6b 75 70 73 75 66 66 69 78 . .+backupsuffix
09b0: 3d 0a 20 63 68 67 72 70 63 6d 64 3d 0a 20 63 68 =. chgrpcmd=. ch
09c0: 6d 6f 64 63 6d 64 3d 24 63 68 6d 6f 64 70 72 6f modcmd=$chmodpro
09d0: 67 0a 20 63 68 6f 77 6e 63 6d 64 3d 0a 20 6d 76 g. chowncmd=. mv
09e0: 63 6d 64 3d 24 6d 76 70 72 6f 67 0a 20 72 6d 63 cmd=$mvprog. rmc
09f0: 6d 64 3d 22 24 72 6d 70 72 6f 67 20 2d 66 22 0a md="$rmprog -f".
0a00: 40 40 20 2d 31 30 31 2c 32 33 20 2b 31 30 32 2c @@ -101,23 +102,
0a10: 33 32 20 40 40 0a 20 4f 70 74 69 6f 6e 73 3a 0a 32 @@. Options:.
0a20: 20 20 20 20 20 20 2d 2d 68 65 6c 70 20 20 20 20 --help
0a30: 20 64 69 73 70 6c 61 79 20 74 68 69 73 20 68 65 display this he
0a40: 6c 70 20 61 6e 64 20 65 78 69 74 2e 0a 20 20 20 lp and exit..
0a50: 20 20 20 2d 2d 76 65 72 73 69 6f 6e 20 20 64 69 --version di
0a60: 73 70 6c 61 79 20 76 65 72 73 69 6f 6e 20 69 6e splay version in
0a70: 66 6f 20 61 6e 64 20 65 78 69 74 2e 0a 20 0a 20 fo and exit.. .
0a80: 20 20 2d 63 20 20 20 20 20 20 20 20 20 20 20 20 -c
0a90: 28 69 67 6e 6f 72 65 64 29 0a 2d 20 20 2d 43 20 (ignored).- -C
0aa0: 20 20 20 20 20 20 20 20 20 20 20 69 6e 73 74 61 insta
0ab0: 6c 6c 20 6f 6e 6c 79 20 69 66 20 64 69 66 66 65 ll only if diffe
0ac0: 72 65 6e 74 20 28 70 72 65 73 65 72 76 65 20 74 rent (preserve t
0ad0: 68 65 20 6c 61 73 74 20 64 61 74 61 20 6d 6f 64 he last data mod
0ae0: 69 66 69 63 61 74 69 6f 6e 20 74 69 6d 65 29 0a ification time).
0af0: 2b 20 20 2d 43 20 20 20 20 20 20 20 20 20 20 20 + -C
0b00: 20 69 6e 73 74 61 6c 6c 20 6f 6e 6c 79 20 69 66 install only if
0b10: 20 64 69 66 66 65 72 65 6e 74 20 28 70 72 65 73 different (pres
0b20: 65 72 76 65 20 64 61 74 61 20 6d 6f 64 69 66 69 erve data modifi
0b30: 63 61 74 69 6f 6e 20 74 69 6d 65 29 0a 20 20 20 cation time).
0b40: 2d 64 20 20 20 20 20 20 20 20 20 20 20 20 63 72 -d cr
0b50: 65 61 74 65 20 64 69 72 65 63 74 6f 72 69 65 73 eate directories
0b60: 20 69 6e 73 74 65 61 64 20 6f 66 20 69 6e 73 74 instead of inst
0b70: 61 6c 6c 69 6e 67 20 66 69 6c 65 73 2e 0a 20 20 alling files..
0b80: 20 2d 67 20 47 52 4f 55 50 20 20 20 20 20 20 24 -g GROUP $
0b90: 63 68 67 72 70 70 72 6f 67 20 69 6e 73 74 61 6c chgrpprog instal
0ba0: 6c 65 64 20 66 69 6c 65 73 20 74 6f 20 47 52 4f led files to GRO
0bb0: 55 50 2e 0a 20 20 20 2d 6d 20 4d 4f 44 45 20 20 UP.. -m MODE
0bc0: 20 20 20 20 20 24 63 68 6d 6f 64 70 72 6f 67 20 $chmodprog
0bd0: 69 6e 73 74 61 6c 6c 65 64 20 66 69 6c 65 73 20 installed files
0be0: 74 6f 20 4d 4f 44 45 2e 0a 20 20 20 2d 6f 20 55 to MODE.. -o U
0bf0: 53 45 52 20 20 20 20 20 20 20 24 63 68 6f 77 6e SER $chown
0c00: 70 72 6f 67 20 69 6e 73 74 61 6c 6c 65 64 20 66 prog installed f
0c10: 69 6c 65 73 20 74 6f 20 55 53 45 52 2e 0a 2b 20 iles to USER..+
0c20: 20 2d 70 20 20 20 20 20 20 20 20 20 20 20 20 70 -p p
0c30: 61 73 73 20 2d 70 20 74 6f 20 24 63 70 70 72 6f ass -p to $cppro
0c40: 67 2e 0a 20 20 20 2d 73 20 20 20 20 20 20 20 20 g.. -s
0c50: 20 20 20 20 24 73 74 72 69 70 70 72 6f 67 20 69 $stripprog i
0c60: 6e 73 74 61 6c 6c 65 64 20 66 69 6c 65 73 2e 0a nstalled files..
0c70: 2d 20 20 2d 53 20 4f 50 54 49 4f 4e 20 20 20 20 - -S OPTION
0c80: 20 24 73 74 72 69 70 70 72 6f 67 20 69 6e 73 74 $stripprog inst
0c90: 61 6c 6c 65 64 20 66 69 6c 65 73 20 75 73 69 6e alled files usin
0ca0: 67 20 4f 50 54 49 4f 4e 2e 0a 2b 20 20 2d 53 20 g OPTION..+ -S
0cb0: 53 55 46 46 49 58 20 20 20 20 20 61 74 74 65 6d SUFFIX attem
0cc0: 70 74 20 74 6f 20 62 61 63 6b 20 75 70 20 65 78 pt to back up ex
0cd0: 69 73 74 69 6e 67 20 66 69 6c 65 73 2c 20 77 69 isting files, wi
0ce0: 74 68 20 73 75 66 66 69 78 20 53 55 46 46 49 58 th suffix SUFFIX
0cf0: 2e 0a 20 20 20 2d 74 20 44 49 52 45 43 54 4f 52 .. -t DIRECTOR
0d00: 59 20 20 69 6e 73 74 61 6c 6c 20 69 6e 74 6f 20 Y install into
0d10: 44 49 52 45 43 54 4f 52 59 2e 0a 20 20 20 2d 54 DIRECTORY.. -T
0d20: 20 20 20 20 20 20 20 20 20 20 20 20 72 65 70 6f repo
0d30: 72 74 20 61 6e 20 65 72 72 6f 72 20 69 66 20 44 rt an error if D
0d40: 53 54 46 49 4c 45 20 69 73 20 61 20 64 69 72 65 STFILE is a dire
0d50: 63 74 6f 72 79 2e 0a 20 0a 20 45 6e 76 69 72 6f ctory.. . Enviro
0d60: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 nment variables
0d70: 6f 76 65 72 72 69 64 65 20 74 68 65 20 64 65 66 override the def
0d80: 61 75 6c 74 20 63 6f 6d 6d 61 6e 64 73 3a 0a 20 ault commands:.
0d90: 20 20 43 48 47 52 50 50 52 4f 47 20 43 48 4d 4f CHGRPPROG CHMO
0da0: 44 50 52 4f 47 20 43 48 4f 57 4e 50 52 4f 47 20 DPROG CHOWNPROG
0db0: 43 4d 50 50 52 4f 47 20 43 50 50 52 4f 47 20 4d CMPPROG CPPROG M
0dc0: 4b 44 49 52 50 52 4f 47 20 4d 56 50 52 4f 47 0a KDIRPROG MVPROG.
0dd0: 20 20 20 52 4d 50 52 4f 47 20 53 54 52 49 50 50 RMPROG STRIPP
0de0: 52 4f 47 0a 2b 0a 2b 42 79 20 64 65 66 61 75 6c ROG.+.+By defaul
0df0: 74 2c 20 72 6d 20 69 73 20 69 6e 76 6f 6b 65 64 t, rm is invoked
0e00: 20 77 69 74 68 20 2d 66 3b 20 77 68 65 6e 20 6f with -f; when o
0e10: 76 65 72 72 69 64 64 65 6e 20 77 69 74 68 20 52 verridden with R
0e20: 4d 50 52 4f 47 2c 0a 2b 69 74 27 73 20 75 70 20 MPROG,.+it's up
0e30: 74 6f 20 79 6f 75 20 74 6f 20 73 70 65 63 69 66 to you to specif
0e40: 79 20 2d 66 20 69 66 20 79 6f 75 20 77 61 6e 74 y -f if you want
0e50: 20 69 74 2e 0a 2b 0a 2b 49 66 20 2d 53 20 69 73 it..+.+If -S is
0e60: 20 6e 6f 74 20 73 70 65 63 69 66 69 65 64 2c 20 not specified,
0e70: 6e 6f 20 62 61 63 6b 75 70 73 20 61 72 65 20 61 no backups are a
0e80: 74 74 65 6d 70 74 65 64 2e 0a 2b 0a 2b 45 6d 61 ttempted..+.+Ema
0e90: 69 6c 20 62 75 67 20 72 65 70 6f 72 74 73 20 74 il bug reports t
0ea0: 6f 20 62 75 67 2d 61 75 74 6f 6d 61 6b 65 40 67 o bug-automake@g
0eb0: 6e 75 2e 6f 72 67 2e 0a 2b 41 75 74 6f 6d 61 6b nu.org..+Automak
0ec0: 65 20 68 6f 6d 65 20 70 61 67 65 3a 20 68 74 74 e home page: htt
0ed0: 70 73 3a 2f 2f 77 77 77 2e 67 6e 75 2e 6f 72 67 ps://www.gnu.org
0ee0: 2f 73 6f 66 74 77 61 72 65 2f 61 75 74 6f 6d 61 /software/automa
0ef0: 6b 65 2f 0a 20 22 0a 20 0a 20 77 68 69 6c 65 20 ke/. ". . while
0f00: 74 65 73 74 20 24 23 20 2d 6e 65 20 30 3b 20 64 test $# -ne 0; d
0f10: 6f 0a 20 20 20 63 61 73 65 20 24 31 20 69 6e 0a o. case $1 in.
0f20: 20 20 20 20 20 2d 63 29 20 3b 3b 0a 40 40 20 2d -c) ;;.@@ -
0f30: 31 34 30 2c 31 33 20 2b 31 35 30 2c 31 35 20 40 140,13 +150,15 @
0f40: 40 0a 20 20 20 20 20 20 20 20 20 73 68 69 66 74 @. shift
0f50: 3b 3b 0a 20 0a 20 20 20 20 20 2d 6f 29 20 63 68 ;;. . -o) ch
0f60: 6f 77 6e 63 6d 64 3d 22 24 63 68 6f 77 6e 70 72 owncmd="$chownpr
0f70: 6f 67 20 24 32 22 0a 20 20 20 20 20 20 20 20 20 og $2".
0f80: 73 68 69 66 74 3b 3b 0a 20 0a 2b 20 20 20 20 2d shift;;. .+ -
0f90: 70 29 20 63 70 70 72 6f 67 3d 22 24 63 70 70 72 p) cpprog="$cppr
0fa0: 6f 67 20 2d 70 22 3b 3b 0a 2b 0a 20 20 20 20 20 og -p";;.+.
0fb0: 2d 73 29 20 73 74 72 69 70 63 6d 64 3d 24 73 74 -s) stripcmd=$st
0fc0: 72 69 70 70 72 6f 67 3b 3b 0a 20 0a 2d 20 20 20 ripprog;;. .-
0fd0: 20 2d 53 29 20 73 74 72 69 70 63 6d 64 3d 22 24 -S) stripcmd="$
0fe0: 73 74 72 69 70 70 72 6f 67 20 24 32 22 0a 2b 20 stripprog $2".+
0ff0: 20 20 20 2d 53 29 20 62 61 63 6b 75 70 73 75 66 -S) backupsuf
1000: 66 69 78 3d 22 24 32 22 0a 20 20 20 20 20 20 20 fix="$2".
1010: 20 20 73 68 69 66 74 3b 3b 0a 20 0a 20 20 20 20 shift;;. .
1020: 20 2d 74 29 0a 20 20 20 20 20 20 20 20 20 69 73 -t). is
1030: 5f 74 61 72 67 65 74 5f 61 5f 64 69 72 65 63 74 _target_a_direct
1040: 6f 72 79 3d 61 6c 77 61 79 73 0a 20 20 20 20 20 ory=always.
1050: 20 20 20 20 64 73 74 5f 61 72 67 3d 24 32 0a 40 dst_arg=$2.@
1060: 40 20 2d 32 36 31 2c 31 30 20 2b 32 37 33 2c 31 @ -261,10 +273,1
1070: 34 20 40 40 0a 20 20 20 69 66 20 74 65 73 74 20 4 @@. if test
1080: 2d 6e 20 22 24 64 69 72 5f 61 72 67 22 3b 20 74 -n "$dir_arg"; t
1090: 68 65 6e 0a 20 20 20 20 20 64 73 74 3d 24 73 72 hen. dst=$sr
10a0: 63 0a 20 20 20 20 20 64 73 74 64 69 72 3d 24 64 c. dstdir=$d
10b0: 73 74 0a 20 20 20 20 20 74 65 73 74 20 2d 64 20 st. test -d
10c0: 22 24 64 73 74 64 69 72 22 0a 20 20 20 20 20 64 "$dstdir". d
10d0: 73 74 64 69 72 5f 73 74 61 74 75 73 3d 24 3f 0a stdir_status=$?.
10e0: 2b 20 20 20 20 23 20 44 6f 6e 27 74 20 63 68 6f + # Don't cho
10f0: 77 6e 20 64 69 72 65 63 74 6f 72 69 65 73 20 74 wn directories t
1100: 68 61 74 20 61 6c 72 65 61 64 79 20 65 78 69 73 hat already exis
1110: 74 2e 0a 2b 20 20 20 20 69 66 20 74 65 73 74 20 t..+ if test
1120: 24 64 73 74 64 69 72 5f 73 74 61 74 75 73 20 3d $dstdir_status =
1130: 20 30 3b 20 74 68 65 6e 0a 2b 20 20 20 20 20 20 0; then.+
1140: 63 68 6f 77 6e 63 6d 64 3d 22 22 0a 2b 20 20 20 chowncmd="".+
1150: 20 66 69 0a 20 20 20 65 6c 73 65 0a 20 0a 20 20 fi. else. .
1160: 20 20 20 23 20 57 61 69 74 69 6e 67 20 66 6f 72 # Waiting for
1170: 20 74 68 69 73 20 74 6f 20 62 65 20 64 65 74 65 this to be dete
1180: 63 74 65 64 20 62 79 20 74 68 65 20 22 24 63 70 cted by the "$cp
1190: 70 72 6f 67 20 24 73 72 63 20 24 64 73 74 74 6d prog $src $dsttm
11a0: 70 22 20 63 6f 6d 6d 61 6e 64 0a 20 20 20 20 20 p" command.
11b0: 23 20 6d 69 67 68 74 20 63 61 75 73 65 20 64 69 # might cause di
11c0: 72 65 63 74 6f 72 69 65 73 20 74 6f 20 62 65 20 rectories to be
11d0: 63 72 65 61 74 65 64 2c 20 77 68 69 63 68 20 77 created, which w
11e0: 6f 75 6c 64 20 62 65 20 65 73 70 65 63 69 61 6c ould be especial
11f0: 6c 79 20 62 61 64 0a 20 20 20 20 20 23 20 69 66 ly bad. # if
1200: 20 24 73 72 63 20 28 61 6e 64 20 74 68 75 73 20 $src (and thus
1210: 24 64 73 74 74 6d 70 29 20 63 6f 6e 74 61 69 6e $dsttmp) contain
1220: 73 20 27 2a 27 2e 0a 40 40 20 2d 34 37 35 2c 31 s '*'..@@ -475,1
1230: 30 20 2b 34 39 31 2c 31 37 20 40 40 0a 20 20 20 0 +491,17 @@.
1240: 20 20 20 20 20 74 65 73 74 20 22 24 6f 6c 64 22 test "$old"
1250: 20 3d 20 22 24 6e 65 77 22 20 26 26 0a 20 20 20 = "$new" &&.
1260: 20 20 20 20 20 24 63 6d 70 70 72 6f 67 20 22 24 $cmpprog "$
1270: 64 73 74 22 20 22 24 64 73 74 74 6d 70 22 20 3e dst" "$dsttmp" >
1280: 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 26 31 0a 20 /dev/null 2>&1.
1290: 20 20 20 20 74 68 65 6e 0a 20 20 20 20 20 20 20 then.
12a0: 72 6d 20 2d 66 20 22 24 64 73 74 74 6d 70 22 0a rm -f "$dsttmp".
12b0: 20 20 20 20 20 65 6c 73 65 0a 2b 20 20 20 20 20 else.+
12c0: 20 23 20 49 66 20 24 62 61 63 6b 75 70 73 75 66 # If $backupsuf
12d0: 66 69 78 20 69 73 20 73 65 74 2c 20 61 6e 64 20 fix is set, and
12e0: 74 68 65 20 66 69 6c 65 20 62 65 69 6e 67 20 69 the file being i
12f0: 6e 73 74 61 6c 6c 65 64 0a 2b 20 20 20 20 20 20 nstalled.+
1300: 23 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 # already exists
1310: 2c 20 61 74 74 65 6d 70 74 20 61 20 62 61 63 6b , attempt a back
1320: 75 70 2e 20 20 44 6f 6e 27 74 20 77 6f 72 72 79 up. Don't worry
1330: 20 69 66 20 69 74 20 66 61 69 6c 73 2c 0a 2b 20 if it fails,.+
1340: 20 20 20 20 20 23 20 65 2e 67 2e 2c 20 69 66 20 # e.g., if
1350: 6d 76 20 64 6f 65 73 6e 27 74 20 73 75 70 70 6f mv doesn't suppo
1360: 72 74 20 2d 66 2e 0a 2b 20 20 20 20 20 20 69 66 rt -f..+ if
1370: 20 74 65 73 74 20 2d 6e 20 22 24 62 61 63 6b 75 test -n "$backu
1380: 70 73 75 66 66 69 78 22 20 26 26 20 74 65 73 74 psuffix" && test
1390: 20 2d 66 20 22 24 64 73 74 22 3b 20 74 68 65 6e -f "$dst"; then
13a0: 0a 2b 20 20 20 20 20 20 20 20 24 64 6f 69 74 20 .+ $doit
13b0: 24 6d 76 63 6d 64 20 2d 66 20 22 24 64 73 74 22 $mvcmd -f "$dst"
13c0: 20 22 24 64 73 74 24 62 61 63 6b 75 70 73 75 66 "$dst$backupsuf
13d0: 66 69 78 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c fix" 2>/dev/null
13e0: 0a 2b 20 20 20 20 20 20 66 69 0a 2b 0a 20 20 20 .+ fi.+.
13f0: 20 20 20 20 23 20 52 65 6e 61 6d 65 20 74 68 65 # Rename the
1400: 20 66 69 6c 65 20 74 6f 20 74 68 65 20 72 65 61 file to the rea
1410: 6c 20 64 65 73 74 69 6e 61 74 69 6f 6e 2e 0a 20 l destination..
1420: 20 20 20 20 20 20 24 64 6f 69 74 20 24 6d 76 63 $doit $mvc
1430: 6d 64 20 2d 66 20 22 24 64 73 74 74 6d 70 22 20 md -f "$dsttmp"
1440: 22 24 64 73 74 22 20 32 3e 2f 64 65 76 2f 6e 75 "$dst" 2>/dev/nu
1450: 6c 6c 20 7c 7c 0a 20 0a 20 20 20 20 20 20 20 23 ll ||. . #
1460: 20 54 68 65 20 72 65 6e 61 6d 65 20 66 61 69 6c The rename fail
1470: 65 64 2c 20 70 65 72 68 61 70 73 20 62 65 63 61 ed, perhaps beca
1480: 75 73 65 20 6d 76 20 63 61 6e 27 74 20 72 65 6e use mv can't ren
1490: 61 6d 65 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c ame something el
14a0: 73 65 0a 20 20 20 20 20 20 20 23 20 74 6f 20 69 se. # to i
14b0: 74 73 65 6c 66 2c 20 6f 72 20 70 65 72 68 61 70 tself, or perhap
14c0: 73 20 62 65 63 61 75 73 65 20 6d 76 20 69 73 20 s because mv is
14d0: 73 6f 20 61 6e 63 69 65 6e 74 20 74 68 61 74 20 so ancient that
14e0: 69 74 20 64 6f 65 73 20 6e 6f 74 0a 40 40 20 2d it does not.@@ -
14f0: 34 38 39 2c 31 33 20 2b 35 31 32 2c 31 33 20 40 489,13 +512,13 @
1500: 40 0a 20 20 20 20 20 20 20 20 20 23 20 73 79 73 @. # sys
1510: 74 65 6d 73 20 61 6e 64 20 74 68 65 20 64 65 73 tems and the des
1520: 74 69 6e 61 74 69 6f 6e 20 66 69 6c 65 20 6d 69 tination file mi
1530: 67 68 74 20 62 65 20 62 75 73 79 20 66 6f 72 20 ght be busy for
1540: 6f 74 68 65 72 0a 20 20 20 20 20 20 20 20 20 23 other. #
1550: 20 72 65 61 73 6f 6e 73 2e 20 20 49 6e 20 74 68 reasons. In th
1560: 69 73 20 63 61 73 65 2c 20 74 68 65 20 66 69 6e is case, the fin
1570: 61 6c 20 63 6c 65 61 6e 75 70 20 6d 69 67 68 74 al cleanup might
1580: 20 66 61 69 6c 20 62 75 74 20 74 68 65 20 6e 65 fail but the ne
1590: 77 0a 20 20 20 20 20 20 20 20 20 23 20 66 69 6c w. # fil
15a0: 65 20 73 68 6f 75 6c 64 20 73 74 69 6c 6c 20 69 e should still i
15b0: 6e 73 74 61 6c 6c 20 73 75 63 63 65 73 73 66 75 nstall successfu
15c0: 6c 6c 79 2e 0a 20 20 20 20 20 20 20 20 20 7b 0a lly.. {.
15d0: 20 20 20 20 20 20 20 20 20 20 20 74 65 73 74 20 test
15e0: 21 20 2d 66 20 22 24 64 73 74 22 20 7c 7c 0a 2d ! -f "$dst" ||.-
15f0: 20 20 20 20 20 20 20 20 20 20 24 64 6f 69 74 20 $doit
1600: 24 72 6d 63 6d 64 20 2d 66 20 22 24 64 73 74 22 $rmcmd -f "$dst"
1610: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 7c 7c 0a 2>/dev/null ||.
1620: 2b 20 20 20 20 20 20 20 20 20 20 24 64 6f 69 74 + $doit
1630: 20 24 72 6d 63 6d 64 20 22 24 64 73 74 22 20 32 $rmcmd "$dst" 2
1640: 3e 2f 64 65 76 2f 6e 75 6c 6c 20 7c 7c 0a 20 20 >/dev/null ||.
1650: 20 20 20 20 20 20 20 20 20 7b 20 24 64 6f 69 74 { $doit
1660: 20 24 6d 76 63 6d 64 20 2d 66 20 22 24 64 73 74 $mvcmd -f "$dst
1670: 22 20 22 24 72 6d 74 6d 70 22 20 32 3e 2f 64 65 " "$rmtmp" 2>/de
1680: 76 2f 6e 75 6c 6c 20 26 26 0a 2d 20 20 20 20 20 v/null &&.-
1690: 20 20 20 20 20 20 20 7b 20 24 64 6f 69 74 20 24 { $doit $
16a0: 72 6d 63 6d 64 20 2d 66 20 22 24 72 6d 74 6d 70 rmcmd -f "$rmtmp
16b0: 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 3a " 2>/dev/null; :
16c0: 3b 20 7d 0a 2b 20 20 20 20 20 20 20 20 20 20 20 ; }.+
16d0: 20 7b 20 24 64 6f 69 74 20 24 72 6d 63 6d 64 20 { $doit $rmcmd
16e0: 22 24 72 6d 74 6d 70 22 20 32 3e 2f 64 65 76 2f "$rmtmp" 2>/dev/
16f0: 6e 75 6c 6c 3b 20 3a 3b 20 7d 0a 20 20 20 20 20 null; :; }.
1700: 20 20 20 20 20 20 7d 20 7c 7c 0a 20 20 20 20 20 } ||.
1710: 20 20 20 20 20 20 7b 20 65 63 68 6f 20 22 24 30 { echo "$0
1720: 3a 20 63 61 6e 6e 6f 74 20 75 6e 6c 69 6e 6b 20 : cannot unlink
1730: 6f 72 20 72 65 6e 61 6d 65 20 24 64 73 74 22 20 or rename $dst"
1740: 3e 26 32 0a 20 20 20 20 20 20 20 20 20 20 20 20 >&2.
1750: 20 28 65 78 69 74 20 31 29 3b 20 65 78 69 74 20 (exit 1); exit
1760: 31 0a 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 1. }.
1770: 20 20 20 20 20 20 20 20 7d 20 26 26 0a 0a } &&..