You are not logged in.

#1 2013-06-23 12:12:11

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Comparing VCS PKGBUILD versions

Hi

How do you compare versions of 2 PKGBUILD that are using VCS sources ?
Since the pkgversion is auto bumped to last revision/commit and pkgrel reset to 1, how do I know if a PKGBUILD is newer than mine without inspecting every line ?

Offline

#2 2013-06-23 12:17:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

PKGBUILDs don't have versions, packages do. I don't think I understand the question, can you share some examples?
If you have two PKGBUILDs that use different configuration but same upstream VCS source, they should both be current i.e. same version.

Offline

#3 2013-06-23 12:55:34

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

Yes, that's the problem actually.
The problem can happen with users PKGBUILD, like in AUR.
What can happen is :
I get an initial PKGBUILD foo-git, I build and install it.
The maintainer updates it with a better script, other options,etc.. but I don't see it.
I rebuild my local package with the now old PKGBUILD, my pkgversion gets bumped.
Now I check if I have the latest version by comparing my pkgrel with the released PKGBUILD, mine is higher, so I should have the latest PKGBUILD, but I don't...

I thought about using pkgrel for this, but makepkg resets it at each VCS update.

Maybe using epoch ? :\

Last edited by maxi_jac (2013-06-23 12:56:35)

Offline

#4 2013-06-23 13:07:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

These updates should be mentioned in the comments on the package's AUR page. You can always diff the PKGBUILDs.
Using an AUR helper for updating (and not just makepkg) or some script that once in a while downloads the tAURball should help here.

Offline

#5 2013-06-23 16:12:19

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

>These updates should be mentioned in the comments on the package's AUR page. You can always diff the PKGBUILDs.
I should not have to do that.

>Using an AUR helper for updating (and not just makepkg) or some script that once in a while downloads the tAURball should help here.
Yes but it is not how it should work, and updates can still be missed.

Offline

#6 2013-06-23 16:16:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

How are you updating your AUR packages?

Offline

#7 2013-06-23 16:20:51

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,388
Website

Re: Comparing VCS PKGBUILD versions

I don't see how VCS's are relevant to your question.  If you keep old PKGBUILDs locally, and periodically rebuild using those, you wouldn't get any changes that were made in the AUR PKGBUILD regardless of whether it was a VCS pacakge or not.  You've got to download the fresh PKGBUILD even to check version numbers - so just use the PKGBUILD that has been downloaded.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#8 2013-06-23 16:48:33

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

karol wrote:

How are you updating your AUR packages?

cower

Offline

#9 2013-06-23 16:50:07

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

Trilby wrote:

I don't see how VCS's are relevant to your question.

makepkg autobumps versions. Hence we cannot compare installed package with AUR package.

Trilby wrote:

If you keep old PKGBUILDs locally, and periodically rebuild using those, you wouldn't get any changes that were made in the AUR PKGBUILD regardless of whether it was a VCS pacakge or not.  You've got to download the fresh PKGBUILD even to check version numbers - so just use the PKGBUILD that has been downloaded.

Yes but it should not be done that way. As long as there is no update to the PKGBUILD why should I download it again ?

Offline

#10 2013-06-23 16:55:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

I'm not a packaging guru, but have a look at https://aur.archlinux.org/packages/mpv-player-git/
https://aur.archlinux.org/packages/mp/m … t/PKGBUILD

pkgname=mpv-player-git
_gitname="mpv-build"
pkgver=35240

...

pkgver() {
  cd mpv
  # get a plain number
  echo $(git rev-list --count master) 
}

...
$ pacman -Q mpv-player-git
mpv-player-git 34925-1
$ cower -duv
:: Checking alsaequal for updates...

...

:: mpv-player-git downloaded to /home/karol/test/foo

Last edited by karol (2013-06-23 16:57:26)

Offline

#11 2013-06-23 16:57:57

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,712

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:

Yes but it should not be done that way.

You keep saying this over and over. No matter how you think things "should" be done, they are what they are.

Offline

