The following commit has been merged in the master branch:
commit 00c6f6094e4eac93805c695f8e7ddc30c001d05f
Author: Guillem Jover <[email protected]>
Date:   Sun Sep 27 12:58:33 2009 +0200

    dpkg-trigger: Move functions and variables around
    
    Place cmdinfos just before main, and the variables and noawait function
    definitions after usage.

diff --git a/src/trigcmd.c b/src/trigcmd.c
index 9e09810..d76df58 100644
--- a/src/trigcmd.c
+++ b/src/trigcmd.c
@@ -43,30 +43,6 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/myopt.h>
 
-static const char *bypackage, *activate, *admindir = ADMINDIR;
-static int f_noact, f_check;
-
-static void
-noawait(const struct cmdinfo *ci, const char *value)
-{
-       bypackage = "-";
-}
-
-static const struct cmdinfo cmdinfos[] = {
-       { "admindir",        0,   1, NULL,     &admindir },
-       { "by-package",      'f', 1, NULL,     &bypackage },
-       { "no-await",        0,   0, NULL,     &bypackage, noawait },
-       { "no-act",          0,   0, &f_noact, NULL,       NULL, 1 },
-       { "check-supported", 0,   0, &f_check, NULL,       NULL, 1 },
-       { "help",            'h', 0, NULL,     NULL,       helponly },
-       { "version",         0,   0, NULL,     NULL,       versiononly },
-       /* UK spelling */
-       { "licence",         0,   0, NULL,     NULL,       showcopyright },
-       /* US spelling */
-       { "license",         0,   0, NULL,     NULL,       showcopyright },
-       {  NULL  }
-};
-
 const char thisname[] = "dpkg-trigger";
 
 const char printforhelp[] = N_(
@@ -116,9 +92,19 @@ usage(void)
        m_output(stdout, _("<standard output>"));
 }
 
+static const char *admindir = ADMINDIR;
+static int f_noact, f_check;
+
+static const char *bypackage, *activate;
 static int done_trig, ctrig;
 
 static void
+noawait(const struct cmdinfo *ci, const char *value)
+{
+       bypackage = "-";
+}
+
+static void
 yespackage(const char *awname)
 {
        fprintf(trig_new_deferred, " %s", awname);
@@ -178,6 +164,21 @@ do_check(void)
        }
 }
 
+static const struct cmdinfo cmdinfos[] = {
+       { "admindir",        0,   1, NULL,     &admindir },
+       { "by-package",      'f', 1, NULL,     &bypackage },
+       { "no-await",        0,   0, NULL,     &bypackage, noawait },
+       { "no-act",          0,   0, &f_noact, NULL,       NULL, 1 },
+       { "check-supported", 0,   0, &f_check, NULL,       NULL, 1 },
+       { "help",            'h', 0, NULL,     NULL,       helponly },
+       { "version",         0,   0, NULL,     NULL,       versiononly },
+       /* UK spelling */
+       { "licence",         0,   0, NULL,     NULL,       showcopyright },
+       /* US spelling */
+       { "license",         0,   0, NULL,     NULL,       showcopyright },
+       {  NULL  }
+};
+
 int
 main(int argc, const char *const *argv)
 {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to