Mailinglist Archive: opensuse-packaging (214 mails)
| < Previous | Next > |
Re: [opensuse-packaging] RPM version question
- From: Cristian Rodríguez <crrodriguez@xxxxxxxxxxxx>
- Date: Sun, 17 Oct 2010 13:27:10 -0300
- Message-id: <4CBB23DE.6000701@xxxxxxxxxxxx>
El 17/10/10 12:42, Boris Manojlovic escribió:
I just improved it a bit, now it uses the "last commit" date as reference date and not the current time, and also sets tarball mtime accordingly.
#!/usr/bin/env bash
GIT_DATE=$(git log HEAD -n 1 --format=%cD)
DATE=$(date --universal +%Y%m%d%H%M -d "${GIT_DATE}")
NAME=$1
VERSION=$2
git archive --prefix=${NAME}-${VERSION}_git${DATE}/ HEAD | xz -9 > ${NAME}-${VERSION}_git${DATE}.tar.xz
touch -c -t "${DATE}" ${NAME}-${VERSION}_git${DATE}.tar.xz
hth.
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
P.S. "Scriptlet" for making git snapshot is nice one ;)
I just improved it a bit, now it uses the "last commit" date as reference date and not the current time, and also sets tarball mtime accordingly.
#!/usr/bin/env bash
GIT_DATE=$(git log HEAD -n 1 --format=%cD)
DATE=$(date --universal +%Y%m%d%H%M -d "${GIT_DATE}")
NAME=$1
VERSION=$2
git archive --prefix=${NAME}-${VERSION}_git${DATE}/ HEAD | xz -9 > ${NAME}-${VERSION}_git${DATE}.tar.xz
touch -c -t "${DATE}" ${NAME}-${VERSION}_git${DATE}.tar.xz
hth.
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
| < Previous | Next > |