All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Remove bashisms
@ 2016-09-22  9:33 zhe.he
  2016-09-22 10:04 ` Burton, Ross
  2016-09-27 13:43 ` Burton, Ross
  0 siblings, 2 replies; 5+ messages in thread
From: zhe.he @ 2016-09-22  9:33 UTC (permalink / raw)
  To: openembedded-core

From: "Tim K. Chan" <nirvanatk@gmail.com>

Signed-off-by: Tim K. Chan <nirvanatk@gmail.com>
[
Adjust context
Use Peter Kjellerstedt's simpler guile_cross_config
]
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 meta/classes/systemd.bbclass                       |  4 +--
 meta/classes/update-rc.d.bbclass                   |  6 ++--
 .../resolvconf/resolvconf_1.79.bb                  |  2 +-
 meta/recipes-core/glibc/glibc-package.inc          |  2 +-
 meta/recipes-devtools/guile/guile_2.0.12.bb        | 37 ++++++++++++----------
 meta/recipes-devtools/rpm/rpm_5.4.16.bb            | 13 ++++++--
 6 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index db7873f..7370489 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -28,7 +28,7 @@ if [ -n "$D" ]; then
     OPTS="--root=$D"
 fi
 
-if type systemctl >/dev/null 2>/dev/null; then
+if command -p systemctl >/dev/null 2>/dev/null; then
 	systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
 
 	if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
@@ -44,7 +44,7 @@ if [ -n "$D" ]; then
     OPTS="--root=$D"
 fi
 
