diff options
| author | Lianhao Lu <lianhao.lu@intel.com> | 2011-01-30 12:04:46 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-31 16:58:15 +0000 |
| commit | 5b7e96d852778f1164198040cbd165241ea51e40 (patch) | |
| tree | 15ba66b3f8d919f8411e73233c246482de5dba42 /meta/classes | |
| parent | 21f2dae46b481dbf34f6874ae814dcd23fc86d54 (diff) | |
| download | poky-5b7e96d852778f1164198040cbd165241ea51e40.tar.gz | |
image/package_xx/rootfs_xx.bbclass: move rootfs_xx_log_check().
Move function rootfs_xx_log_check() from rootfs_xx.bbclass to relevant
package_xx.bbclass. (Where xx is rpm/ipk/deb).
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/image.bbclass | 5 | ||||
| -rw-r--r-- | meta/classes/package_deb.bbclass | 20 | ||||
| -rw-r--r-- | meta/classes/package_ipk.bbclass | 20 | ||||
| -rw-r--r-- | meta/classes/package_rpm.bbclass | 20 | ||||
| -rw-r--r-- | meta/classes/rootfs_deb.bbclass | 20 | ||||
| -rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 20 | ||||
| -rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 20 |
7 files changed, 61 insertions, 64 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 8e8d92bdae..14de3e1994 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
| @@ -155,7 +155,6 @@ insert_feed_uris () { | |||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | log_check() { | 157 | log_check() { |
| 158 | set +x | ||
| 159 | for target in $* | 158 | for target in $* |
| 160 | do | 159 | do |
| 161 | lf_path="${WORKDIR}/temp/log.do_$target.${PID}" | 160 | lf_path="${WORKDIR}/temp/log.do_$target.${PID}" |
| @@ -164,14 +163,12 @@ log_check() { | |||
| 164 | 163 | ||
| 165 | if test -e "$lf_path" | 164 | if test -e "$lf_path" |
| 166 | then | 165 | then |
| 167 | rootfs_${IMAGE_PKGTYPE}_log_check $target $lf_path | 166 | ${IMAGE_PKGTYPE}_log_check $target $lf_path |
| 168 | else | 167 | else |
| 169 | echo "Cannot find logfile [$lf_path]" | 168 | echo "Cannot find logfile [$lf_path]" |
| 170 | fi | 169 | fi |
| 171 | echo "Logfile is clean" | 170 | echo "Logfile is clean" |
| 172 | done | 171 | done |
| 173 | |||
| 174 | set -x | ||
| 175 | } | 172 | } |
| 176 | 173 | ||
| 177 | # set '*' as the rootpassword so the images | 174 | # set '*' as the rootpassword so the images |
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 29dcc5c457..2181ce7c22 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
| @@ -67,6 +67,26 @@ python do_package_deb_install () { | |||
| 67 | os.putenv('PATH', path) | 67 | os.putenv('PATH', path) |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | deb_log_check() { | ||
| 71 | target="$1" | ||
| 72 | lf_path="$2" | ||
| 73 | |||
| 74 | lf_txt="`cat $lf_path`" | ||
| 75 | for keyword_die in "E:" | ||
| 76 | do | ||
| 77 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 78 | then | ||
| 79 | echo "log_check: There were error messages in the logfile" | ||
| 80 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 81 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 82 | echo "" | ||
| 83 | do_exit=1 | ||
| 84 | fi | ||
| 85 | done | ||
| 86 | test "$do_exit" = 1 && exit 1 | ||
| 87 | true | ||
| 88 | } | ||
| 89 | |||
| 70 | python do_package_deb () { | 90 | python do_package_deb () { |
| 71 | import re, copy | 91 | import re, copy |
| 72 | import textwrap | 92 | import textwrap |
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index fdf326205b..ba768746ca 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass | |||
| @@ -61,6 +61,26 @@ python package_ipk_install () { | |||
| 61 | raise bb.build.FuncFailed | 61 | raise bb.build.FuncFailed |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | ipk_log_check() { | ||
| 65 | target="$1" | ||
| 66 | lf_path="$2" | ||
| 67 | |||
| 68 | lf_txt="`cat $lf_path`" | ||
| 69 | for keyword_die in "exit 1" "Collected errors" ERR Fail | ||
| 70 | do | ||
| 71 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 72 | then | ||
| 73 | echo "log_check: There were error messages in the logfile" | ||
| 74 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 75 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 76 | echo "" | ||
| 77 | do_exit=1 | ||
| 78 | fi | ||
| 79 | done | ||
| 80 | test "$do_exit" = 1 && exit 1 | ||
| 81 | true | ||
| 82 | } | ||
| 83 | |||
| 64 | # | 84 | # |
| 65 | # Update the Packages index files in ${DEPLOY_DIR_IPK} | 85 | # Update the Packages index files in ${DEPLOY_DIR_IPK} |
| 66 | # | 86 | # |
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 031374c0fc..8891f06ffa 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
| @@ -70,6 +70,26 @@ package_generate_rpm_conf () { | |||
| 70 | printf "\n" >> ${DEPLOY_DIR_RPM}/solvedb.macro | 70 | printf "\n" >> ${DEPLOY_DIR_RPM}/solvedb.macro |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | rpm_log_check() { | ||
| 74 | target="$1" | ||
| 75 | lf_path="$2" | ||
| 76 | |||
| 77 | lf_txt="`cat $lf_path`" | ||
| 78 | for keyword_die in "Cannot find package" "exit 1" ERR Fail | ||
| 79 | do | ||
| 80 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 81 | then | ||
| 82 | echo "log_check: There were error messages in the logfile" | ||
| 83 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 84 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 85 | echo "" | ||
| 86 | do_exit=1 | ||
| 87 | fi | ||
| 88 | done | ||
| 89 | test "$do_exit" = 1 && exit 1 | ||
| 90 | true | ||
| 91 | } | ||
| 92 | |||
| 73 | python write_specfile () { | 93 | python write_specfile () { |
| 74 | import textwrap | 94 | import textwrap |
| 75 | 95 | ||
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index f579b53a82..1335e719f4 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass | |||
| @@ -136,26 +136,6 @@ fakeroot rootfs_deb_do_rootfs () { | |||
| 136 | log_check rootfs | 136 | log_check rootfs |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | rootfs_deb_log_check() { | ||
| 140 | target="$1" | ||
| 141 | lf_path="$2" | ||
| 142 | |||
| 143 | lf_txt="`cat $lf_path`" | ||
| 144 | for keyword_die in "E:" | ||
| 145 | do | ||
| 146 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 147 | then | ||
| 148 | echo "log_check: There were error messages in the logfile" | ||
| 149 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 150 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 151 | echo "" | ||
| 152 | do_exit=1 | ||
| 153 | fi | ||
| 154 | done | ||
| 155 | test "$do_exit" = 1 && exit 1 | ||
| 156 | true | ||
| 157 | } | ||
| 158 | |||
| 159 | remove_packaging_data_files() { | 139 | remove_packaging_data_files() { |
| 160 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} | 140 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} |
| 161 | rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ | 141 | rm -rf ${IMAGE_ROOTFS}/usr/dpkg/ |
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 593a4032f0..07c114e3ab 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
| @@ -82,26 +82,6 @@ fakeroot rootfs_ipk_do_rootfs () { | |||
| 82 | log_check rootfs | 82 | log_check rootfs |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | rootfs_ipk_log_check() { | ||
| 86 | target="$1" | ||
| 87 | lf_path="$2" | ||
| 88 | |||
| 89 | lf_txt="`cat $lf_path`" | ||
| 90 | for keyword_die in "exit 1" "Collected errors" ERR Fail | ||
| 91 | do | ||
| 92 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 93 | then | ||
| 94 | echo "log_check: There were error messages in the logfile" | ||
| 95 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 96 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 97 | echo "" | ||
| 98 | do_exit=1 | ||
| 99 | fi | ||
| 100 | done | ||
| 101 | test "$do_exit" = 1 && exit 1 | ||
| 102 | true | ||
| 103 | } | ||
| 104 | |||
| 105 | rootfs_ipk_write_manifest() { | 85 | rootfs_ipk_write_manifest() { |
| 106 | manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest | 86 | manifest=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest |
| 107 | cp ${IMAGE_ROOTFS}${opkglibdir}/status $manifest | 87 | cp ${IMAGE_ROOTFS}${opkglibdir}/status $manifest |
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 0cea3945ad..26aaa1f8c3 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass | |||
| @@ -231,26 +231,6 @@ EOF | |||
| 231 | fi | 231 | fi |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | rootfs_rpm_log_check() { | ||
| 235 | target="$1" | ||
| 236 | lf_path="$2" | ||
| 237 | |||
| 238 | lf_txt="`cat $lf_path`" | ||
| 239 | for keyword_die in "Cannot find package" "exit 1" ERR Fail | ||
| 240 | do | ||
| 241 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 | ||
| 242 | then | ||
| 243 | echo "log_check: There were error messages in the logfile" | ||
| 244 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | ||
| 245 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | ||
| 246 | echo "" | ||
| 247 | do_exit=1 | ||
| 248 | fi | ||
| 249 | done | ||
| 250 | test "$do_exit" = 1 && exit 1 | ||
| 251 | true | ||
| 252 | } | ||
| 253 | |||
| 254 | remove_packaging_data_files() { | 234 | remove_packaging_data_files() { |
| 255 | rm -rf ${IMAGE_ROOTFS}${rpmlibdir} | 235 | rm -rf ${IMAGE_ROOTFS}${rpmlibdir} |
| 256 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} | 236 | rm -rf ${IMAGE_ROOTFS}${opkglibdir} |
