Skip to content

Commit 62e367f

Browse files
author
zhengchenxiao
committed
fix:some apps not packaged error
1 parent 6040661 commit 62e367f

File tree

20 files changed

+631
-9
lines changed

20 files changed

+631
-9
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-09 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir, version)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename))
34+
end
35+
36+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do
37+
local filename = path.filename(filepath)
38+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename))
39+
end
40+
41+
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do
42+
local filename = path.filename(filepath)
43+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
44+
end
45+
46+
end

repo/packages/c/cpp/xmake.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ do
3030
on_install("cross@linux,windows", function(package)
3131
local sourcedir_files = path.join(os.curdir(),"apps", "cpp", "*")
3232
local bakdir = path.join(os.curdir())
33+
local items_to_remove = {
34+
"apps",
35+
"assets",
36+
"env.sh",
37+
"README.md",
38+
"repo",
39+
"sdk",
40+
"tools"
41+
}
3342
print("sourcedir_files: " .. sourcedir_files)
3443
print("bakdir: " .. bakdir)
35-
44+
3645
os.cp(sourcedir_files, bakdir)
46+
for _, item in ipairs(items_to_remove) do
47+
local item_path = path.join(bakdir, item)
48+
if os.exists(item_path) then
49+
print("Removing: " .. item_path)
50+
os.rm(item_path)
51+
end
3752

3853
import("package.tools.xmake").install(package)
54+
end
3955
end)
4056

4157
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-09 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir, version)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename))
34+
end
35+
36+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do
37+
local filename = path.filename(filepath)
38+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename))
39+
end
40+
41+
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do
42+
local filename = path.filename(filepath)
43+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
44+
end
45+
46+
end

repo/packages/h/hello/xmake.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,29 @@ do
3030
on_install("cross@linux,windows", function(package)
3131
local sourcedir_files = path.join(os.curdir(),"apps", "hello", "*")
3232
local bakdir = path.join(os.curdir())
33+
local items_to_remove = {
34+
"apps",
35+
"assets",
36+
"env.sh",
37+
"README.md",
38+
"repo",
39+
"sdk",
40+
"tools"
41+
}
3342
print("sourcedir_files: " .. sourcedir_files)
3443
print("bakdir: " .. bakdir)
3544

3645
os.cp(sourcedir_files, bakdir)
46+
for _, item in ipairs(items_to_remove) do
47+
local item_path = path.join(bakdir, item)
48+
if os.exists(item_path) then
49+
print("Removing: " .. item_path)
50+
os.rm(item_path)
51+
end
52+
53+
import("package.tools.xmake").install(package)
54+
end
55+
3756
end)
3857

39-
4058
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-09 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir, version)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename))
34+
end
35+
36+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do
37+
local filename = path.filename(filepath)
38+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename))
39+
end
40+
41+
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do
42+
local filename = path.filename(filepath)
43+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
44+
end
45+
46+
end

repo/packages/p/player/xmake.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ do
3030
on_install("cross@linux,windows", function(package)
3131
local sourcedir_files = path.join(os.curdir(),"apps", "player", "*")
3232
local bakdir = path.join(os.curdir())
33+
local items_to_remove = {
34+
"apps",
35+
"assets",
36+
"env.sh",
37+
"README.md",
38+
"repo",
39+
"sdk",
40+
"tools"
41+
}
3342
print("sourcedir_files: " .. sourcedir_files)
3443
print("bakdir: " .. bakdir)
35-
44+
3645
os.cp(sourcedir_files, bakdir)
46+
for _, item in ipairs(items_to_remove) do
47+
local item_path = path.join(bakdir, item)
48+
if os.exists(item_path) then
49+
print("Removing: " .. item_path)
50+
os.rm(item_path)
51+
end
3752

3853
import("package.tools.xmake").install(package)
54+
end
3955
end)
4056

4157
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-09 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir, version)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename))
34+
end
35+
36+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do
37+
local filename = path.filename(filepath)
38+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename))
39+
end
40+
41+
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do
42+
local filename = path.filename(filepath)
43+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
44+
end
45+
46+
end

repo/packages/s/shm_ping/xmake.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ do
3030
on_install("cross@linux,windows", function(package)
3131
local sourcedir_files = path.join(os.curdir(),"apps", "shm_ping", "*")
3232
local bakdir = path.join(os.curdir())
33+
local items_to_remove = {
34+
"apps",
35+
"assets",
36+
"env.sh",
37+
"README.md",
38+
"repo",
39+
"sdk",
40+
"tools"
41+
}
3342
print("sourcedir_files: " .. sourcedir_files)
3443
print("bakdir: " .. bakdir)
35-
44+
3645
os.cp(sourcedir_files, bakdir)
46+
for _, item in ipairs(items_to_remove) do
47+
local item_path = path.join(bakdir, item)
48+
if os.exists(item_path) then
49+
print("Removing: " .. item_path)
50+
os.rm(item_path)
51+
end
3752

3853
import("package.tools.xmake").install(package)
54+
end
3955
end)
4056

4157
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
-- Licensed under the Apache License, Version 2.0 (the "License");
2+
-- You may not use this file except in compliance with the License.
3+
-- You may obtain a copy of the License at
4+
--
5+
-- http://www.apache.org/licenses/LICENSE-2.0
6+
--
7+
-- Unless required by applicable law or agreed to in writing, software
8+
-- distributed under the License is distributed on an "AS IS" BASIS,
9+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
-- See the License for the specific language governing permissions and
11+
-- limitations under the License.
12+
--
13+
-- Copyright (C) 2023-2023 RT-Thread Development Team
14+
--
15+
-- @author xqyjlj
16+
-- @file deploy.lua
17+
--
18+
-- Change Logs:
19+
-- Date Author Notes
20+
-- ------------ ---------- -----------------------------------------------
21+
-- 2023-05-09 xqyjlj initial version
22+
--
23+
import("rt.rt_utils")
24+
25+
function main(rootfs, installdir, version)
26+
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do
27+
local filename = path.filename(filepath)
28+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename))
29+
end
30+
31+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "bin") .. "/*")) do
32+
local filename = path.filename(filepath)
33+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "bin", filename))
34+
end
35+
36+
for _, filepath in ipairs(os.files(path.join(installdir, "usr", "sbin") .. "/*")) do
37+
local filename = path.filename(filepath)
38+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "usr", "sbin", filename))
39+
end
40+
41+
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do
42+
local filename = path.filename(filepath)
43+
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename))
44+
end
45+
46+
end

repo/packages/s/shm_pong/xmake.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ do
3030
on_install("cross@linux,windows", function(package)
3131
local sourcedir_files = path.join(os.curdir(),"apps", "shm_pong", "*")
3232
local bakdir = path.join(os.curdir())
33+
local items_to_remove = {
34+
"apps",
35+
"assets",
36+
"env.sh",
37+
"README.md",
38+
"repo",
39+
"sdk",
40+
"tools"
41+
}
3342
print("sourcedir_files: " .. sourcedir_files)
3443
print("bakdir: " .. bakdir)
35-
44+
3645
os.cp(sourcedir_files, bakdir)
46+
for _, item in ipairs(items_to_remove) do
47+
local item_path = path.join(bakdir, item)
48+
if os.exists(item_path) then
49+
print("Removing: " .. item_path)
50+
os.rm(item_path)
51+
end
3752

3853
import("package.tools.xmake").install(package)
54+
end
3955
end)
4056

4157
end

0 commit comments

Comments
 (0)