838 |cmd srcBaseName srcF dstF d| |
838 |cmd srcBaseName srcF dstF d| |
839 |
839 |
840 srcF := src asFilename. |
840 srcF := src asFilename. |
841 dstF := dst asFilename. |
841 dstF := dst asFilename. |
842 |
842 |
843 "/ OperatingSystem isUNIXlike ifTrue:[ |
843 srcBaseName := srcF baseName. |
844 "/ cmd := 'cp -r ' , src , ' ' , destDir. |
844 (srcBaseName startsWith:'.#') ifTrue:[^ self]. |
845 "/ commandTraceView showCR:cmd , ' ...'. |
845 |
846 "/ commandTraceView endEntry. |
846 (#( |
847 "/ cmd := cmd , ' 2>&1' . |
847 'CVS' |
848 "/ |
848 'not_delivered' |
849 "/ self executeCommandAndShowOutput:cmd |
849 '.cvsignore' |
850 "/ ] ifFalse:[ |
850 '.dir.info' |
851 srcBaseName := srcF baseName. |
851 ) includes:srcBaseName) ifTrue:[ |
852 (srcBaseName startsWith:'.#') ifTrue:[^ self]. |
852 ^ self |
853 |
853 ]. |
854 (#( |
854 |
855 'CVS' |
855 srcBaseName includesMatchCharacters ifTrue:[ |
856 'not_delivered' |
856 doPrint ifTrue:[ |
857 '.cvsignore' |
857 OperatingSystem isUNIXlike ifTrue:[ |
858 '.dir.info' |
858 commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
859 ) includes:srcBaseName) ifFalse:[ |
|
860 srcBaseName includesMatchCharacters ifTrue:[ |
|
861 doPrint ifTrue:[ |
|
862 OperatingSystem isUNIXlike ifTrue:[ |
|
863 commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
|
864 ] ifFalse:[ |
|
865 commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
|
866 ]. |
|
867 commandTraceView endEntry. |
|
868 ]. |
|
869 (srcF directory directoryContents ? #()) do:[:fileName | |
|
870 (srcBaseName match:fileName) ifTrue:[ |
|
871 (#( |
|
872 'CVS' |
|
873 'not_delivered' |
|
874 ) includes:fileName) ifFalse:[ |
|
875 self |
|
876 recursiveCopy:(srcF directory construct:fileName) |
|
877 to:dstF |
|
878 print:false |
|
879 ] |
|
880 ] |
|
881 ] |
|
882 ] ifFalse:[ |
859 ] ifFalse:[ |
883 doPrint ifTrue:[ |
860 commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
884 OperatingSystem isUNIXlike ifTrue:[ |
861 ]. |
885 commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
862 commandTraceView endEntry. |
886 ] ifFalse:[ |
863 ]. |
887 commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
864 (srcF directory directoryContents ? #()) do:[:fileName | |
888 ]. |
865 (srcBaseName match:fileName) ifTrue:[ |
889 commandTraceView endEntry. |
866 (#( |
890 ]. |
867 'CVS' |
891 srcF isDirectory ifFalse:[ |
868 'not_delivered' |
892 (dstF exists and:[dstF isDirectory]) ifTrue:[ |
869 ) includes:fileName) ifFalse:[ |
893 dstF := dstF construct:srcBaseName. |
870 self |
894 ]. |
871 recursiveCopy:(srcF directory construct:fileName) |
895 "/ special check for windows bug |
872 to:dstF |
896 "/ (lists trans.tbl files, but wont find it later) |
873 print:doPrint |
897 srcF exists ifTrue:[ |
|
898 Object errorSignal handle:[:ex | |
|
899 commandTraceView showCR:('*** Error: ' , ex errorString) |
|
900 ] do:[ |
|
901 srcF copyTo:dstF. |
|
902 ] |
|
903 ]. |
|
904 OperatingSystem isUNIXlike ifTrue:[ |
|
905 srcF isExecutable ifTrue:[ |
|
906 dstF makeExecutableForAll |
|
907 ] |
|
908 ] |
|
909 ] ifTrue:[ |
|
910 d := dstF asFilename construct:srcBaseName. |
|
911 (d exists) ifFalse:[ |
|
912 d makeDirectory. |
|
913 ]. |
|
914 (srcF directoryContents ? #()) do:[:fileName | |
|
915 self recursiveCopy:(srcF construct:fileName) |
|
916 to:d |
|
917 print:false |
|
918 ] |
|
919 ] |
874 ] |
920 ] |
875 ] |
921 ] |
876 ] |
922 "/ ] |
877 ] ifFalse:[ |
|
878 srcF isDirectory ifFalse:[ |
|
879 (dstF exists and:[dstF isDirectory]) ifTrue:[ |
|
880 dstF := dstF construct:srcBaseName. |
|
881 ]. |
|
882 "/ special check for windows bug |
|
883 "/ (lists trans.tbl files, but wont find it later) |
|
884 srcF exists ifTrue:[ |
|
885 Object errorSignal handle:[:ex | |
|
886 commandTraceView showCR:('*** Error: ' , ex errorString) |
|
887 ] do:[ |
|
888 srcF copyTo:dstF. |
|
889 ] |
|
890 ]. |
|
891 OperatingSystem isUNIXlike ifTrue:[ |
|
892 srcF isExecutable ifTrue:[ |
|
893 dstF makeExecutableForAll |
|
894 ] |
|
895 ] |
|
896 ] ifTrue:[ |
|
897 doPrint ifTrue:[ |
|
898 OperatingSystem isUNIXlike ifTrue:[ |
|
899 commandTraceView showCR:('cp ' , srcF pathName , ' ' , dstF pathName). |
|
900 ] ifFalse:[ |
|
901 commandTraceView showCR:('copy ' , srcF pathName , ' ' , dstF pathName). |
|
902 ]. |
|
903 commandTraceView endEntry. |
|
904 ]. |
|
905 d := dstF asFilename construct:srcBaseName. |
|
906 (d exists) ifFalse:[ |
|
907 d makeDirectory. |
|
908 ]. |
|
909 (srcF directoryContents ? #()) do:[:fileName | |
|
910 self recursiveCopy:(srcF construct:fileName) |
|
911 to:d |
|
912 print:doPrint |
|
913 ] |
|
914 ] |
|
915 ] |
923 |
916 |
924 "Created: / 31.5.1999 / 13:05:09 / cg" |
917 "Created: / 31.5.1999 / 13:05:09 / cg" |
925 "Modified: / 3.3.2000 / 01:51:54 / cg" |
918 "Modified: / 3.3.2000 / 01:51:54 / cg" |
926 ! |
919 ! |
927 |
920 |