Commit 1c422312 authored by Timo Teräs's avatar Timo Teräs

apk: new option --no-scripts

to not run any per-package scripts. useful for managing buildroot
when cross-compiling.
parent 462bb3b8
......@@ -66,6 +66,7 @@ static struct apk_option generic_options[] = {
{ 0x108, "repositories-file", "Override repositories file",
required_argument, "REPOFILE" },
{ 0x109, "no-network", "Do not use network (cache is still used)" },
{ 0x113, "no-scripts", "Do not execute any scripts" },
{ 0x111, "overlay-from-stdin", "Read list of overlay files from stdin" },
{ 0x112, "arch", "Use architecture with --root",
required_argument, "ARCH" },
......@@ -409,6 +410,9 @@ int main(int argc, char **argv)
case 0x109:
apk_flags |= APK_NO_NETWORK;
break;
case 0x113:
apk_flags |= APK_NO_SCRIPTS;
break;
case 0x111:
apk_flags |= APK_OVERLAY_FROM_STDIN;
break;
......
......@@ -66,6 +66,7 @@ extern char **apk_argv;
#define APK_INTERACTIVE 0x0400
#define APK_NO_NETWORK 0x1000
#define APK_OVERLAY_FROM_STDIN 0x2000
#define APK_NO_SCRIPTS 0x4000
/* default architecture for APK packages. */
#if defined(__x86_64__)
......
......@@ -995,10 +995,10 @@ void apk_ipkg_run_script(struct apk_installed_package *ipkg,
PKG_VER_PRINTF(pkg),
apk_script_types[type]);
apk_message("Executing %s", &fn[15]);
if (apk_flags & APK_SIMULATE)
if ((apk_flags & (APK_NO_SCRIPTS | APK_SIMULATE)) != 0)
return;
apk_message("Executing %s", &fn[15]);
fd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0755);
if (fd < 0) {
mkdirat(root_fd, "var/cache/misc", 0755);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment