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=514b761a166bef3acce8e81f6eecd9f57103732a

commit 514b761a166bef3acce8e81f6eecd9f57103732a
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Jul 22 04:59:35 2024 +0200

    dpkg-deb: Print pathname instead of filename and directory in error output
    
    On the code to gather information about the interpreter the error
    calls were printing the filename and directory names separately. Instead
    print them as a pathname as we do in the rest of the codebase.
---
 src/deb/info.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/deb/info.c b/src/deb/info.c
index d2d72cf38..2ff5f1666 100644
--- a/src/deb/info.c
+++ b/src/deb/info.c
@@ -104,8 +104,7 @@ info_spew(const char *debar, const char *dir, const char 
*const *argv)
              debar, component);
       re++;
     } else {
-      ohshite(_("open component '%.255s' (in %.255s) failed in an unexpected 
way"),
-              component, dir);
+      ohshite(_("cannot open file '%.255s'"), controlfile.buf);
     }
   }
   varbuf_destroy(&controlfile);
@@ -172,7 +171,7 @@ info_list(const char *debar, const char *dir)
     varbuf_printf(&controlfile, "%s/%s", dir, cdep->d_name);
 
     if (stat(controlfile.buf, &stab))
-      ohshite(_("cannot stat '%.255s' (in '%.255s')"), cdep->d_name, dir);
+      ohshite(_("cannot get file '%.255s' metadata"), controlfile.buf);
     if (S_ISREG(stab.st_mode)) {
       int exec_mark = (S_IXUSR & stab.st_mode) ? '*' : ' ';
       char *interpreter;
@@ -180,12 +179,12 @@ info_list(const char *debar, const char *dir)
 
       cc = fopen(controlfile.buf, "r");
       if (!cc)
-        ohshite(_("cannot open '%.255s' (in '%.255s')"), cdep->d_name, dir);
+        ohshite(_("cannot open file '%.255s'"), controlfile.buf);
 
       interpreter = info_interpreter(cc, &lines);
 
       if (ferror(cc))
-        ohshite(_("failed to read '%.255s' (in '%.255s')"), cdep->d_name, dir);
+        ohshite(_("cannot read file '%.255s'"), controlfile.buf);
       fclose(cc);
       if (str_is_set(interpreter))
         printf(_(" %7jd bytes, %5d lines   %c  %-20.127s %.127s\n"),
@@ -208,7 +207,7 @@ info_list(const char *debar, const char *dir)
   cc = fopen(controlfile.buf, "r");
   if (!cc) {
     if (errno != ENOENT)
-      ohshite(_("failed to read '%.255s' (in '%.255s')"), CONTROLFILE, dir);
+      ohshite(_("cannot read file '%.255s'"), controlfile.buf);
     warning(_("no 'control' file in control archive!"));
   } else {
     int lines, c;
@@ -224,7 +223,7 @@ info_list(const char *debar, const char *dir)
       putc('\n', stdout);
 
     if (ferror(cc))
-      ohshite(_("failed to read '%.255s' (in '%.255s')"), CONTROLFILE, dir);
+      ohshite(_("cannot read file '%.255s'"), controlfile.buf);
     fclose(cc);
   }
 

-- 
Dpkg.Org's dpkg

Reply via email to