Giter Site home page Giter Site logo

Comments (3)

mcepl avatar mcepl commented on July 22, 2024

Functionally I would expect something like this:

#!/bin/sh
set -eu

usage() {
echo >&2 "$(basename $0): spec-file repo-dir version-base commit-id"
exit 5
}

[ $# -eq 4 ] || usage

SPEC_FILE=$1
REPO=$2
VERSION_BASE=$3
COMMIT_ID=$4

IFS='' VERSION=$VERSION_BASE"git."$(cd $REPO ; git show -q --format=format:%ct.%h $COMMIT_ID)
# Version:        0.8.0~git.1658078013.13abe20b5
sed -i -e 's/^\(Version:[[:blank:]]\+\).*$/\1'$VERSION'/' $SPEC_FILE

from obs-service-set_version.

dcermak avatar dcermak commented on July 22, 2024

Could you elaborate a bit more what you are trying to achieve here? I am not exactly sure what you are expecting from the service.

from obs-service-set_version.

mcepl avatar mcepl commented on July 22, 2024
  1. With #!RemoteAssetUrl: we don’t have _service file anymore, and that’s fine.
  2. For the most time. We don’t have <service name="set_version" mode="buildtime"/> (we truly don’t because, if you have this one-line _service file, the script doesn’t have anywhere to get the metadata from).
  3. This is the ugly workaround which I came with, respectively I have now in the source code git repository this post-checkout hook:
#!/bin/sh
IFS='' VERSION="0.7+git."$(git show -q --format=format:%ct.%h sourcehut/master)
sed -i -e 's/^\(Version:[[:blank:]]\+\).*$/\1'$VERSION'/' $(/bin/ls ../*.spec|head -n1)

but it is an exceedingly ugly hack.

from obs-service-set_version.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.