This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=3d614bd27196f4a49ac6fe2807f12838162c5594

commit 3d614bd27196f4a49ac6fe2807f12838162c5594
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Fri Jun 25 14:31:42 2021 +0200

    dpkg: Move the command action enum to its own header file
    
    Several of the dpkg suite tools use the same enum, so it should be
    declared in a non-dpkg specific header file.
    
    Changelog: internal
---
 src/Makefile.am |  3 +++
 src/actions.h   | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/main.h      | 57 +---------------------------------------
 src/querycmd.c  |  2 +-
 src/statcmd.c   |  2 +-
 5 files changed, 87 insertions(+), 58 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 2d3efb9da..4c946a106 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,6 +23,7 @@ bin_PROGRAMS = \
        dpkg-trigger
 
 dpkg_SOURCES = \
+       actions.h \
        archives.c archives.h \
        cleanup.c \
        configure.c \
@@ -55,9 +56,11 @@ dpkg_divert_SOURCES = \
        divertcmd.c
 
 dpkg_query_SOURCES = \
+       actions.h \
        querycmd.c
 
 dpkg_statoverride_SOURCES = \
+       actions.h \
        force.c force.h \
        security-mac.h \
        selinux.c \
diff --git a/src/actions.h b/src/actions.h
new file mode 100644
index 000000000..f2f639ea9
--- /dev/null
+++ b/src/actions.h
@@ -0,0 +1,81 @@
+/*
+ * dpkg - main program for package management
+ * actions.h - command action definition list
+ *
+ * Copyright © 1995 Ian Jackson <ijack...@chiark.greenend.org.uk>
+ * Copyright © 2006, 2008-2016 Guillem Jover <guil...@debian.org>
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef DPKG_ACTIONS_H
+#define DPKG_ACTIONS_H
+
+enum action {
+       act_unset,
+
+       act_unpack,
+       act_configure,
+       act_install,
+       act_triggers,
+       act_remove,
+       act_purge,
+       act_verify,
+       act_commandfd,
+
+       act_status,
+       act_listpackages,
+       act_listfiles,
+       act_searchfiles,
+       act_controlpath,
+       act_controllist,
+       act_controlshow,
+
+       act_cmpversions,
+
+       act_arch_add,
+       act_arch_remove,
+       act_printarch,
+       act_printforeignarches,
+
+       act_assertpredep,
+       act_assertepoch,
+       act_assertlongfilenames,
+       act_assertmulticonrep,
+       act_assertmultiarch,
+       act_assertverprovides,
+       act_assert_protected,
+
+       act_validate_pkgname,
+       act_validate_trigname,
+       act_validate_archname,
+       act_validate_version,
+
+       act_audit,
+       act_unpackchk,
+       act_predeppackage,
+
+       act_getselections,
+       act_setselections,
+       act_clearselections,
+
+       act_avail,
+       act_printavail,
+       act_avclear,
+       act_avreplace,
+       act_avmerge,
+       act_forgetold,
+};
+
+#endif /* DPKG_ACTIONS_H */
diff --git a/src/main.h b/src/main.h
index db98aaaec..abf96272e 100644
--- a/src/main.h
+++ b/src/main.h
@@ -26,6 +26,7 @@
 #include <dpkg/pkg-list.h>
 
 #include "force.h"
+#include "actions.h"
 #include "security-mac.h"
 
 /* These two are defined in <dpkg/fsys.h>. */
@@ -66,62 +67,6 @@ struct perpackagestate {
   struct pkg_list *trigprocdeferred;
 };
 
-enum action {
-       act_unset,
-
-       act_unpack,
-       act_configure,
-       act_install,
-       act_triggers,
-       act_remove,
-       act_purge,
-       act_verify,
-       act_commandfd,
-
-       act_status,
-       act_listpackages,
-       act_listfiles,
-       act_searchfiles,
-       act_controlpath,
-       act_controllist,
-       act_controlshow,
-
-       act_cmpversions,
-
-       act_arch_add,
-       act_arch_remove,
-       act_printarch,
-       act_printforeignarches,
-
-       act_assertpredep,
-       act_assertepoch,
-       act_assertlongfilenames,
-       act_assertmulticonrep,
-       act_assertmultiarch,
-       act_assertverprovides,
-       act_assert_protected,
-
-       act_validate_pkgname,
-       act_validate_trigname,
-       act_validate_archname,
-       act_validate_version,
-
-       act_audit,
-       act_unpackchk,
-       act_predeppackage,
-
-       act_getselections,
-       act_setselections,
-       act_clearselections,
-
-       act_avail,
-       act_printavail,
-       act_avclear,
-       act_avreplace,
-       act_avmerge,
-       act_forgetold,
-};
-
 extern const char *const statusstrings[];
 
 extern int f_robot;
diff --git a/src/querycmd.c b/src/querycmd.c
index fb7f6116e..1c1b56c2a 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -56,7 +56,7 @@
 #include <dpkg/db-ctrl.h>
 #include <dpkg/db-fsys.h>
 
-#include "main.h"
+#include "actions.h"
 
 static const char *showformat = "${binary:Package}\t${Version}\n";
 
diff --git a/src/statcmd.c b/src/statcmd.c
index 7bc5dd000..6ffc95172 100644
--- a/src/statcmd.c
+++ b/src/statcmd.c
@@ -48,7 +48,7 @@
 #include <dpkg/options.h>
 
 #include "force.h"
-#include "main.h"
+#include "actions.h"
 #include "security-mac.h"
 
 static const char printforhelp[] = N_(

-- 
Dpkg.Org's dpkg

Reply via email to