7 (opts, args) = getopt.getopt (sys.argv[1:], 'b:cdg:m:o:st:', [])
26 mode = string.atoi (a, 8)
34 print ''' Usage: $0 [OPTION]... SRCFILE DSTFILE
35 or: $0 [OPTION]... SRCFILES... DIRECTORY
36 or: $0 -d DIRECTORIES...
38 In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
39 In the second, create the directory path DIR.
43 -c copy source (using $cpprog) instead of moving (using $mvprog).
44 -d create directories instead of installing files.
45 -g GROUP $chgrp installed files to GROUP.
46 -m MODE $chmod installed files to MODE.
47 -o USER $chown installed files to USER.
48 -s strip installed files (using $stripprog).
50 --help display this help and exit.
51 --version display version info and exit.'''
72 os.makedirs (f, mode=mode)
76 if os.path.exists (dest) and not os.path.isdir (dest):
78 shutil.copy2 (f, dest)
82 if os.path.isdir (dest):
83 chown_me.append (os.path.join (dest, os.path.basename (f)))
85 chown_me.append (dest)
89 if group <> None or owner <> None:
90 os.chown (f, group, owner)