summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-06 22:37:49 +0800
committerruki <[email protected]>2020-11-06 22:37:49 +0800
commit8d83314b65dfe66b35b961e220f98a65a5705d62 (patch)
tree1346a59b262840c07a2322d87983d1aa30878d7e
parentb9b7e1f2a07fdf8f54dd1dedb24f744f6c9c3b07 (diff)
improve tips for xrepo/remove and export
-rw-r--r--xmake/actions/require/export.lua11
-rw-r--r--xmake/actions/require/impl/package.lua6
-rw-r--r--xmake/actions/require/uninstall.lua11
3 files changed, 24 insertions, 4 deletions
diff --git a/xmake/actions/require/export.lua b/xmake/actions/require/export.lua
index 045f3f127..dc0943942 100644
--- a/xmake/actions/require/export.lua
+++ b/xmake/actions/require/export.lua
@@ -51,7 +51,16 @@ function main(requires_raw)
print("export: %s%s ok!", instance:name(), instance:version_str() and ("-" .. instance:version_str()) or "")
end
if not packages or #packages == 0 then
- print("local packages not found!")
+ cprint("${bright}packages(%s) not found, maybe they don’t exactly match the configuration.", table.concat(requires_raw, ", "))
+ if os.getenv("XREPO_WORKING") then
+ print("please attempt to export them with `-f/--configs=` option, e.g.")
+ print(" - xrepo export -f \"name=value, ...\" package")
+ print(" - xrepo export -m debug -k shared -f \"name=value, ...\" package")
+ else
+ print("please attempt to export them with `--extra=` option, e.g.")
+ print(" - xmake require --export --extra=\"{configs={...}}\" package")
+ print(" - xmake require --export --extra=\"{debug=true,configs={shared=true}}\" package")
+ end
else
print("output: %s", exportdir)
end
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index ed89cf54f..0782b50c9 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -872,8 +872,10 @@ function export_packages(requires, opt)
name = name .. "_" .. instance:buildhash()
-- export this package
- os.cp(instance:installdir(), path.join(exportdir, name))
- table.insert(packages, instance)
+ if instance:fetch() then
+ os.cp(instance:installdir(), path.join(exportdir, name))
+ table.insert(packages, instance)
+ end
end
return packages
end
diff --git a/xmake/actions/require/uninstall.lua b/xmake/actions/require/uninstall.lua
index 97abd9e3a..eece38b99 100644
--- a/xmake/actions/require/uninstall.lua
+++ b/xmake/actions/require/uninstall.lua
@@ -50,7 +50,16 @@ function main(requires_raw)
print("uninstall: %s%s ok!", instance:name(), instance:version_str() and ("-" .. instance:version_str()) or "")
end
if not packages or #packages == 0 then
- print("local packages not found!")
+ cprint("${bright}packages(%s) not found, maybe they don’t exactly match the configuration.", table.concat(requires_raw, ", "))
+ if os.getenv("XREPO_WORKING") then
+ print("please attempt to remove them with `-f/--configs=` option, e.g.")
+ print(" - xrepo remove -f \"name=value, ...\" package")
+ print(" - xrepo remove -m debug -k shared -f \"name=value, ...\" package")
+ else
+ print("please attempt to uninstall them with `--extra=` option, e.g.")
+ print(" - xmake require --uninstall --extra=\"{configs={...}}\" package")
+ print(" - xmake require --uninstall --extra=\"{debug=true,configs={shared=true}}\" package")
+ end
end
-- leave environment