[pacman-dev] [PATCH] [makepkg] Print out new version on change
When building sources that have a pkgver() function, makepkg prints: ==> Making package: $pkgname $pkgver-$pkgrel $(date) which, normally, works out fine. Only problem is using vcs sources with a pkgver() function, it will print out the old version. So, if there is an update, the user won't know what version the package changed to till after the build. This patch adds in a line that prints out ==> Updated version from $oldversion to $newversion if the version has changed. Signed-off-by: William Giokas <1007380@gmail.com> --- scripts/makepkg.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2fe6605..ff7296f 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -699,6 +699,7 @@ update_pkgver() { if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE" @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE" + msg "$(gettext "Updated version from %s to %s")" $pkgver $newpkgver source "$BUILDFILE" else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \ -- 1.8.0.1.350.gee26a6e
When building sources that have a pkgver() function, makepkg prints: ==> Making package: $pkgname $pkgver-$pkgrel $(date) which, normally, works out fine. Only problem is using vcs sources with a pkgver() function, it will print out the old version. So, if there is an update, the user won't know what version the package changed to till after the build. This patch adds in a line that prints out ==> Updated version from $oldversion to $newversion if the version has changed. Signed-off-by: William Giokas <1007380@gmail.com> --- scripts/makepkg.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2fe6605..5f2997b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -699,6 +699,7 @@ update_pkgver() { if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE" @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE" + msg "$(gettext "Updated version %s to %s")" $pkgver $newpkgver source "$BUILDFILE" else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \ -- 1.8.0.1.350.gee26a6e
On 06/12/12 14:01, William Giokas wrote:
I'll go for a v3 here! msg "$(gettext "Updated version: %s to %s")" $pkgver $newpkgver Also we want to mention pkgrel here? msg "$(gettext "Updated version: %s-%s to %s-1")" $pkgver $pkgrel $newpkgver Either way, I can make the change when I pull it into my working tree. Allan
On Thu, Dec 06, 2012 at 02:36:17PM +1000, Allan McRae wrote:
Also we want to mention pkgrel here?
msg "$(gettext "Updated version: %s-%s to %s-1")" $pkgver $pkgrel $newpkgver
+1 for this. I hadn't realized that when it updated the version it also updated the pkgrel till today. Heh.
Either way, I can make the change when I pull it into my working tree.
Thanks!
Allan
-- William Giokas | KaiSforza GnuPG Key: 0xE99A7F0F Fingerprint: F078 CFF2 45E8 1E72 6D5A 8653 CDF5 E7A5 E99A 7F0F
When building sources that have a pkgver() function, makepkg prints: ==> Making package: $pkgname $pkgver-$pkgrel $(date) which, normally, works out fine. Only problem is using vcs sources with a pkgver() function, it will print out the old version. So, if there is an update, the user won't know what version the package changed to till after the build. This patch adds in a line that prints out ==> Updated version from $oldversion to $newversion if the version has changed. Because makepkg now supports not having an initial pkgver if there is a pkgver() function, check to see if there is a pkgver set and choose between two less awkward ways of saying that the version is updated and the pkgrel has been reset to 1. Signed-off-by: William Giokas <1007380@gmail.com> --- scripts/makepkg.sh.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2fe6605..d34261b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -699,6 +699,11 @@ update_pkgver() { if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE" @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE" + if [[ -n "$pkgver" ]]; then + msg "$(gettext "Updated version: %s-%s to %s-1")" $pkgver $pkgrel $newpkgver + else + msg "$(gettext "Updated version to %s-1")" $newpkgver + fi source "$BUILDFILE" else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \ -- 1.8.0.1.350.gee26a6e
On 07/12/12 03:21, William Giokas wrote:
So... this misses the epoch (if there is one) when it prints out the version. How about a v4 with. local fullver=$(get_full_version) msg "$(gettext "Updated version: %s")" "$pkgbase $fullver" after the source line below... If you want to print the old version too (is that needed?), then you will need to store the version before and after.
When building sources that have a pkgver() function, makepkg prints: ==> Making package: $pkgname $pkgver-$pkgrel $(date) which, normally, works out fine. Only problem is using vcs sources with a pkgver() function, it will print out the old version. So, if there is an update, the user won't know what version the package changed to till after the build. This patch adds in a line that prints out ==> Updated version: $pkgbase $newversion-1 if the version has changed. $newversion includes epoch and since an update automatically resets the release number to 1, that is printed as well. Signed-off-by: William Giokas <1007380@gmail.com> --- scripts/makepkg.sh.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index d34261b..678ceb1 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -699,11 +699,8 @@ update_pkgver() { if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE" @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE" - if [[ -n "$pkgver" ]]; then - msg "$(gettext "Updated version: %s-%s to %s-1")" $pkgver $pkgrel $newpkgver - else - msg "$(gettext "Updated version to %s-1")" $newpkgver - fi + local fullver=$(get_full_version) + msg "$(gettext "Updated version: %s-1")" "$pkgbase $fullver" source "$BUILDFILE" else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \ -- 1.8.1.rc1.20.g24a62db
On 14/12/12 01:29, William Giokas wrote:
1. this seems to be a patch on top of your old patch 2. fullver will be the old version unless it is done AFTER the source line 3. get_full_version has the pkgrel, so no need for that. 4. with all the changes your patch description does not match the patch
else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \
When building sources with a pkgver function, makepkg will print out the original version before pkgver() is run, claiming that that is the package that will be built. This patch simply re-prints the output later, after pkgver() has been run so people can see which package they are actually building. Signed-off-by: William Giokas <1007380@gmail.com> --- scripts/makepkg.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a5ac59a..f9a4044 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -700,6 +700,8 @@ update_pkgver() { @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE" @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE" source "$BUILDFILE" + local fullver=$(get_full_version) + msg "$(gettext "Updated version: %s")" "$pkgbase $fullver" else warning "$(gettext "%s is not writeable -- pkgver will not be updated")" \ "$BUILDFILE" -- 1.8.1.rc1.20.g24a62db
participants (2)
-
Allan McRae
-
William Giokas