Skip to contentSkip to conversation

stat: add the recipe from oe-core

PATCH In review Yi Zhao 3 participants 6 messages Jan 3, 2018

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/1 stat: add the recipe from oe-core

The stat hasn't any update since 2002. All modern Linux distributions use stat from coreutils as default. It is no longer needed by oe-core. Move it to meta-oe.

---
 .../stat/stat-3.3/fix-error-return.patch           | 16 +++++
 .../stat/stat-3.3/fix-security-format.patch        | 68 ++++++++++++++++++++++
 meta-oe/recipes-extended/stat/stat_3.3.bb          | 35 +++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
 create mode 100644 meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
 create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch new file +16 -0
new file mode 100644
index 0000000..032995d
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <[email protected]>
+
+--- stat-3.3/stat.c.orig	2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c	2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+-    exit(1);
++    exit(0);
+ }
+   
+ 
meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +68 -0

68 lines not on this page · raw message

meta-oe/recipes-extended/stat/stat_3.3.bb new file +35 -0
new file mode 100644
index 0000000..8ac8e89
@@ -0,0 +1,35 @@
+SUMMARY = "Command line file status display utility"
+HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/"
+DESCRIPTION = "Displays all information about a file that the stat() call provides and all information about a filesystem that statfs() provides."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
+                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+           file://fix-security-format.patch \
+           file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+	install -d ${D}${base_bindir} ${D}${mandir}/man1
+	install -m 755 stat ${D}${base_bindir}/stat.stat
+	install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
Signature · 1 line
2.7.4
#1 lore raw

Is there any compelling reason to include it in meta-oe at all? It seems like dropping it altogether would be a better approach.

-Derek

Quoted 173 lines · Yi Zhao

The stat hasn't any update since 2002. All modern Linux distributions use stat from coreutils as default. It is no longer needed by oe-core. Move it to meta-oe.

---
 .../stat/stat-3.3/fix-error-return.patch           | 16 +++++
 .../stat/stat-3.3/fix-security-format.patch        | 68
++++++++++++++++++++++
 meta-oe/recipes-extended/stat/stat_3.3.bb          | 35 +++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-error-return.patch
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-security-format.patch
 create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch new file +16 -0
