The following commit has been merged in the master branch:
commit 2e9a20901a16a1b3f2b392ad14c321712073b3f1
Author: Guillem Jover <[email protected]>
Date: Mon Sep 5 16:03:21 2011 +0200
libdpkg: Move trig_name_is_illegal to a new trigname module
This detangles the function from the triglib module, avoiding
dpkg-trigger to pull it, and reducing its size.
diff --git a/debian/changelog b/debian/changelog
index 2d96535..f7afd68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -211,6 +211,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
Closes: #639997
* Do not warn on strange timestamps when unpacking with dpkg-deb.
Closes: #639997
+ * Reduce dpkg-trigger binary size by refactoring libdpkg modules so that
+ it does not end up pulling triglib.
[ Updated dpkg translations ]
* German (Sven Joachim). Closes: #620312
diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am
index 7950835..bfd02c1 100644
--- a/lib/dpkg/Makefile.am
+++ b/lib/dpkg/Makefile.am
@@ -62,6 +62,7 @@ libdpkg_a_SOURCES = \
subproc.c \
tarfn.c \
test.h \
+ trigname.c \
triglib.c \
trigdeferred.l \
utils.c \
diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 65efcb6..83bcbf0 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -39,22 +39,6 @@
#include <dpkg/trigdeferred.h>
#include <dpkg/triglib.h>
-const char *
-trig_name_is_illegal(const char *p)
-{
- int c;
-
- if (!*p)
- return _("empty trigger names are not permitted");
-
- while ((c = *p++)) {
- if (c <= ' ' || c >= 0177)
- return _("trigger name contains invalid character");
- }
-
- return NULL;
-}
-
/*========== Recording triggers. ==========*/
static char *triggersdir, *triggersfilefile, *triggersnewfilefile;
diff --git a/lib/dpkg/test/t-macros.c b/lib/dpkg/trigname.c
similarity index 63%
copy from lib/dpkg/test/t-macros.c
copy to lib/dpkg/trigname.c
index 2b19775..7fd88cf 100644
--- a/lib/dpkg/test/t-macros.c
+++ b/lib/dpkg/trigname.c
@@ -1,8 +1,9 @@
/*
* libdpkg - Debian packaging suite library routines
- * t-macros.c - test C support macros
+ * trigname.c - trigger name handling
*
- * Copyright © 2009 Guillem Jover <[email protected]>
+ * Copyright © 2007 Canonical Ltd
+ * Written by Ian Jackson <[email protected]>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,19 +22,21 @@
#include <config.h>
#include <compat.h>
-#include <dpkg/test.h>
-#include <dpkg/macros.h>
+#include <dpkg/i18n.h>
+#include <dpkg/triglib.h>
-static void
-test(void)
+const char *
+trig_name_is_illegal(const char *p)
{
- test_pass(min(10, 30) == 10);
- test_pass(min(30, 10) == 10);
- test_pass(min(0, 10) == 0);
- test_pass(min(-10, 0) == -10);
+ int c;
- test_pass(max(10, 30) == 30);
- test_pass(max(30, 10) == 30);
- test_pass(max(0, 10) == 10);
- test_pass(max(-10, 0) == 0);
+ if (!*p)
+ return _("empty trigger names are not permitted");
+
+ while ((c = *p++)) {
+ if (c <= ' ' || c >= 0177)
+ return _("trigger name contains invalid character");
+ }
+
+ return NULL;
}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f8e4f9b..c7dd704 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -33,6 +33,7 @@ lib/dpkg/subproc.c
lib/dpkg/tarfn.c
lib/dpkg/trigdeferred.l
lib/dpkg/triglib.c
+lib/dpkg/trigname.c
lib/dpkg/utils.c
lib/dpkg/varbuf.c
lib/dpkg/vercmp.c
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]