Programmatically force release (Rpm-list Digest, Vol 252, Issue 2)

Pierre-Gildas MILLON pg.millon at gmail.com
Mon Mar 9 10:29:37 UTC 2015


Hi,

Many thanks for the quick answer.

I managed to do what I wanted with both your idea and a comment on a bug
https://bugzilla.redhat.com/show_bug.cgi?id=540807.

--- build.sh ---
...
RPM_RELEASE=$(rpm -q --qf '%{RELEASE}\n' --specfile SPECS/repo.spec | head
-n 1)
if [[ "$RPM_RELEASE" == *SNAPSHOT ]]; then
  RPM_RELEASE="${RPM_RELEASE}-$(date +%Y%m%d-%H%M%S)"
fi
...
rpmbuild ... --define="release_flags ${RPM_RELEASE//-/_}"

--- test.spec ---
...
Release:        SNAPSHOT%{?release_flags}
...

--- $ rpm -qip
RPMS/noarch/test-1.5.0-SNAPSHOTSNAPSHOT_20150309_112521.noarch.rpm ---
...
Release     : SNAPSHOTSNAPSHOT_20150309_112521

Many thanks for your help !

Regards,

Pierre-Gildas MILLON


Le lun. 9 mars 2015 à 11:18, ?ukasz Stelmach <l.stelmach at samsung.com> a
écrit :

> It was <2015-03-05 czw 15:13>, when Pierre-Gildas MILLON wrote:
> > Hi people,
> >
> > I'm trying to reproduce maven's philosophy with snapshots when building
> my
> > RPM :
> >
> > if release endswith SNAPSHOT then
> >     release = concat(release, "-", timestamp)
> >
> > I tried something like this without any result :
> >
> > test.spec :
> > Release:        SNAPSHOT
> > %{?force_release: %define release %{force_release}}
> > ...
> >
> > rpmbuild -ba --define="force_release SNAPSHOT-$TIMESTAMP"
>
> Take a look here
>
> https://git.tizen.org/cgit/platform/upstream/systemd.git/
> tree/packaging/systemd.spec
>
> at release_flags and with_kdbus.
>
> --
> ?ukasz Stelmach
> Samsung R&D Institute Poland
> Samsung Electronics
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 489 bytes
> Desc: not available
> URL: <http://lists.rpm.org/pipermail/rpm-list/
> attachments/20150305/afe0d7f9/attachment-0001.asc>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20150309/77a08c24/attachment.html>


More information about the Rpm-list mailing list