bug observed in email for rbkernel patch where "notes" was a directory. since notes is used in the patch message, the directory itself was copied into the patch email. fix: don't allow file names matching patch's internal file names to slide past without renaming. reuse the existing renaming system for this. Reference: /n/atom/patch/applied2013/apatchfrog Date: Thu Aug 1 18:57:57 CES 2013 Signed-off-by: quanstro@quanstro.net --- /rc/bin/apatch/create Thu Aug 1 18:54:58 2013 +++ /rc/bin/apatch/create Thu Aug 1 18:54:59 2013 @@ -27,7 +27,7 @@ email=$2 * = $*(3-) -validate 'patch name' $patch '^[a-zA-Z0-9][a-z_0-9.\-]+$' +validate 'patch name' $patch '^[a-zA-Z][a-z_0-9.\-]+$' validate email $email '^(-|[A-Za-z0-9.\-+]+@[A-Za-z0-9.\-+]+)$' mountfs @@ -129,7 +129,15 @@ fn genu { echo $changed | tr ' ' \xa | - awk '{ + awk ' + BEGIN{ + a["email"] = 1; + a["files"] = 1; + a["notes"] = 1; + a["readme"] = 1; + a["removed"] = 1; + } + { base = $0 sub("/$", "", base) # already have cleanname sub(".*/", "", base)