summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/apk.c4
-rw-r--r--src/apk_defines.h1
-rw-r--r--src/package.c4
3 files changed, 7 insertions, 2 deletions
diff --git a/src/apk.c b/src/apk.c
index b91c6e7..8744de6 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -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;
diff --git a/src/apk_defines.h b/src/apk_defines.h
index fbe611c..95b70de 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -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__)
diff --git a/src/package.c b/src/package.c
index e211b63..ca172e9 100644
--- a/src/package.c
+++ b/src/package.c
@@ -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);