Skip to content

Commit

Permalink
Fix 'clean' command in script, set mode executable.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentonv committed Aug 31, 2009
1 parent f77e65b commit 14d0c21
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def getenv(self, name):
return None

def clean(self, expunge=False):
for dir in ["tmp", "bin", "lib", "share", "mem", "env"]:
for dir in ["tmp", "bin", "lib", "share", "include", "mem", "env"]:
if self.root_dir.exists(dir):
shutil.rmtree(self.root_dir.get_disk_path(dir))

Expand Down
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,17 @@ def script(config, argv):
if filename is None:
out = sys.stdout
else:
# Write unix-style newlines regardless of host OS.
# Binary mode => Write unix-style newlines regardless of host OS.
out = open(filename, "wb")

builder.write(out)

if filename is not None:
out.close()
mask = os.umask(0)
os.umask(mask)
os.chmod(filename, 0777 & ~mask)

# --------------------------------------------------------------------

def clean(config, argv):
Expand Down
14 changes: 9 additions & 5 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
__END__
}
function die() {
echo "$@" >&2
exit 1
}
function eval_assignment() {
local varname=$(expr "$1" : '\([^=]*\)=.*')
local value=$(expr "$1" : '[^=]*=\(.*\)')
Expand Down Expand Up @@ -113,11 +118,10 @@
do_build=yes
fi
# Some helpers.
function die() {
echo "$@" >&2
exit 1
}
# Clean before we do anything else.
if test $do_clean = yes; then
rm -rf $script_name.cache tmp bin lib share include
fi
# Read the cache, if present.
function read_cache() {
Expand Down

0 comments on commit 14d0c21

Please sign in to comment.