-if type systemctl >/dev/null 2>/dev/null; then
+if command -p systemctl >/dev/null 2>/dev/null; then
 	if [ -z "$D" ]; then
 		systemctl stop ${SYSTEMD_SERVICE}
 	fi
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 82b8024..dee80c8 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -15,7 +15,7 @@ updatercd_preinst() {
 if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
 	${INIT_D_DIR}/${INITSCRIPT_NAME} stop
 fi
-if type update-rc.d >/dev/null 2>/dev/null; then
+if command -p update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-f -r $D"
 	else
@@ -26,7 +26,7 @@ fi
 }
 
 updatercd_postinst() {
-if type update-rc.d >/dev/null 2>/dev/null; then
+if command -p update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-r $D"
 	else
@@ -43,7 +43,7 @@ fi
 }
 
 updatercd_postrm() {
-if type update-rc.d >/dev/null 2>/dev/null; then
+if command -p update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-f -r $D"
 	else
diff --git a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
index 8550177..e415445 100644
--- a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
+++ b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
@@ -56,7 +56,7 @@ do_install () {
 
 pkg_postinst_${PN} () {
 	if [ -z "$D" ]; then
-		if command -v systemd-tmpfiles >/dev/null; then
+		if command -p systemd-tmpfiles >/dev/null; then
 			systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/resolvconf.conf
 		elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
 			${sysconfdir}/init.d/populate-volatile.sh update
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 6df8b9e..557f32a 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -206,7 +206,7 @@ glibc_package_preprocess () {
 
 pkg_postinst_nscd () {
 	if [ -z "$D" ]; then
-		if command -v systemd-tmpfiles >/dev/null; then
+		if command -p systemd-tmpfiles >/dev/null; then
 			systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf
 		elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
 			${sysconfdir}/init.d/populate-volatile.sh update
diff --git a/meta/recipes-devtools/guile/guile_2.0.12.bb b/meta/recipes-devtools/guile/guile_2.0.12.bb
index d2fe511..a466d65 100644
--- a/meta/recipes-devtools/guile/guile_2.0.12.bb
+++ b/meta/recipes-devtools/guile/guile_2.0.12.bb
@@ -87,22 +87,27 @@ SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
 
 guile_cross_config() {
 	# this is only for target recipe
-	if [ "${PN}" = "guile" ]
-	then
-	        # Create guile-config returning target values instead of native values
-	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
-        	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
-			> ${B}/guile-config.cross
-	        sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
-			-e 's:",[ \t]*": . ":' \
-			-e 's:" *}, *\\:"):' \
-			-e 's:^.*cachedir.*$::' \
-			-e '/^  (/p' \
-			< ${B}/libguile/libpath.h >> ${B}/guile-config.cross
-	        echo '))' >> ${B}/guile-config.cross
-	        cat ${B}/meta/guile-config >> ${B}/guile-config.cross
-	        install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
-	fi
+	[ "${PN}" = "${BPN}" ] || return 0
+
+	vars=$(sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
+	              -e 's:",[ \t]*": . ":' \
+	              -e 's:" *}, *\\:"):' \
+	              -e 's:^.*cachedir.*$::' \
+	              -e '/^  (/p' \
+	       < ${B}/libguile/libpath.h)
+
+	# Create guile-config returning target values instead of native values
+	install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	cat <<EOF >${B}/guile-config.cross
+#!$(which ${BUILD_SYS}-guile) \\
+--no-auto-compile -e main -s
+!#
+(define %guile-build-info '(
+$vars
+))
+EOF
+	cat ${B}/meta/guile-config >> ${B}/guile-config.cross
+	install ${B}/guile-config.cross ${SYSROOT_DESTDIR}${bindir_crossscripts}/guile-config
 }
 
 # Guile needs the compiled files to be newer than the source, and it won't
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 84adef6..be3b942 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -554,13 +554,22 @@ do_install_append() {
 	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
 
 	# Remove unpackaged files (based on list in rpm.spec)
-	rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+	rm -f ${D}/${libdir}/rpm/Specfile.pm
+	rm -f ${D}/${libdir}/rpm/cpanflute
+	rm -f ${D}/${libdir}/rpm/cpanflute2
+	rm -f ${D}/${libdir}/rpm/rpmdiff
+	rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
+	rm -f ${D}/${libdir}/rpm/sql.prov
+	rm -f ${D}/${libdir}/rpm/sql.req
+	rm -f ${D}/${libdir}/rpm/tcl.req
+	rm -f ${D}/${libdir}/rpm/trpm
 
 	rm -f ${D}/${mandir}/man8/rpmcache.8*
 	rm -f ${D}/${mandir}/man8/rpmgraph.8*
 	rm -f ${D}/${mandir}/*/man8/rpmcache.8*
 	rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
-	rm -rf ${D}/${mandir}/{fr,ko}
+	rm -rf ${D}/${mandir}/fr
+	rm -rf ${D}/${mandir}/ko
 
 	rm -f ${D}/${includedir}/popt.h
 	rm -f ${D}/${libdir}/libpopt.*
-- 
2.8.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Remove bashisms
  2016-09-22  9:33 [PATCH v2] Remove bashisms zhe.he
@ 2016-09-22 10:04 ` Burton, Ross
  2016-09-26  6:54   ` He Zhe
  2016-09-27 13:43 ` Burton, Ross
  1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-09-22 10:04 UTC (permalink / raw)
  To: He Zhe; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

On 22 September 2016 at 10:33, <zhe.he@windriver.com> wrote:

> -if type systemctl >/dev/null 2>/dev/null; then
> +if command -p systemctl >/dev/null 2>/dev/null; then


This doesn't do what you want:

$ type whoami ; echo $?
whoami is /usr/bin/whoami
0
$ type foobar; echo $?
-bash: type: foobar: not found
1

'type' when used with a binary prints the full path (thus the redirect) and
returns success if it was found, error if it wasn't.

$ command -p whoami ; echo $?
ross
0

$ which applyotron
/home/ross/bin/applyotron
$ command -p applyotron
-bash: applyotron: command not found

'command -p' searches for a binary (ignoring any aliases or builtins) in a
hardcoded set of paths as you pass -p (not $PATH, so will fail at rootfs
time) for a binary and executes it if found.  We don't want to look in a
hard-coded set of paths, and we don't want to run the binary, so these
changes are bad.

bash, dash and ash all support type, which is why verify-bashisms has them
on the whitelist as the simplest way of saying "does this binary exist".


        # Remove unpackaged files (based on list in rpm.spec)
> -       rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,
> rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
> +       rm -f ${D}/${libdir}/rpm/Specfile.pm
> +       rm -f ${D}/${libdir}/rpm/cpanflute
> +       rm -f ${D}/${libdir}/rpm/cpanflute2
> +       rm -f ${D}/${libdir}/rpm/rpmdiff
> +       rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
> +       rm -f ${D}/${libdir}/rpm/sql.prov
> +       rm -f ${D}/${libdir}/rpm/sql.req
> +       rm -f ${D}/${libdir}/rpm/tcl.req
> +       rm -f ${D}/${libdir}/rpm/trpm
>

I deleted these in "rpm: remove redundant removals" when doing a similar
sweep, so please rebase to master.

I think all thats left is the guile cleanup, so can you submit just that
with a rewritten commit message.

Ross

[-- Attachment #2: Type: text/html, Size: 3191 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Remove bashisms
  2016-09-22 10:04 ` Burton, Ross
@ 2016-09-26  6:54   ` He Zhe
  0 siblings, 0 replies; 5+ messages in thread
From: He Zhe @ 2016-09-26  6:54 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

OK. I have senta new patch([OE-core] [PATCH] guile: Remove bashisms) for guile as other bashisms have been addressed.

Thanks,
Zhe

On 09/22/2016 06:04 PM, Burton, Ross wrote:
> On 22 September 2016 at 10:33, <zhe.he@windriver.com <mailto:zhe.he@windriver.com>>wrote:
>
>     -if type systemctl >/dev/null 2>/dev/null; then
>     +if command -p systemctl >/dev/null 2>/dev/null; then
>
>
> This doesn't do what you want:
>
> $ type whoami ; echo $?
> whoami is /usr/bin/whoami
> 0
> $ type foobar; echo $?
> -bash: type: foobar: not found
> 1
>
> 'type' when used with a binary prints the full path (thus the redirect) and returns success if it was found, error if it wasn't.
>
> $ command -p whoami ; echo $?
> ross
> 0
>
> $ which applyotron
> /home/ross/bin/applyotron
> $ command -p applyotron
> -bash: applyotron: command not found
>
> 'command -p' searches for a binary (ignoring any aliases or builtins) in a hardcoded set of paths as you pass -p (not $PATH, so will fail at rootfs time) for a binary and executes it if found.  We don't want to look in a hard-coded set of paths, and we don't want to run the binary, so these changes are bad.
>
> bash, dash and ash all support type, which is why verify-bashisms has them on the whitelist as the simplest way of saying "does this binary exist".
>
>
>             # Remove unpackaged files (based on list in rpm.spec)
>     -       rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
>     +       rm -f ${D}/${libdir}/rpm/Specfile.pm
>     +       rm -f ${D}/${libdir}/rpm/cpanflute
>     +       rm -f ${D}/${libdir}/rpm/cpanflute2
>     +       rm -f ${D}/${libdir}/rpm/rpmdiff
>     +       rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
>     +       rm -f ${D}/${libdir}/rpm/sql.prov
>     +       rm -f ${D}/${libdir}/rpm/sql.req
>     +       rm -f ${D}/${libdir}/rpm/tcl.req
>     +       rm -f ${D}/${libdir}/rpm/trpm
>
>
> I deleted these in "rpm: remove redundant removals" when doing a similar sweep, so please rebase to master.
>
> I think all thats left is the guile cleanup, so can you submit just that with a rewritten commit message.
>
> Ross



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Remove bashisms
  2016-09-22  9:33 [PATCH v2] Remove bashisms zhe.he
  2016-09-22 10:04 ` Burton, Ross
@ 2016-09-27 13:43 ` Burton, Ross
  2016-09-29  9:22   ` He Zhe
  1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-09-27 13:43 UTC (permalink / raw)
  To: He Zhe; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 8422 bytes --]

If I apply this and then re-build guile I get this error:

ERROR: guile-2.0.12-r0 do_populate_sysroot: The recipe guile is trying to
install files into a shared area when those files already exist. Those
files and their manifest location are:

 /data/poky-master/tmp-glibc/sysroots/intel-corei7-64/usr/bin/crossscripts/guile-config
 Matched in b''

Ross

On 22 September 2016 at 10:33, <zhe.he@windriver.com> wrote:

> From: "Tim K. Chan" <nirvanatk@gmail.com>
>
> Signed-off-by: Tim K. Chan <nirvanatk@gmail.com>
> [
> Adjust context
> Use Peter Kjellerstedt's simpler guile_cross_config
> ]
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
>  meta/classes/systemd.bbclass                       |  4 +--
>  meta/classes/update-rc.d.bbclass                   |  6 ++--
>  .../resolvconf/resolvconf_1.79.bb                  |  2 +-
>  meta/recipes-core/glibc/glibc-package.inc          |  2 +-
>  meta/recipes-devtools/guile/guile_2.0.12.bb        | 37
> ++++++++++++----------
>  meta/recipes-devtools/rpm/rpm_5.4.16.bb            | 13 ++++++--
>  6 files changed, 39 insertions(+), 25 deletions(-)
>
> diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
> index db7873f..7370489 100644
> --- a/meta/classes/systemd.bbclass
> +++ b/meta/classes/systemd.bbclass
> @@ -28,7 +28,7 @@ if [ -n "$D" ]; then
>      OPTS="--root=$D"
>  fi
>
> -if type systemctl >/dev/null 2>/dev/null; then
> +if command -p systemctl >/dev/null 2>/dev/null; then
>         systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
>
>         if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
> @@ -44,7 +44,7 @@ if [ -n "$D" ]; then
>      OPTS="--root=$D"
>  fi
>
> -if type systemctl >/dev/null 2>/dev/null; then
> +if command -p systemctl >/dev/null 2>/dev/null; then
>         if [ -z "$D" ]; then
>                 systemctl stop ${SYSTEMD_SERVICE}
>         fi
> diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.
> bbclass
> index 82b8024..dee80c8 100644
> --- a/meta/classes/update-rc.d.bbclass
> +++ b/meta/classes/update-rc.d.bbclass
> @@ -15,7 +15,7 @@ updatercd_preinst() {
>  if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
>         ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
>  fi
> -if type update-rc.d >/dev/null 2>/dev/null; then
> +if command -p update-rc.d >/dev/null 2>/dev/null; then
>         if [ -n "$D" ]; then
>                 OPT="-f -r $D"
>         else
> @@ -26,7 +26,7 @@ fi
>  }
>
>  updatercd_postinst() {
> -if type update-rc.d >/dev/null 2>/dev/null; then
> +if command -p update-rc.d >/dev/null 2>/dev/null; then
>         if [ -n "$D" ]; then
>                 OPT="-r $D"
>         else
> @@ -43,7 +43,7 @@ fi
>  }
>
>  updatercd_postrm() {
> -if type update-rc.d >/dev/null 2>/dev/null; then
> +if command -p update-rc.d >/dev/null 2>/dev/null; then
>         if [ -n "$D" ]; then
>                 OPT="-f -r $D"
>         else
> diff --git a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
> b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
> index 8550177..e415445 100644
> --- a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
> +++ b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
> @@ -56,7 +56,7 @@ do_install () {
>
>  pkg_postinst_${PN} () {
>         if [ -z "$D" ]; then
> -               if command -v systemd-tmpfiles >/dev/null; then
> +               if command -p systemd-tmpfiles >/dev/null; then
>                         systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/
> resolvconf.conf
>                 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ];
> then
>                         ${sysconfdir}/init.d/populate-volatile.sh update
> diff --git a/meta/recipes-core/glibc/glibc-package.inc
> b/meta/recipes-core/glibc/glibc-package.inc
> index 6df8b9e..557f32a 100644
> --- a/meta/recipes-core/glibc/glibc-package.inc
> +++ b/meta/recipes-core/glibc/glibc-package.inc
> @@ -206,7 +206,7 @@ glibc_package_preprocess () {
>
>  pkg_postinst_nscd () {
>         if [ -z "$D" ]; then
> -               if command -v systemd-tmpfiles >/dev/null; then
> +               if command -p systemd-tmpfiles >/dev/null; then
>                         systemd-tmpfiles --create
> ${sysconfdir}/tmpfiles.d/nscd.conf
>                 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ];
> then
>                         ${sysconfdir}/init.d/populate-volatile.sh update
> diff --git a/meta/recipes-devtools/guile/guile_2.0.12.bb
> b/meta/recipes-devtools/guile/guile_2.0.12.bb
> index d2fe511..a466d65 100644
> --- a/meta/recipes-devtools/guile/guile_2.0.12.bb
> +++ b/meta/recipes-devtools/guile/guile_2.0.12.bb
> @@ -87,22 +87,27 @@ SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
>
>  guile_cross_config() {
>         # this is only for target recipe
> -       if [ "${PN}" = "guile" ]
> -       then
> -               # Create guile-config returning target values instead of
> native values
> -               install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
> -               echo '#!'`which ${BUILD_SYS}-guile`$'
> \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
> -                       > ${B}/guile-config.cross
> -               sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
> -                       -e 's:",[ \t]*": . ":' \
> -                       -e 's:" *}, *\\:"):' \
> -                       -e 's:^.*cachedir.*$::' \
> -                       -e '/^  (/p' \
> -                       < ${B}/libguile/libpath.h >>
> ${B}/guile-config.cross
> -               echo '))' >> ${B}/guile-config.cross
> -               cat ${B}/meta/guile-config >> ${B}/guile-config.cross
> -               install ${B}/guile-config.cross
> ${STAGING_BINDIR_CROSS}/guile-config
> -       fi
> +       [ "${PN}" = "${BPN}" ] || return 0
> +
> +       vars=$(sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
> +                     -e 's:",[ \t]*": . ":' \
> +                     -e 's:" *}, *\\:"):' \
> +                     -e 's:^.*cachedir.*$::' \
> +                     -e '/^  (/p' \
> +              < ${B}/libguile/libpath.h)
> +
> +       # Create guile-config returning target values instead of native
> values
> +       install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
> +       cat <<EOF >${B}/guile-config.cross
> +#!$(which ${BUILD_SYS}-guile) \\
> +--no-auto-compile -e main -s
> +!#
> +(define %guile-build-info '(
> +$vars
> +))
> +EOF
> +       cat ${B}/meta/guile-config >> ${B}/guile-config.cross
> +       install ${B}/guile-config.cross ${SYSROOT_DESTDIR}${bindir_
> crossscripts}/guile-config
>  }
>
>  # Guile needs the compiled files to be newer than the source, and it won't
> diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
> b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
> index 84adef6..be3b942 100644
> --- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
> +++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
> @@ -554,13 +554,22 @@ do_install_append() {
>         install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh
> ${D}/${libdir}/rpm/perfile_rpmdeps.sh
>
>         # Remove unpackaged files (based on list in rpm.spec)
> -       rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,
> rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
> +       rm -f ${D}/${libdir}/rpm/Specfile.pm
> +       rm -f ${D}/${libdir}/rpm/cpanflute
> +       rm -f ${D}/${libdir}/rpm/cpanflute2
> +       rm -f ${D}/${libdir}/rpm/rpmdiff
> +       rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
> +       rm -f ${D}/${libdir}/rpm/sql.prov
> +       rm -f ${D}/${libdir}/rpm/sql.req
> +       rm -f ${D}/${libdir}/rpm/tcl.req
> +       rm -f ${D}/${libdir}/rpm/trpm
>
>         rm -f ${D}/${mandir}/man8/rpmcache.8*
>         rm -f ${D}/${mandir}/man8/rpmgraph.8*
>         rm -f ${D}/${mandir}/*/man8/rpmcache.8*
>         rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
> -       rm -rf ${D}/${mandir}/{fr,ko}
> +       rm -rf ${D}/${mandir}/fr
> +       rm -rf ${D}/${mandir}/ko
>
>         rm -f ${D}/${includedir}/popt.h
>         rm -f ${D}/${libdir}/libpopt.*
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 11886 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Remove bashisms
  2016-09-27 13:43 ` Burton, Ross
@ 2016-09-29  9:22   ` He Zhe
  0 siblings, 0 replies; 5+ messages in thread
From: He Zhe @ 2016-09-29  9:22 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

Sorry for slow reply.

This is probably caused by the correction of installation path(from ${STAGING_BINDIR_CROSS}/guile-config to ${SYSROOT_DESTDIR}${bindir_crossscripts}/guile-config). do_populate_sysroot helps us install things into ${STAGING_BINDIR_CROSS}/guile-config, we shouldn't do that ourselves. But if we do that and then apply this patch and then rebuild, the system will find they have existed and also find no one installed them(Matched in b''). So this should be a wrong report. This error will not appear if I manually delete guile-config and rebuild or rebuild in a brand new project.

I sent a new one([oe] [meta-oe] [PATCH] Remove bashisms) in 09/27/2016 02:19 PM. Please apply that one if it's OK.

Thanks,
Zhe


On 09/27/2016 09:43 PM, Burton, Ross wrote:
> If I apply this and then re-build guile I get this error:
>
> ERROR: guile-2.0.12-r0 do_populate_sysroot: The recipe guile is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
>    /data/poky-master/tmp-glibc/sysroots/intel-corei7-64/usr/bin/crossscripts/guile-config
>  Matched in b''
>
> Ross
>
> On 22 September 2016 at 10:33, <zhe.he@windriver.com <mailto:zhe.he@windriver.com>>wrote:
>
>     From: "Tim K. Chan" <nirvanatk@gmail.com <mailto:nirvanatk@gmail.com>>
>
>     Signed-off-by: Tim K. Chan <nirvanatk@gmail.com <mailto:nirvanatk@gmail.com>>
>     [
>     Adjust context
>     Use Peter Kjellerstedt's simpler guile_cross_config
>     ]
>     Signed-off-by: He Zhe <zhe.he@windriver.com <mailto:zhe.he@windriver.com>>
>     ---
>      meta/classes/systemd.bbclass                       |  4 +--
>      meta/classes/update-rc.d.bbclass                   |  6 ++--
>      .../resolvconf/resolvconf_1.79.bb <http://resolvconf_1.79.bb>                  |  2 +-
>      meta/recipes-core/glibc/glibc-package.inc          |  2 +-
>      meta/recipes-devtools/guile/guile_2.0.12.bb <http://guile_2.0.12.bb>        | 37 ++++++++++++----------
>      meta/recipes-devtools/rpm/rpm_5.4.16.bb <http://rpm_5.4.16.bb>            | 13 ++++++--
>      6 files changed, 39 insertions(+), 25 deletions(-)
>
>     diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
>     index db7873f..7370489 100644
>     --- a/meta/classes/systemd.bbclass
>     +++ b/meta/classes/systemd.bbclass
>     @@ -28,7 +28,7 @@ if [ -n "$D" ]; then
>          OPTS="--root=$D"
>      fi
>
>     -if type systemctl >/dev/null 2>/dev/null; then
>     +if command -p systemctl >/dev/null 2>/dev/null; then
>             systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
>
>             if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
>     @@ -44,7 +44,7 @@ if [ -n "$D" ]; then
>          OPTS="--root=$D"
>      fi
>
>     -if type systemctl >/dev/null 2>/dev/null; then
>     +if command -p systemctl >/dev/null 2>/dev/null; then
>             if [ -z "$D" ]; then
>                     systemctl stop ${SYSTEMD_SERVICE}
>             fi
>     diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
>     index 82b8024..dee80c8 100644
>     --- a/meta/classes/update-rc.d.bbclass
>     +++ b/meta/classes/update-rc.d.bbclass
>     @@ -15,7 +15,7 @@ updatercd_preinst() {
>      if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
>             ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
>      fi
>     -if type update-rc.d >/dev/null 2>/dev/null; then
>     +if command -p update-rc.d >/dev/null 2>/dev/null; then
>             if [ -n "$D" ]; then
>                     OPT="-f -r $D"
>             else
>     @@ -26,7 +26,7 @@ fi
>      }
>
>      updatercd_postinst() {
>     -if type update-rc.d >/dev/null 2>/dev/null; then
>     +if command -p update-rc.d >/dev/null 2>/dev/null; then
>             if [ -n "$D" ]; then
>                     OPT="-r $D"
>             else
>     @@ -43,7 +43,7 @@ fi
>      }
>
>      updatercd_postrm() {
>     -if type update-rc.d >/dev/null 2>/dev/null; then
>     +if command -p update-rc.d >/dev/null 2>/dev/null; then
>             if [ -n "$D" ]; then
>                     OPT="-f -r $D"
>             else
>     diff --git a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb <http://resolvconf_1.79.bb>b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb <http://resolvconf_1.79.bb>
>     index 8550177..e415445 100644
>     --- a/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb <http://resolvconf_1.79.bb>
>     +++ b/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb <http://resolvconf_1.79.bb>
>     @@ -56,7 +56,7 @@ do_install () {
>
>      pkg_postinst_${PN} () {
>             if [ -z "$D" ]; then
>     -               if command -v systemd-tmpfiles >/dev/null; then
>     +               if command -p systemd-tmpfiles >/dev/null; then
>                             systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/resolvconf.conf
>                     elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
>                             ${sysconfdir}/init.d/populate-volatile.sh update
>     diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
>     index 6df8b9e..557f32a 100644
>     --- a/meta/recipes-core/glibc/glibc-package.inc
>     +++ b/meta/recipes-core/glibc/glibc-package.inc
>     @@ -206,7 +206,7 @@ glibc_package_preprocess () {
>
>      pkg_postinst_nscd () {
>             if [ -z "$D" ]; then
>     -               if command -v systemd-tmpfiles >/dev/null; then
>     +               if command -p systemd-tmpfiles >/dev/null; then
>                             systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf
>                     elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
>                             ${sysconfdir}/init.d/populate-volatile.sh update
>     diff --git a/meta/recipes-devtools/guile/guile_2.0.12.bb <http://guile_2.0.12.bb>b/meta/recipes-devtools/guile/guile_2.0.12.bb <http://guile_2.0.12.bb>
>     index d2fe511..a466d65 100644
>     --- a/meta/recipes-devtools/guile/guile_2.0.12.bb <http://guile_2.0.12.bb>
>     +++ b/meta/recipes-devtools/guile/guile_2.0.12.bb <http://guile_2.0.12.bb>
>     @@ -87,22 +87,27 @@ SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
>
>      guile_cross_config() {
>             # this is only for target recipe
>     -       if [ "${PN}" = "guile" ]
>     -       then
>     -               # Create guile-config returning target values instead of native values
>     -               install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
>     -               echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
>     -                       > ${B}/guile-config.cross
>     -               sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
>     -                       -e 's:",[ \t]*": . ":' \
>     -                       -e 's:" *}, *\\:"):' \
>     -                       -e 's:^.*cachedir.*$::' \
>     -                       -e '/^  (/p' \
>     -                       < ${B}/libguile/libpath.h >> ${B}/guile-config.cross
>     -               echo '))' >> ${B}/guile-config.cross
>     -               cat ${B}/meta/guile-config >> ${B}/guile-config.cross
>     -               install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
>     -       fi
>     +       [ "${PN}" = "${BPN}" ] || return 0
>     +
>     +       vars=$(sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
>     +                     -e 's:",[ \t]*": . ":' \
>     +                     -e 's:" *}, *\\:"):' \
>     +                     -e 's:^.*cachedir.*$::' \
>     +                     -e '/^  (/p' \
>     +              < ${B}/libguile/libpath.h)
>     +
>     +       # Create guile-config returning target values instead of native values
>     +       install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
>     +       cat <<EOF >${B}/guile-config.cross
>     +#!$(which ${BUILD_SYS}-guile) \\
>     +--no-auto-compile -e main -s
>     +!#
>     +(define %guile-build-info '(
>     +$vars
>     +))
>     +EOF
>     +       cat ${B}/meta/guile-config >> ${B}/guile-config.cross
>     +       install ${B}/guile-config.cross ${SYSROOT_DESTDIR}${bindir_crossscripts}/guile-config
>      }
>
>      # Guile needs the compiled files to be newer than the source, and it won't
>     diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb <http://rpm_5.4.16.bb>b/meta/recipes-devtools/rpm/rpm_5.4.16.bb <http://rpm_5.4.16.bb>
>     index 84adef6..be3b942 100644
>     --- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb <http://rpm_5.4.16.bb>
>     +++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb <http://rpm_5.4.16.bb>
>     @@ -554,13 +554,22 @@ do_install_append() {
>             install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
>
>             # Remove unpackaged files (based on list in rpm.spec)
>     -       rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
>     +       rm -f ${D}/${libdir}/rpm/Specfile.pm
>     +       rm -f ${D}/${libdir}/rpm/cpanflute
>     +       rm -f ${D}/${libdir}/rpm/cpanflute2
>     +       rm -f ${D}/${libdir}/rpm/rpmdiff
>     +       rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
>     +       rm -f ${D}/${libdir}/rpm/sql.prov
>     +       rm -f ${D}/${libdir}/rpm/sql.req
>     +       rm -f ${D}/${libdir}/rpm/tcl.req
>     +       rm -f ${D}/${libdir}/rpm/trpm
>
>             rm -f ${D}/${mandir}/man8/rpmcache.8*
>             rm -f ${D}/${mandir}/man8/rpmgraph.8*
>             rm -f ${D}/${mandir}/*/man8/rpmcache.8*
>             rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
>     -       rm -rf ${D}/${mandir}/{fr,ko}
>     +       rm -rf ${D}/${mandir}/fr
>     +       rm -rf ${D}/${mandir}/ko
>
>             rm -f ${D}/${includedir}/popt.h
>             rm -f ${D}/${libdir}/libpopt.*
>     --
>     2.8.1
>
>     --
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-29  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22  9:33 [PATCH v2] Remove bashisms zhe.he
2016-09-22 10:04 ` Burton, Ross
2016-09-26  6:54   ` He Zhe
2016-09-27 13:43 ` Burton, Ross
2016-09-29  9:22   ` He Zhe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.