summaryrefslogtreecommitdiff
path: root/data/ncurses/_metadata/preinst.c
diff options
context:
space:
mode:
Diffstat (limited to 'data/ncurses/_metadata/preinst.c')
-rw-r--r--data/ncurses/_metadata/preinst.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/ncurses/_metadata/preinst.c b/data/ncurses/_metadata/preinst.c
new file mode 100644
index 000000000..2c33ad71d
--- /dev/null
+++ b/data/ncurses/_metadata/preinst.c
@@ -0,0 +1,16 @@
+#include <string.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[]) {
+ if (argc < 2 || (
+ strcmp(argv[1], "install") != 0 && (
+ strcmp(argv[1], "upgrade") != 0 ||
+ strncmp(argv[2], "5.6-", 4) != 0
+ ))) return 0;
+
+ unlink("/usr/lib/_ncurses");
+ if (symlink("/usr/lib/", "/usr/lib/_ncurses") != 0)
+ return 1;
+
+ return 0;
+}