Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from string import Template
- from sys import argv
- PATCHROOT = "~/CWMARS/files/patches/rel_3_7_3/"
- templ = Template("""[ ! -d ${destdir} ] && mkdir -p ${destdir}
- cp ${src} ${dest}""");
- with open(argv[1], "r") as f:
- while True:
- line = f.readline()
- if not line:
- break
- input = line.strip()
- srcfile = PATCHROOT + input
- destfile = input
- if "templates/opac" in destfile:
- destfile = destfile.replace("templates", "templates_cons")
- destdir = destfile[0:destfile.rfind("/")]
- print(templ.substitute(destdir=destdir,src=srcfile,dest=destfile))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement