Patchwork kernel-yocto.bbclass: Delete superfluous creation of ${S}/.git directory

login
register
mail settings
Submitter Robert P. J. Day
Date July 15, 2012, 8:55 p.m.
Message ID <alpine.DEB.2.02.1207151647040.1884@oneiric>
Download mbox | patch
Permalink /patch/32079/
State New
Headers show

Comments

Robert P. J. Day - July 15, 2012, 8:55 p.m.
In do_kernel_checkout(), replace the creation of ${S}/.git with just
the creation of ${S} since the .git subdirectory is created only a few
lines later using a "mv".  Here's the original code:

  rm -rf ${S}
  mkdir -p ${S}/.git

  echo "WARNING. ${WORKDIR}/git is not a bare clone."
  echo "Ensure that the SRC_URI includes the 'bareclone=1' option."

  # we can fix up the kernel repository, but at the least the meta
  # branch must be present. The machine branch may be created later.
  mv ${WORKDIR}/git/.git ${S}    <-- See?  There it is.

There's no functional change here, it's just less confusing.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  yes, i realize this doesn't change anything, but it's potentially
confusing for the code to explicitly create ${S}/.git, shortly before
it whomps over top of that directory anyway.  i spent a couple minutes
puzzling over the above trying to figure out if there was something
subtle happening i didn't understand.



rday
Bruce Ashfield - July 16, 2012, 2:39 a.m.
On Sun, Jul 15, 2012 at 4:55 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> In do_kernel_checkout(), replace the creation of ${S}/.git with just
> the creation of ${S} since the .git subdirectory is created only a few
> lines later using a "mv".  Here's the original code:
>
>   rm -rf ${S}
>   mkdir -p ${S}/.git
>
>   echo "WARNING. ${WORKDIR}/git is not a bare clone."
>   echo "Ensure that the SRC_URI includes the 'bareclone=1' option."
>
>   # we can fix up the kernel repository, but at the least the meta
>   # branch must be present. The machine branch may be created later.
>   mv ${WORKDIR}/git/.git ${S}    <-- See?  There it is.
>
> There's no functional change here, it's just less confusing.
>
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
>
> ---
>
>   yes, i realize this doesn't change anything, but it's potentially
> confusing for the code to explicitly create ${S}/.git, shortly before
> it whomps over top of that directory anyway.  i spent a couple minutes
> puzzling over the above trying to figure out if there was something
> subtle happening i didn't understand.

That block of code, and the one below it used to be the same .. so the extra
mv and create just happened to stay.

There is no need for it, so I've applied your patch.

Cheers,

Bruce

>
>
> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index 48c8974..8e010e0 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -106,7 +106,7 @@ do_kernel_checkout() {
>         if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then
>                 # we build out of {S}, so ensure that ${S} is clean and present
>                 rm -rf ${S}
> -               mkdir -p ${S}/.git
> +               mkdir -p ${S}
>
>                 echo "WARNING. ${WORKDIR}/git is not a bare clone."
>                 echo "Ensure that the SRC_URI includes the 'bareclone=1' option."
>
> rday
>
> --
>
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
>
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 48c8974..8e010e0 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -106,7 +106,7 @@  do_kernel_checkout() {
 	if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then
 		# we build out of {S}, so ensure that ${S} is clean and present
 		rm -rf ${S}
-		mkdir -p ${S}/.git
+		mkdir -p ${S}

 		echo "WARNING. ${WORKDIR}/git is not a bare clone."
 		echo "Ensure that the SRC_URI includes the 'bareclone=1' option."