Skip to content

Commit

Permalink
Add push script to tweak spec file for IBS
Browse files Browse the repository at this point in the history
There are some build differences between the tools for Uyuni and those
for SUSE Manager. Add a push.sh script to apply those changes when
pushing to IBS for SUSE Manager.
  • Loading branch information
cbosdo committed Jan 22, 2024
1 parent 5af59ae commit aae74e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .tito/custom/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os

from tito.builder import Builder
from tito.common import info_out, run_command
from tito.common import info_out, run_command, debug

class SuseGitExtraGenerationBuilder(Builder):

Expand All @@ -28,3 +28,13 @@ def _setup_sources(self):
run_command("cp %s %s/" % (os.path.join(setup_file_dir, filename), self.rpmbuild_sourcedir), True)
self.sources.append(os.path.join(self.rpmbuild_sourcedir, filename))

source_push = os.path.join(setup_file_dir, "push.sh")
if os.path.exists(source_push):
push_path = os.path.join(self.rpmbuild_sourcedir, "push.sh")
run_command("cp %s %s/" % (source_push, self.rpmbuild_sourcedir), True)
self.sources.append(push_path)

run_command(f"sed '/^URL: .*$/aSource10000: push.sh' -i {self.spec_file}")
cleanup = f"\nsed '/^Source10000: push.sh/d' -i $SRPM_PKG_DIR/{self.spec_file_name}"
with open(push_path, "a") as fd:
fd.write(cleanup)
17 changes: 17 additions & 0 deletions push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/bash

# SPDX-FileCopyrightText: 2024 SUSE LLC
#
# SPDX-License-Identifier: Apache-2.0

# This script is called by push-packages-to-obs

OSCAPI=$1
GIT_DIR=$2
PKG_NAME=$3

SRPM_PKG_DIR=$(dirname "$0")

if [ "${OSCAPI}" == "https://api.suse.de" ]; then
sed 's/^tag=%{!?_default_tag:latest}/tag=5.0.0-alpha1/' -i ${SRPM_PKG_DIR}/uyuni-tools.spec
fi

0 comments on commit aae74e4

Please sign in to comment.