Patchwork [STABLE] dockerrpm: fix CentOS 5 RPMs (issue4977)

login
register
mail settings
Submitter Mathias De Maré
Date Jan. 4, 2016, 8:26 p.m.
Message ID <51b021f55c0abba924d3.1451939193@waste.org>
Download mbox | patch
Permalink /patch/12510/
State Accepted
Headers show

Comments

Mathias De Maré - Jan. 4, 2016, 8:26 p.m.
# HG changeset patch
# User Mathias De Maré <mathias.demare@gmail.com>
# Date 1451938919 -3600
#      Mon Jan 04 21:21:59 2016 +0100
# Branch stable
# Node ID 51b021f55c0abba924d3008b8dbabc35116a5a49
# Parent  7c598947fbbd78b26989326c61345c6e46855bdc
dockerrpm: fix CentOS 5 RPMs (issue4977)

The older rpmbuild in CentOS 5 fails if some of the output directories
have not been created yet. This change results in creating those directories.
Augie Fackler - Jan. 5, 2016, 4:31 p.m.
On Mon, Jan 04, 2016 at 02:26:33PM -0600, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare@gmail.com>
> # Date 1451938919 -3600
> #      Mon Jan 04 21:21:59 2016 +0100
> # Branch stable
> # Node ID 51b021f55c0abba924d3008b8dbabc35116a5a49
> # Parent  7c598947fbbd78b26989326c61345c6e46855bdc
> dockerrpm: fix CentOS 5 RPMs (issue4977)
>
> The older rpmbuild in CentOS 5 fails if some of the output directories
> have not been created yet. This change results in creating those directories.

FML. Queued.

>
> diff --git a/contrib/dockerrpm b/contrib/dockerrpm
> --- a/contrib/dockerrpm
> +++ b/contrib/dockerrpm
> @@ -15,6 +15,8 @@
>  RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
>  contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
>
> +mkdir -p $RPMBUILDDIR/{BUILD,SRPMS,RPMS}
> +
>  DSHARED=/mnt/shared
>  $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
>      rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Anton Shestakov - Jan. 5, 2016, 5:03 p.m.
05.01.2016, 04:27, "Mathias De Mar" <mathias.demare@gmail.com>:
> # HG changeset patch
> # User Mathias De Maré <mathias.demare@gmail.com>
> # Date 1451938919 -3600
> # Mon Jan 04 21:21:59 2016 +0100
> # Branch stable
> # Node ID 51b021f55c0abba924d3008b8dbabc35116a5a49
> # Parent 7c598947fbbd78b26989326c61345c6e46855bdc
> dockerrpm: fix CentOS 5 RPMs (issue4977)
>
> The older rpmbuild in CentOS 5 fails if some of the output directories
> have not been created yet. This change results in creating those directories.
>
> diff --git a/contrib/dockerrpm b/contrib/dockerrpm
> --- a/contrib/dockerrpm
> +++ b/contrib/dockerrpm
> @@ -15,6 +15,8 @@
>  RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
>  contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
>
> +mkdir -p $RPMBUILDDIR/{BUILD,SRPMS,RPMS}

I'm not sure if dockerrpm is the best place for this mkdir call. Could we put this into buildrpm? As you can see, dockerrpm calls buildrpm --prepare, which already calls mkdir for SOURCES and SPECS. Also creating BUILD, SRPMS and RPMS there seems logical (and would probably help users running buildrpm on their centos machines).
Mathias De Maré - Jan. 7, 2016, 5:35 a.m.
On Tue, Jan 5, 2016 at 6:03 PM, Anton Shestakov <engored@ya.ru> wrote:

> 05.01.2016, 04:27, "Mathias De Mar" <mathias.demare@gmail.com>:
> > # HG changeset patch
> > # User Mathias De Maré <mathias.demare@gmail.com>
> > # Date 1451938919 -3600
> > # Mon Jan 04 21:21:59 2016 +0100
> > # Branch stable
> > # Node ID 51b021f55c0abba924d3008b8dbabc35116a5a49
> > # Parent 7c598947fbbd78b26989326c61345c6e46855bdc
> > dockerrpm: fix CentOS 5 RPMs (issue4977)
> >
> > The older rpmbuild in CentOS 5 fails if some of the output directories
> > have not been created yet. This change results in creating those
> directories.
> >
> > diff --git a/contrib/dockerrpm b/contrib/dockerrpm
> > --- a/contrib/dockerrpm
> > +++ b/contrib/dockerrpm
> > @@ -15,6 +15,8 @@
> >  RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
> >  contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
> >
> > +mkdir -p $RPMBUILDDIR/{BUILD,SRPMS,RPMS}
>
> I'm not sure if dockerrpm is the best place for this mkdir call. Could we
> put this into buildrpm? As you can see, dockerrpm calls buildrpm --prepare,
> which already calls mkdir for SOURCES and SPECS. Also creating BUILD, SRPMS
> and RPMS there seems logical (and would probably help users running
> buildrpm on their centos machines).
>
Good point. I'll post an additional patch to move it (since this one is
already in the clowncopter).

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -15,6 +15,8 @@ 
 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
 contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
 
+mkdir -p $RPMBUILDDIR/{BUILD,SRPMS,RPMS}
+
 DSHARED=/mnt/shared
 $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
     rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean