diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2016-02-28 11:59:10 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2016-04-20 20:35:13 (GMT) |
commit | 6784792540ffd9eec647c85a984e1af126e79f4f (patch) | |
tree | cdb511d6d5d45251965bf6bfbb9843d194b86fc9 | |
parent | ea511c193cd74b9cd6fae46c6745e38df4c4acb4 (diff) | |
download | mxe-6784792540ffd9eec647c85a984e1af126e79f4f.zip mxe-6784792540ffd9eec647c85a984e1af126e79f4f.tar.gz mxe-6784792540ffd9eec647c85a984e1af126e79f4f.tar.bz2 |
build-pkg: detect broken symlink and removed file
-rwxr-xr-x | tools/build-pkg.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index b3fa217..a5635ca 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -178,6 +178,10 @@ local function fileExists(name) end end +local function isSymlink(name) + return shell(("ls -l %q"):format(name)):sub(1, 1) == "l" +end + local function writeFile(filename, data) local file = io.open(filename, 'w') file:write(data) @@ -450,7 +454,13 @@ local function gitStatus() end file = 'usr/' .. file if not fileExists(file) then - log('Missing file: %q', file) + if status == 'D' then + log('Removed file: %q', file) + elseif isSymlink(file) then + log('Broken symlink: %q', file) + else + log('Missing file: %q', file) + end elseif not isBlacklisted(file) then if status == 'A' then table.insert(new_files, file) |