projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
libopkg: pass PKG_UPGRADE variable to package scripts
[oweals/opkg-lede.git]
/
libopkg
/
pkg.c
diff --git
a/libopkg/pkg.c
b/libopkg/pkg.c
index 64ee70a00c401244e8a8e7c1d0c06a2a142d1250..c75acb6cd2144623fe0457a558619c56c0ec09db 100644
(file)
--- a/
libopkg/pkg.c
+++ b/
libopkg/pkg.c
@@
-1285,6
+1285,12
@@
pkg_run_script(pkg_t *pkg, const char *script, const char *args)
setenv("PKG_ROOT",
pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
+ if (pkg->is_upgrade)
+ setenv("PKG_UPGRADE", "1", 1);
+ else
+ setenv("PKG_UPGRADE", "0", 1);
+
+
if (! file_exists(path)) {
free(path);
return 0;