new file mode 100644
index 0000000..032995d
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <[email protected]>
+
+--- stat-3.3/stat.c.orig       2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c    2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+-    exit(1);
++    exit(0);
+ }
+
+
meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +6 -0
new file mode 100644
index 0000000..0c01ed0
@@ -0,0 +1,68 @@
+stat: Fixing security formatting issues
+
+Fix security formatting issues related to printf without NULL argument
+
+stat.c: In function 'print_human_access':
+stat.c:292:13: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+     printf (access);
+             ^
+stat.c: In function 'print_human_time':
+stat.c:299:57: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+   if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+                                                         ^
+stat.c: In function 'print_it':
+stat.c:613:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +3 -0
+      printf(b);
+      ^
+stat.c:642:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +51 -0
+      printf(b);
+      ^
+
+[YOCTO #9550]
+[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550]
+
+Upstream-Status: Pending
+
+Signed-off-by: Edwin Plauchu <[email protected]>
+
+diff --git a/stat.c b/stat.c
+index 1ed07a9..2be6f62 100644
+--- a/stat.c
++++ b/stat.c
+@@ -289,15 +289,15 @@ void print_human_access(struct stat *statbuf)
+     default:
+       access[0] = '?';
+     }
+-    printf (access);
++    fputs(access,stdout);
+ }
+
+ void print_human_time(time_t *t)
+ {
+   char str[40];
+
+-  if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+-  else printf("Cannot calculate human readable time, sorry");
++  if (strftime(str, 40, "%c", localtime(t)) > 0) fputs(str,stdout);
++  else fputs("Cannot calculate human readable time, sorry",stdout);
+ }
+
+ /* print statfs info */
+@@ -610,7 +610,7 @@ void print_it(char *masterformat, char *filename,
+       {
+           strcpy (pformat, "%");
+           *m++ = '\0';
+-          printf(b);
++          fputs(b,stdout);
+
+           /* copy all format specifiers to our format string */
+           while (isdigit(*m) || strchr("#0-+. I", *m))
+@@ -639,7 +639,7 @@ void print_it(char *masterformat, char *filename,
+       }
+       else
+       {
+-          printf(b);
++          fputs(b,stdout);
+           b = NULL;
+       }
+     }
meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
new file mode 100644
index 0000000..8ac8e89
@@ -0,0 +1,35 @@
+SUMMARY = "Command line file status display utility"
+HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/"
+DESCRIPTION = "Displays all information about a file that the stat() call

provides and all information about a filesystem that statfs() provides."

meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631

\

meta-oe/recipes-extended/stat/stat_3.3.bb new file +8 -0
+                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+           file://fix-security-format.patch \
+           file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547

a02824f6359acd3ef3f944b2c4c2d1ee09"

meta-oe/recipes-extended/stat/stat_3.3.bb new file +21 -1
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+       install -d ${D}${base_bindir} ${D}${mandir}/man1
+       install -m 755 stat ${D}${base_bindir}/stat.stat
+       install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

author
#2 lore raw
Quoted 1 line · Derek Straka

Is there any compelling reason to include it in meta-oe at all?  It seems like dropping it altogether would be a better approach.

I have no objection  to drop it. But I'm not sure if someone else use it ...

Yi

Quoted 195 lines

-Derek

On Tue, Jan 2, 2018 at 7:58 PM, Yi Zhao <[email protected] <mailto:[email protected]>> wrote:

    The stat hasn't any update since 2002. All modern Linux distributions
    use stat from coreutils as default. It is no longer needed by oe-core.
    Move it to meta-oe.

    Signed-off-by: Yi Zhao <[email protected]
    <mailto:[email protected]>>
    ---
     .../stat/stat-3.3/fix-error-return.patch           | 16 +++++
     .../stat/stat-3.3/fix-security-format.patch        | 68
    ++++++++++++++++++++++
     meta-oe/recipes-extended/stat/stat_3.3.bb <http://stat_3.3.bb>  
          | 35 +++++++++++
     3 files changed, 119 insertions(+)
     create mode 100644
    meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
     create mode 100644
    meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
     create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
    <http://stat_3.3.bb>

    diff --git
    a/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
    b/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
    new file mode 100644
    index 0000000..032995d
    --- /dev/null
    +++ b/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
    @@ -0,0 +1,16 @@
    +This patch fixies the wrong return code of stat -h.
    +
    +Upstream-Status: Pending
    +Signed-off-by: Zhangle Yang <[email protected]
    <mailto:[email protected]>>
    +
    +--- stat-3.3/stat.c.orig       2013-08-22 10:49:45.000000000 +0800
    ++++ stat-3.3/stat.c    2013-08-22 10:50:31.000000000 +0800
    +@@ -845,7 +845,7 @@
    +     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
    +     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
    +     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
    +-    exit(1);
    ++    exit(0);
    + }
    +
    +
    diff --git
    a/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
    b/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
    new file mode 100644
    index 0000000..0c01ed0
    --- /dev/null
    +++ b/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
    @@ -0,0 +1,68 @@
    +stat: Fixing security formatting issues
    +
    +Fix security formatting issues related to printf without NULL
    argument
    +
    +stat.c: In function 'print_human_access':
    +stat.c:292:13: error: format not a string literal and no format
    arguments [-Werror=format-security]
    +     printf (access);
    +             ^
    +stat.c: In function 'print_human_time':
    +stat.c:299:57: error: format not a string literal and no format
    arguments [-Werror=format-security]
    +   if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
    +                                                         ^
    +stat.c: In function 'print_it':
    +stat.c:613:6: error: format not a string literal and no format
    arguments [-Werror=format-security]
    +      printf(b);
    +      ^
    +stat.c:642:6: error: format not a string literal and no format
    arguments [-Werror=format-security]
    +      printf(b);
    +      ^
    +
    +[YOCTO #9550]
    +[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550
    <https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550>]
    +
    +Upstream-Status: Pending
    +
    +Signed-off-by: Edwin Plauchu <[email protected]
    <mailto:[email protected]>>
    +
    +diff --git a/stat.c b/stat.c
    +index 1ed07a9..2be6f62 100644
    +--- a/stat.c
    ++++ b/stat.c
    +@@ -289,15 +289,15 @@ void print_human_access(struct stat *statbuf)
    +     default:
    +       access[0] = '?';
    +     }
    +-    printf (access);
    ++    fputs(access,stdout);
    + }
    +
    + void print_human_time(time_t *t)
    + {
    +   char str[40];
    +
    +-  if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
    +-  else printf("Cannot calculate human readable time, sorry");
    ++  if (strftime(str, 40, "%c", localtime(t)) > 0) fputs(str,stdout);
    ++  else fputs("Cannot calculate human readable time, sorry",stdout);
    + }
    +
    + /* print statfs info */
    +@@ -610,7 +610,7 @@ void print_it(char *masterformat, char *filename,
    +       {
    +           strcpy (pformat, "%");
    +           *m++ = '\0';
    +-          printf(b);
    ++          fputs(b,stdout);
    +
    +           /* copy all format specifiers to our format string */
    +           while (isdigit(*m) || strchr("#0-+. I", *m))
    +@@ -639,7 +639,7 @@ void print_it(char *masterformat, char *filename,
    +       }
    +       else
    +       {
    +-          printf(b);
    ++          fputs(b,stdout);
    +           b = NULL;
    +       }
    +     }
    diff --git a/meta-oe/recipes-extended/stat/stat_3.3.bb
    <http://stat_3.3.bb> b/meta-oe/recipes-extended/stat/stat_3.3.bb
    <http://stat_3.3.bb>
    new file mode 100644
    index 0000000..8ac8e89
    --- /dev/null
    +++ b/meta-oe/recipes-extended/stat/stat_3.3.bb <http://stat_3.3.bb>
    @@ -0,0 +1,35 @@
    +SUMMARY = "Command line file status display utility"
    +HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/
    <http://www.ibiblio.org/pub/Linux/utils/file/>"
    +DESCRIPTION = "Displays all information about a file that the
    stat() call provides and all information about a filesystem that
    statfs() provides."
    +SECTION = "console/utils"
    +LICENSE = "GPLv2"
    +LIC_FILES_CHKSUM =
    "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
    +                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
    +
    +SRC_URI =
    "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz
    <http://www.ibiblio.org/pub/Linux/utils/file/$%7BBP%7D.tar.gz> \
    +           file://fix-security-format.patch \
    +           file://fix-error-return.patch"
    +
    +SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
    +SRC_URI[sha256sum] =
    "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
    +
    +EXTRA_OEMAKE = "-e MAKEFLAGS="
    +
    +do_install() {
    +       install -d ${D}${base_bindir} ${D}${mandir}/man1
    +       install -m 755 stat ${D}${base_bindir}/stat.stat
    +       install -m 644 stat.1 ${D}${mandir}/man1
    +}
    +
    +inherit update-alternatives
    +
    +ALTERNATIVE_${PN} = "stat"
    +ALTERNATIVE_PRIORITY[stat] = "200"
    +ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
    +ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
    +
    +ALTERNATIVE_${PN}-doc = "stat.1"
    +ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
    +
    +BBCLASSEXTEND = "native"
    +
    --
    2.7.4

    --
    _______________________________________________
    Openembedded-devel mailing list
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-devel
    <http://lists.openembedded.org/mailman/listinfo/openembedded-devel>
#3 lore raw

Makes sense. I'm all for letting someone add it back if they'd like to use it over coreutils (understanding that it isn't maintained), but we can let others chime in.

-Derek

Quoted 196 lines · Yi Zhao

在 2018年01月03日 09:20, Derek Straka 写道:

Is there any compelling reason to include it in meta-oe at all? It seems like dropping it altogether would be a better approach.

I have no objection to drop it. But I'm not sure if someone else use it
...

Yi

-Derek

Quoted 174 lines · Yi Zhao

The stat hasn't any update since 2002. All modern Linux distributions use stat from coreutils as default. It is no longer needed by oe-core. Move it to meta-oe.

---
 .../stat/stat-3.3/fix-error-return.patch           | 16 +++++
 .../stat/stat-3.3/fix-security-format.patch        | 68
++++++++++++++++++++++
 meta-oe/recipes-extended/stat/stat_3.3.bb          | 35 +++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-error-return.patch
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-security-format.patch
 create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch new file +16 -0
new file mode 100644
index 0000000..032995d
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <[email protected]>
+
+--- stat-3.3/stat.c.orig       2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c    2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+-    exit(1);
++    exit(0);
+ }
+
+
meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +6 -0
new file mode 100644
index 0000000..0c01ed0
@@ -0,0 +1,68 @@
+stat: Fixing security formatting issues
+
+Fix security formatting issues related to printf without NULL argument
+
+stat.c: In function 'print_human_access':
+stat.c:292:13: error: format not a string literal and no format

arguments [-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+     printf (access);
+             ^
+stat.c: In function 'print_human_time':
+stat.c:299:57: error: format not a string literal and no format

arguments [-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+   if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+                                                         ^
+stat.c: In function 'print_it':
+stat.c:613:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +3 -0
+      printf(b);
+      ^
+stat.c:642:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +51 -0
+      printf(b);
+      ^
+
+[YOCTO #9550]
+[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550]
+
+Upstream-Status: Pending
+
+Signed-off-by: Edwin Plauchu <[email protected]>
+
+diff --git a/stat.c b/stat.c
+index 1ed07a9..2be6f62 100644
+--- a/stat.c
++++ b/stat.c
+@@ -289,15 +289,15 @@ void print_human_access(struct stat *statbuf)
+     default:
+       access[0] = '?';
+     }
+-    printf (access);
++    fputs(access,stdout);
+ }
+
+ void print_human_time(time_t *t)
+ {
+   char str[40];
+
+-  if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+-  else printf("Cannot calculate human readable time, sorry");
++  if (strftime(str, 40, "%c", localtime(t)) > 0) fputs(str,stdout);
++  else fputs("Cannot calculate human readable time, sorry",stdout);
+ }
+
+ /* print statfs info */
+@@ -610,7 +610,7 @@ void print_it(char *masterformat, char *filename,
+       {
+           strcpy (pformat, "%");
+           *m++ = '\0';
+-          printf(b);
++          fputs(b,stdout);
+
+           /* copy all format specifiers to our format string */
+           while (isdigit(*m) || strchr("#0-+. I", *m))
+@@ -639,7 +639,7 @@ void print_it(char *masterformat, char *filename,
+       }
+       else
+       {
+-          printf(b);
++          fputs(b,stdout);
+           b = NULL;
+       }
+     }
meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
new file mode 100644
index 0000000..8ac8e89
@@ -0,0 +1,35 @@
+SUMMARY = "Command line file status display utility"
+HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/"
+DESCRIPTION = "Displays all information about a file that the stat()

call provides and all information about a filesystem that statfs() provides."

meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631

\

meta-oe/recipes-extended/stat/stat_3.3.bb new file +8 -0
+                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+           file://fix-security-format.patch \
+           file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f0854

7a02824f6359acd3ef3f944b2c4c2d1ee09"

meta-oe/recipes-extended/stat/stat_3.3.bb new file +21 -1
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+       install -d ${D}${base_bindir} ${D}${mandir}/man1
+       install -m 755 stat ${D}${base_bindir}/stat.stat
+       install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

author
#4 lore raw
Quoted 1 line · Derek Straka

Makes sense.  I'm all for letting someone add it back if they'd like to use it over coreutils (understanding that it isn't maintained), but we can let others chime in.

Sounds good to me.

Yi

Quoted 229 lines

-Derek

On Tue, Jan 2, 2018 at 8:38 PM, Yi Zhao <[email protected] <mailto:[email protected]>> wrote:

    在 2018年01月03日 09:20, Derek Straka 写道:
Quoted 2 lines

Is there any compelling reason to include it in meta-oe at all? It seems like dropping it altogether would be a better approach.

I have no objection  to drop it. But I'm not sure if someone else use it ...

Yi

Quoted 210 lines
    -Derek

    On Tue, Jan 2, 2018 at 7:58 PM, Yi Zhao <[email protected]
    <mailto:[email protected]>> wrote:

        The stat hasn't any update since 2002. All modern Linux
        distributions
        use stat from coreutils as default. It is no longer needed by
        oe-core.
        Move it to meta-oe.

        Signed-off-by: Yi Zhao <[email protected]
        <mailto:[email protected]>>
        ---
         .../stat/stat-3.3/fix-error-return.patch          | 16 +++++
         .../stat/stat-3.3/fix-security-format.patch       | 68
        ++++++++++++++++++++++
         meta-oe/recipes-extended/stat/stat_3.3.bb
        <http://stat_3.3.bb>         | 35 +++++++++++
         3 files changed, 119 insertions(+)
         create mode 100644
        meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
         create mode 100644
        meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
         create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
        <http://stat_3.3.bb>

        diff --git
        a/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
        b/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
        new file mode 100644
        index 0000000..032995d
        --- /dev/null
        +++
        b/meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch
        @@ -0,0 +1,16 @@
        +This patch fixies the wrong return code of stat -h.
        +
        +Upstream-Status: Pending
        +Signed-off-by: Zhangle Yang <[email protected]
        <mailto:[email protected]>>
        +
        +--- stat-3.3/stat.c.orig       2013-08-22 10:49:45.000000000
        +0800
        ++++ stat-3.3/stat.c    2013-08-22 10:50:31.000000000 +0800
        +@@ -845,7 +845,7 @@
        +     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
        +     fprintf(stderr, "\t\t%%C - Security context in
        SE-Linux\n");
        +     fprintf(stderr, "\t\t%%d - Free file nodes in file
        system\n");
        +-    exit(1);
        ++    exit(0);
        + }
        +
        +
        diff --git
        a/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
        b/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
        new file mode 100644
        index 0000000..0c01ed0
        --- /dev/null
        +++
        b/meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch
        @@ -0,0 +1,68 @@
        +stat: Fixing security formatting issues
        +
        +Fix security formatting issues related to printf without
        NULL argument
        +
        +stat.c: In function 'print_human_access':
        +stat.c:292:13: error: format not a string literal and no
        format arguments [-Werror=format-security]
        +     printf (access);
        +             ^
        +stat.c: In function 'print_human_time':
        +stat.c:299:57: error: format not a string literal and no
        format arguments [-Werror=format-security]
        +   if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
        +            ^
        +stat.c: In function 'print_it':
        +stat.c:613:6: error: format not a string literal and no
        format arguments [-Werror=format-security]
        +      printf(b);
        +      ^
        +stat.c:642:6: error: format not a string literal and no
        format arguments [-Werror=format-security]
        +      printf(b);
        +      ^
        +
        +[YOCTO #9550]
        +[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550
        <https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550>]
        +
        +Upstream-Status: Pending
        +
        +Signed-off-by: Edwin Plauchu
        <[email protected]
        <mailto:[email protected]>>
        +
        +diff --git a/stat.c b/stat.c
        +index 1ed07a9..2be6f62 100644
        +--- a/stat.c
        ++++ b/stat.c
        +@@ -289,15 +289,15 @@ void print_human_access(struct stat
        *statbuf)
        +     default:
        +       access[0] = '?';
        +     }
        +-    printf (access);
        ++    fputs(access,stdout);
        + }
        +
        + void print_human_time(time_t *t)
        + {
        +   char str[40];
        +
        +-  if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
        +-  else printf("Cannot calculate human readable time, sorry");
        ++  if (strftime(str, 40, "%c", localtime(t)) > 0)
        fputs(str,stdout);
        ++  else fputs("Cannot calculate human readable time,
        sorry",stdout);
        + }
        +
        + /* print statfs info */
        +@@ -610,7 +610,7 @@ void print_it(char *masterformat, char
        *filename,
        +       {
        +           strcpy (pformat, "%");
        +           *m++ = '\0';
        +-          printf(b);
        ++          fputs(b,stdout);
        +
        +           /* copy all format specifiers to our format string */
        +           while (isdigit(*m) || strchr("#0-+. I", *m))
        +@@ -639,7 +639,7 @@ void print_it(char *masterformat, char
        *filename,
        +       }
        +       else
        +       {
        +-          printf(b);
        ++          fputs(b,stdout);
        +           b = NULL;
        +       }
        +     }
        diff --git a/meta-oe/recipes-extended/stat/stat_3.3.bb
        <http://stat_3.3.bb>
        b/meta-oe/recipes-extended/stat/stat_3.3.bb <http://stat_3.3.bb>
        new file mode 100644
        index 0000000..8ac8e89
        --- /dev/null
        +++ b/meta-oe/recipes-extended/stat/stat_3.3.bb
        <http://stat_3.3.bb>
        @@ -0,0 +1,35 @@
        +SUMMARY = "Command line file status display utility"
        +HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/
        <http://www.ibiblio.org/pub/Linux/utils/file/>"
        +DESCRIPTION = "Displays all information about a file that
        the stat() call provides and all information about a
        filesystem that statfs() provides."
        +SECTION = "console/utils"
        +LICENSE = "GPLv2"
        +LIC_FILES_CHKSUM =
        "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
        + file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
        +
        +SRC_URI =
        "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz
        <http://www.ibiblio.org/pub/Linux/utils/file/$%7BBP%7D.tar.gz> \
        + file://fix-security-format.patch \
        + file://fix-error-return.patch"
        +
        +SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
        +SRC_URI[sha256sum] =
        "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
        +
        +EXTRA_OEMAKE = "-e MAKEFLAGS="
        +
        +do_install() {
        +       install -d ${D}${base_bindir} ${D}${mandir}/man1
        +       install -m 755 stat ${D}${base_bindir}/stat.stat
        +       install -m 644 stat.1 ${D}${mandir}/man1
        +}
        +
        +inherit update-alternatives
        +
        +ALTERNATIVE_${PN} = "stat"
        +ALTERNATIVE_PRIORITY[stat] = "200"
        +ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
        +ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
        +
        +ALTERNATIVE_${PN}-doc = "stat.1"
        +ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
        +
        +BBCLASSEXTEND = "native"
        +
        --
        2.7.4

        --
        _______________________________________________
        Openembedded-devel mailing list
        [email protected]
        <mailto:[email protected]>
        http://lists.openembedded.org/mailman/listinfo/openembedded-devel
        <http://lists.openembedded.org/mailman/listinfo/openembedded-devel>
#5 lore raw
In reply to Derek Straka
Quoted 3 lines · Derek Straka

Makes sense. I'm all for letting someone add it back if they'd like to use it over coreutils (understanding that it isn't maintained), but we can let others chime in.

meta-oe is not a place to dump recipes for unmaintained software. The recipe will end up failing, getting blacklisted and removed. Let's save the maintainers time. If someone needs it that badly, let them carry it in their own layer.

Philip

Quoted 201 lines

-Derek

Quoted 196 lines · Yi Zhao

在 2018年01月03日 09:20, Derek Straka 写道:

Is there any compelling reason to include it in meta-oe at all? It seems like dropping it altogether would be a better approach.

I have no objection to drop it. But I'm not sure if someone else use it
...

Yi

-Derek

Quoted 174 lines · Yi Zhao

The stat hasn't any update since 2002. All modern Linux distributions use stat from coreutils as default. It is no longer needed by oe-core. Move it to meta-oe.

---
 .../stat/stat-3.3/fix-error-return.patch           | 16 +++++
 .../stat/stat-3.3/fix-security-format.patch        | 68
++++++++++++++++++++++
 meta-oe/recipes-extended/stat/stat_3.3.bb          | 35 +++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-error-return.patch
 create mode 100644 meta-oe/recipes-extended/stat/
stat-3.3/fix-security-format.patch
 create mode 100644 meta-oe/recipes-extended/stat/stat_3.3.bb
meta-oe/recipes-extended/stat/stat-3.3/fix-error-return.patch new file +16 -0
new file mode 100644
index 0000000..032995d
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <[email protected]>
+
+--- stat-3.3/stat.c.orig       2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c    2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+-    exit(1);
++    exit(0);
+ }
+
+
meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +6 -0
new file mode 100644
index 0000000..0c01ed0
@@ -0,0 +1,68 @@
+stat: Fixing security formatting issues
+
+Fix security formatting issues related to printf without NULL argument
+
+stat.c: In function 'print_human_access':
+stat.c:292:13: error: format not a string literal and no format

arguments [-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+     printf (access);
+             ^
+stat.c: In function 'print_human_time':
+stat.c:299:57: error: format not a string literal and no format

arguments [-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +4 -0
+   if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+                                                         ^
+stat.c: In function 'print_it':
+stat.c:613:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +3 -0
+      printf(b);
+      ^
+stat.c:642:6: error: format not a string literal and no format arguments

[-Werror=format-security]

meta-oe/recipes-extended/stat/stat-3.3/fix-security-format.patch new file +51 -0
+      printf(b);
+      ^
+
+[YOCTO #9550]
+[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9550]
+
+Upstream-Status: Pending
+
+Signed-off-by: Edwin Plauchu <[email protected]>
+
+diff --git a/stat.c b/stat.c
+index 1ed07a9..2be6f62 100644
+--- a/stat.c
++++ b/stat.c
+@@ -289,15 +289,15 @@ void print_human_access(struct stat *statbuf)
+     default:
+       access[0] = '?';
+     }
+-    printf (access);
++    fputs(access,stdout);
+ }
+
+ void print_human_time(time_t *t)
+ {
+   char str[40];
+
+-  if (strftime(str, 40, "%c", localtime(t)) > 0) printf(str);
+-  else printf("Cannot calculate human readable time, sorry");
++  if (strftime(str, 40, "%c", localtime(t)) > 0) fputs(str,stdout);
++  else fputs("Cannot calculate human readable time, sorry",stdout);
+ }
+
+ /* print statfs info */
+@@ -610,7 +610,7 @@ void print_it(char *masterformat, char *filename,
+       {
+           strcpy (pformat, "%");
+           *m++ = '\0';
+-          printf(b);
++          fputs(b,stdout);
+
+           /* copy all format specifiers to our format string */
+           while (isdigit(*m) || strchr("#0-+. I", *m))
+@@ -639,7 +639,7 @@ void print_it(char *masterformat, char *filename,
+       }
+       else
+       {
+-          printf(b);
++          fputs(b,stdout);
+           b = NULL;
+       }
+     }
meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
new file mode 100644
index 0000000..8ac8e89
@@ -0,0 +1,35 @@
+SUMMARY = "Command line file status display utility"
+HOMEPAGE = "http://www.ibiblio.org/pub/Linux/utils/file/"
+DESCRIPTION = "Displays all information about a file that the stat()

call provides and all information about a filesystem that statfs() provides."

meta-oe/recipes-extended/stat/stat_3.3.bb new file +3 -0
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631

\

meta-oe/recipes-extended/stat/stat_3.3.bb new file +8 -0
+                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+           file://fix-security-format.patch \
+           file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f0854

7a02824f6359acd3ef3f944b2c4c2d1ee09"

meta-oe/recipes-extended/stat/stat_3.3.bb new file +21 -1
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+       install -d ${D}${base_bindir} ${D}${mandir}/man1
+       install -m 755 stat ${D}${base_bindir}/stat.stat
+       install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
--

2.7.4

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel