oscam-emu / oscam-patched

Open Source Cam Emulator
GNU General Public License v3.0
6 stars 6 forks source link

Revision number #4

Closed WXbet closed 2 months ago

WXbet commented 2 months ago

Hi @nautilus7, at this time we have (as workaroud) a virtual revison number counting in oscam official. See: https://github.com/oscam-emu/oscam-patched/blob/master/config.sh#L713-L718 This breaks now, because oscam-patched does not have the same commit count as the orginal repo.

Do you have an idea how to manage this? Short resolution is to change the offset here + 2 (and increment it with every additional commit in oscam-patched that oscam official does not have)

But the main issue came from oscam official. There we have no pipeline setup until now to use another revision number generation approach. Maybe we should create an issue in gitlab and discuss the oscam way there...

nautilus7 commented 2 months ago

Whatever offset we use won't work. The offset is relative to the commits made in gitlab and should be changed every time we merge from gitlab. And of course it has to remain the same when we do emu only commits.

Can't think of an idea right now....

nautilus7 commented 2 months ago

Do you have an idea how to manage this? Short resolution is to change the offset here + 2 (and increment it with every additional commit in oscam-patched that oscam official does not have)

How to count commits? How to change the offset? With an additional commit? It becomes much complicated....

WXbet commented 2 months ago

I know, we need a resolution in gitlab. So long we can use this here in oscam-patched's config.sh:

    '-r'|'--oscam-revision')
        offset=1103 #difference between last svn revision number and git commit count (without merge commits) + 1
        emucommits=2 #count of emu commit that are not exists in offical oscam repository
        revision=`git rev-list --no-merges --count HEAD`
        emuversion=`grep EMU_VERSION module-emulator-osemu.h | awk '{ print $3 }'`
        echo $(($offset + $revision - $emucommits))-$emuversion
        break

Variable emucommits has to be incremented with every emu special commit. That's it. When this change will be committed the variable emucommits must be set to 3.

nautilus7 commented 2 months ago

That's what I mean... So we need to change two "versions" now? emucommits and emu version... Let alone if we make a commit to the workflow files, we need to change the code in oscam? Doesn't make sense...

WXbet commented 2 months ago

Yep, you are right. That's ugly.

nautilus7 commented 2 months ago

It needs some thinking...

WXbet commented 2 months ago

I'm tending to use tags in official git. I think we can automated this on worklow/pipeline on master to tag each commit automatically. config.sh the get the correkt revision information from git tag, thats it. No file hassels...

nautilus7 commented 2 months ago

That would be great! This means create a tag for every commit, right?

WXbet commented 2 months ago

Yes, right. In this way: https://docs.gitlab.com/ee/api/tags.html

WXbet commented 2 months ago

@nautilus7: The offset variable has to be removed here: https://github.com/oscam-emu/oscam-patched/blob/master/config.sh#L721

nautilus7 commented 2 months ago

fixed with 7c3b3357ece53624a64318f25a879431eb68060a and 8a3c2de963ddaac690fec766919a14c5b566b500