#12 2013-06-23 17:11:26

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,388
Website

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:

As long as there is no update to the PKGBUILD why should I download it again ?

I must be missing something - how could you know there wasn't a change to the PKGBUILD unless you check the PKGBUILD?  You could check the revision date on the AUR page, I suppose.  But again this is the same for non-VCS packages as for VCS packages.  You can't know that it hasn't changed unless you actually check it (manually or programattically).

Are you actually asking how to determine if there's been a change in the VCS source?  That's a different question which has come up before.  I change the code on git for some of my projects at least daily - but I haven't touched the PKGBUILD in the aur for quite some time.  The PKGBUILD has not changed, but the code has.

Last edited by Trilby (2013-06-23 17:13:27)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#13 2013-06-23 17:13:37

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

karol wrote:

I'm not a packaging guru, but have a look at https://aur.archlinux.org/packages/mpv-player-git/
https://aur.archlinux.org/packages/mp/m … t/PKGBUILD

pkgname=mpv-player-git
_gitname="mpv-build"
pkgver=35240

...

pkgver() {
  cd mpv
  # get a plain number
  echo $(git rev-list --count master) 
}

...
$ pacman -Q mpv-player-git
mpv-player-git 34925-1
$ cower -duv
:: Checking alsaequal for updates...

...

:: mpv-player-git downloaded to /home/karol/test/foo

Because here the pkgversion from the PKGBUILD is higher as it is meant to be.

But I think I understand what I am doing that is not the way it is designed: I should not save the PKGBUILD for later rebuilds...

It's a shame though, to me we could use pkgrel just for that (PKGBUILD updates for VCS packages)

Offline

#14 2013-06-23 17:14:55

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

Scimmia wrote:
maxi_jac wrote:

Yes but it should not be done that way.

You keep saying this over and over. No matter how you think things "should" be done, they are what they are.

Welcome to the FOSS world where things can change.

Offline

#15 2013-06-23 17:15:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:

I should not save the PKGBUILD for later rebuilds...

I don't understand this part. cower gets you the whole tAURball, you don't have to keep the old one to compare it.

Offline

#16 2013-06-23 17:16:13

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,712

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:
Scimmia wrote:
maxi_jac wrote:

Yes but it should not be done that way.

You keep saying this over and over. No matter how you think things "should" be done, they are what they are.

Welcome to the FOSS world where things can change.

Right, so submit a patch, don't whine about it.

Offline

#17 2013-06-23 17:17:50

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

Trilby wrote:
maxi_jac wrote:

As long as there is no update to the PKGBUILD why should I download it again ?

I must be missing something - how could you know there wasn't a change to the PKGBUILD unless you check the PKGBUILD?  You could check the revision date on the AUR page, I suppose.  But again this is the same for non-VCS packages as for VCS packages.  You can't know that it hasn't changed unless you actually check it (manually or programattically).

No this is not the same. You build a regular PKGBUILD one day then the next day it is strictly the same. Not true for VCS PKGBUILDs, and worse, the PKGBUILD is edited by makepkg. So you cannot know the "real" version (aka the one it was at when getting it) of the PKGBUILD.

Maybe I should not re-use VCS PKGBUILDs, but maybe makepkg should not edit pkgversion and pkgrel ?

Offline

#18 2013-06-23 17:20:24

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

karol wrote:
maxi_jac wrote:

I should not save the PKGBUILD for later rebuilds...

I don't understand this part. cower gets you the whole tAURball, you don't have to keep the old one to compare it.

What I do:
I use cower to get a foo-git PKGBUILD on my disk, I build it. some days later I go back to where I saved it and rebuild it to get the latest code, this works of course.
Now I cannot know if my PKGBUILD is older or the same as the one in AUR since makepkg edited the versions.

Offline

#19 2013-06-23 17:21:37

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:
Scimmia wrote:
maxi_jac wrote:

Yes but it should not be done that way.

You keep saying this over and over. No matter how you think things "should" be done, they are what they are.

Welcome to the FOSS world where things can change.

