[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 1/6] Update promptconfaction() to also require package name



Hi Sean,

Sean Finney wrote:

> In order to provide an interface into the conffiles DB API, it's required
> to know the package name that owns the conffile. Since this is a static
> function and the package name is available in all places that the function
> is used, this is a fairly easy fix.

Looks good and sane.

> diff --git a/src/configure.c b/src/configure.c
> index 72d15de..1aa8b6a 100644
> --- a/src/configure.c
> +++ b/src/configure.c
> @@ -554,8 +554,9 @@ suspend(void)
>   * Select what to do with a configuration file.
>   */
>  static enum conffopt
> -promptconfaction(const char *cfgfile, const char *realold, const char *realnew,
> -                 int useredited, int distedited, enum conffopt what)
> +promptconfaction(const char *pkg, const char *cfgfile, const char *realold, 
> +                 const char *realnew, int useredited, int distedited, 
> +                 enum conffopt what)

There is some trailing whitespace here.  If you have time, checking
patches with the sample pre-commit hook (.git/hooks/pre-commit.sample)
or git diff --check can be a help.

But that’s just a nitpick.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

For convenience, the same patch follows, as mangled by "git rebase -f
--whitespace=fix origin/master".

-- %< --
From: Sean Finney <seanius@debian.org>
Date: Wed, 14 Oct 2009 21:23:04 +0200
Subject: [PATCH] Update promptconfaction() to also require package name

In order to provide an interface into the conffiles DB API, it's required
to know the package name that owns the conffile. Since this is a static
function and the package name is available in all places that the function
is used, this is a fairly easy fix.
---
 src/configure.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/configure.c b/src/configure.c
index 72d15de..9ef7ad6 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -61,7 +61,7 @@ static int conffoptcells[2][2] = {
 static void md5hash(struct pkginfo *pkg, char *hashbuf, const char *fn);
 static void showdiff(const char *old, const char *new);
 static void suspend(void);
-static enum conffopt promptconfaction(const char *cfgfile,
+static enum conffopt promptconfaction(const char *pkg, const char *cfgfile,
                                       const char *realold, const char *realnew,
                                       int useredited, int distedited,
                                       enum conffopt what);
@@ -152,7 +152,7 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff)
 	      "deferred_configure '%s' (= '%s') useredited=%d distedited=%d what=%o",
 	      usenode->name, cdr.buf, useredited, distedited, what);
 
-	what = promptconfaction(usenode->name, cdr.buf, cdr2.buf,
+	what = promptconfaction(pkg->name, usenode->name, cdr.buf, cdr2.buf,
 	                        useredited, distedited, what);
 
 	switch (what & ~(cfof_isnew | cfof_userrmd)) {
@@ -554,8 +554,9 @@ suspend(void)
  * Select what to do with a configuration file.
  */
 static enum conffopt
-promptconfaction(const char *cfgfile, const char *realold, const char *realnew,
-                 int useredited, int distedited, enum conffopt what)
+promptconfaction(const char *pkg, const char *cfgfile, const char *realold,
+                 const char *realnew, int useredited, int distedited,
+                 enum conffopt what)
 {
 	const char *s;
 	int c, cc;
-- 
1.6.5.rc1.199.g596ec


Reply to: