Fwd: [GitHub] build_rpms.py script bailing on git [holland-backup/holland GH-50]

0 views
Skip to first unread message

BJ Dierkes

unread,
Jul 13, 2010, 4:31:04 PM7/13/10
to hollan...@googlegroups.com
How should we handle this? If the script isn't run from a git clone it bails. Was thinking we could:

a) Add an option for '--tarbal' or something to override the git archive tarbal creation

b) Move ./contrib/holland.spec to ./holland.spec where people could build packages with 'rpmbuild -tb holland-1.0.2.tar.gz'


Thoughts?

---
derks

Begin forwarded message:

> From: GitHub <nor...@github.com>
> Date: July 13, 2010 3:17:09 PM CDT
> To: wdie...@5dollarwhitebox.org
> Subject: [GitHub] build_rpms.py script bailing on git [holland-backup/holland GH-50]
>
> gondoi reported an issue:
>
> When downloading the tarball of holland 1.0.2, I attempt to run the build_rpms.py script to create the packages, but git errors out:
>
> [root@hollandcent holland-1.0.2]# python scripts/build_rpms.py
> git archive --prefix=holland-1.0.2/ HEAD > /root/holland-buildroot/SOURCES/holland-1.0.2.tar.gz
> fatal: Not a git repository
>
> View Issue: http://github.com/holland-backup/holland/issues#issue/50

Andrew Garner

unread,
Jul 13, 2010, 4:52:22 PM7/13/10
to hollan...@googlegroups.com
I'm not against moving holland.spec and debian/ to the package root
(at least for source distributions). I think fixing the build_rpms.py
script to handle building a non-git tree would be useful too. I don't
recall how we were doing this before git archive.

~Andy

> --
> WIKI: http://wiki.hollandbackup.org
> CODE: http://github.com/holland-backup
> UNSUBSCRIBE: holland-deve...@googlegroups.com
>

BJ Dierkes

unread,
Jul 13, 2010, 5:10:55 PM7/13/10
to hollan...@googlegroups.com

On Jul 13, 2010, at 3:52 PM, Andrew Garner wrote:

> I'm not against moving holland.spec and debian/ to the package root
> (at least for source distributions). I think fixing the build_rpms.py
> script to handle building a non-git tree would be useful too. I don't
> recall how we were doing this before git archive.
>

I'm pretty sure it just took the 'basedir', determined the version, and copied it to 'some_tmp/hollad-version' and then tar'd it.

---
derks

Andrew Garner

unread,
Jul 13, 2010, 5:28:52 PM7/13/10
to hollan...@googlegroups.com
IIRC, the move to git archive was sparked by my annoyance with the
persistent staging tempdirs the old build_rpms script generated. :)
It would be nice if any solution that has to stage the source tree to
generate a tarball could clean up after itself. We can probably avoid
that altogether by using python tarfile and doing something like:

t = TarFile.open(..., 'w:gz')
t.add(holland_source_tree_root, arcname='holland-${version}/', ...)

I would still prefer git archive when exporting from a git tree, however.

~Andy

BJ Dierkes

unread,
Jul 13, 2010, 5:58:26 PM7/13/10
to hollan...@googlegroups.com

On Jul 13, 2010, at 4:28 PM, Andrew Garner wrote:

> IIRC, the move to git archive was sparked by my annoyance with the
> persistent staging tempdirs the old build_rpms script generated. :)
> It would be nice if any solution that has to stage the source tree to
> generate a tarball could clean up after itself. We can probably avoid
> that altogether by using python tarfile and doing something like:
>

Pretty sure the 'annoyance with the persistent staging tempdirs' is unrelated. That was done to create a tmpdir to work out of (an rpm buildroot).. and was to my knowledge resolved to not annoy you anymore. ;)


> t = TarFile.open(..., 'w:gz')
> t.add(holland_source_tree_root, arcname='holland-${version}/', ...)
>

Sounds find to me.


> I would still prefer git archive when exporting from a git tree, however.
>

As would I ... I was planning on keeping everything the same if ./.git exists.

---
derks


Andrew Garner

unread,
Jul 13, 2010, 11:14:42 PM7/13/10
to hollan...@googlegroups.com
I went ahead and patched scripts/build_rpms.py. This just adds a
--tarball option or just sources the local sources directly if .git
doesn't exist (--tarball overrides git behavior). pretty
straightforward. Feel free to patch further if there are issues.

~Andy

Andrew Garner

unread,
Jul 15, 2010, 10:33:18 PM7/15/10
to hollan...@googlegroups.com
On Tue, Jul 13, 2010 at 3:31 PM, BJ Dierkes
<wdie...@5dollarwhitebox.org> wrote:
> How should we handle this?  If the script isn't run from a git clone it bails.  Was thinking we could:
> b) Move ./contrib/holland.spec to ./holland.spec where people could build packages with 'rpmbuild -tb holland-1.0.2.tar.gz'

We don't need to move this, rpmbuild -tb will still build fine:

$ python scripts/make_release.py
[INFO] created archive holland-1.0.3.tar.gz
$ tar ztvf holland-1.0.3.tar.gz | grep holland.spec
-rw-rw-r-- root/root 22234 2010-07-15 22:27:34
holland-1.0.3/contrib/holland.spec
$ rpmbuild -tb holland-1.0.3.tar.gz
...
Wrote: /home/agarner/redhat/RPMS/noarch/holland-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-common-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-example-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-random-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-mysqldump-1.0.3-2.noarch.rpm
Wrote: /home/agarner/redhat/RPMS/noarch/holland-mysqllvm-1.0.3-2.noarch.rpm
...
+ exit 0

~Andy

BJ Dierkes

unread,
Jul 16, 2010, 2:21:03 AM7/16/10
to hollan...@googlegroups.com

Oh, awesome! I guess rpm just does a find/search for a .spec... I though it had to be in the root dir. That is perfect.

Thanks Andy.

---
derks


Reply all
Reply to author
Forward
0 new messages