I'm not whining, if you have nothing to say please leave the thread, thanks.

Offline

#20 2013-06-23 17:26:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

maxi_jac, please respond to all comments in one post and not bump the thread.
In the last post you forgot to quote Scimmia's last response.

Offline

#21 2013-06-23 17:31:34

maxi_jac
Member
From: France
Registered: 2008-08-02
Posts: 72

Re: Comparing VCS PKGBUILD versions

karol wrote:

maxi_jac, please respond to all comments in one post and not bump the thread.
In the last post you forgot to quote Scimmia's last response.

I don't think I did, I read all of his comments, and moreover non of them were useful.
I will merge my future posts now.

Offline

#22 2013-06-23 17:52:32

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,388
Website

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:

No this is not the same. You build a regular PKGBUILD one day then the next day it is strictly the same. Not true for VCS PKGBUILDs, and worse, the PKGBUILD is edited by makepkg. So you cannot know the "real" version (aka the one it was at when getting it) of the PKGBUILD.

So you *are* talking about my second point.  Even with a non-VCS package you wouldn't know the PKGBUILD in the AUR is the same as the one on your system the next day ... the author could have changed it!  You wouldn't know that unless you actually checked was was currently in the AUR.  The same hold for VCS packages if you are talking about major revisions to the PKGBUILD itself.

But what you are getting at here, is just changes in version number calculated for vcs packages (e.g. a commit number for git package).  In this case you don't need to download a new PKGBUILD.  Run makepkg on the one you already have locally, and it will update the version number based on what is on the VCS source.  These changes wouldn't even be apparent if you re-downloaded the PKGBUILD - not until you ran makepkg on it.

For example, I have alopex-git in the AUR.  My local PKGBUILD originally matched the one on the AUR, but as I made more commits to git, then rebuilt with makepkg (using my local PKGBUILD) the version number was incremented.  Downloading the PKGBUILD from the aur site is irrelevant: when first downloaded, the version number would be much older, but as soon as makepkg ran, it's version number would be incremented just the same as my local copy of the PKGBUILD.

Last edited by Trilby (2013-06-23 17:55:48)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#23 2013-06-23 18:11:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

maxi_jac wrote:
karol wrote:

In the last post you forgot to quote Scimmia's last response.

I don't think I did, I read all of his comments, and moreover non of them were useful.

You responded to his comment

Scimmia wrote:

Right, so submit a patch, don't whine about it.

but did not include it in the quote, so it looks like you're responding to yourself ...



You can use

$ date -d @$(cower --info --format %a mpv-player-git)
Sat Jun 15 23:45:00 CEST 2013

or simply visit the AUR page of the package in question to find out when was it last updated.
You can even get both the diffs and full PKGBUILDs from aur-mirror e.g. http://pkgbuild.com/git/aur-mirror.git/ … player-git

Offline

#24 2013-06-23 18:15:10

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,388
Website

Re: Comparing VCS PKGBUILD versions

I'm really confused now.  That cower command will tell you if the content of the PKGBUILD in the AUR has changed.  But that is different from the vcs source changing.

These are two completely separate questions, and at this point I have no idea which the OP is interested in - as as soon as someone starts addressing one there is a question that leads to the other.

What sorts of changes are you actually trying to detect maxi_jac?

For clarification, one can revise the PKGBUILD and aur tarball without there being any change in the vcs source.  OR, one could commit changes to the vcs source without there being any changes to the PKGBUILD in the AUR.  Detecting either of these are completely different tasks.  The former is what I argued is exactly the same for vcs and other packages: you need to actually check what is in the aur.  The latter *does not* require you to download a new PKGBUILD, as even if you did, it would provide you no such information until you ran makepkg on it.

Last edited by Trilby (2013-06-23 18:17:21)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#25 2013-06-23 18:16:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Comparing VCS PKGBUILD versions

I think he's interested in PKGBUILDs https://bbs.archlinux.org/viewtopic.php … 4#p1291364

Offline

Board footer

Powered by FluxBB