Compare commits

...

23 Commits

Author SHA1 Message Date
404e21a506 autodist-cleanold: clean .autoport/<ARCH> dir 2025-05-03 12:56:28 +02:00
95163933d9 autospec-conf: add devel-kernel and devel-contrib repositories 2025-03-16 10:51:56 +01:00
307f049140 Release 1.6.4 2025-03-16 10:48:58 +01:00
0cddc6bda9 autodist: fix path for fetching distdb and legacy files 2025-03-11 21:31:43 +01:00
efcb5517ba Release 1.6.3 2025-03-11 19:28:02 +01:00
4d4d996432 autodist: retrieve distdb and legacy files from "base" instead of "devel" repository 2025-03-11 19:22:47 +01:00
e952c25d5a Makefile,autoport: use external VERSION file instead of editing autoport file upon make dist command 2025-03-11 19:21:47 +01:00
6773997ebe Release 1.6.2 2025-03-09 21:33:21 +01:00
c868a2dd28 scripts/update-specfile: update patch and debug_package according to rpm 4.20 requirements 2025-03-09 21:31:14 +01:00
d70b96d3e4 webbuild.css: fixes for code wrapping in output box inside pre tag 2025-01-09 12:35:57 +01:00
a5a362641e Release 1.6.1 2025-01-05 18:57:38 +01:00
26a4eb1834 webbuild-sudo: fix syntax in previous commit 2025-01-05 18:49:00 +01:00
78ca53dba2 autodist-git: exclude more binary suffixes from git repositories 2025-01-05 18:32:39 +01:00
23fd85f414 webbuild-sudo: fix defining builddir for %setup without -n argument 2025-01-05 12:24:14 +01:00
ad1c0cad9f Release 1.6.0 2025-01-05 10:37:15 +01:00
95ea4067be webbuild-cgi, webbuild-functions-private: support for "no prep" with checkbox
webbuild-sudo: parse %setup macro to retrieve build dir with rpm 5.20
2025-01-05 10:29:50 +01:00
3a0c8532e0 Release 1.5.6 2024-12-29 20:46:08 +01:00
684bb69379 scripts/update-specfile: remove %debug_package macro from specfiles as required by rpm 4.20 2024-12-29 20:41:40 +01:00
5680a10d1e webbuild-sudo: support for new builddir scheme required by rpm 4.20 2024-12-29 20:41:08 +01:00
b211b80241 autodist-git: syncrepo: archive git repositories for removed packages from local repository 2024-11-07 23:10:46 +01:00
6f20135a8b autodist-git: exclude *.deb from files pushed 2024-11-07 21:51:58 +01:00
5298802d65 autodist-git: add archivepkg option to archive a package repository 2024-11-07 20:32:36 +01:00
ade2fbc122 autodist-git: pylint suggested fixes 2024-11-07 18:44:46 +01:00
12 changed files with 171 additions and 57 deletions

View File

@ -1,5 +1,5 @@
# Makefile for autodist
# Copyright (C) 2006-2021 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2006-2025 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
PACKAGE = autodist
@ -38,7 +38,6 @@ distdir = $(PACKAGE)-$(VERSION)
dist_archive = $(distdir).tar.bz2
default:
@sed -i "s|^VERSION=.*|VERSION=$(VERSION)|" autodist autoport
install-dirs:
@$(INSTALL_DIR) $(DESTDIR)$(configdir)/scripts
@ -91,6 +90,7 @@ install-programs:
@$(INSTALL_SCRIPT) telegram/openmamba_bot.py $(DESTDIR)$(pck_datadir)/openmamba_bot.py
@$(INSTALL_SCRIPT) telegram/requirements.txt $(DESTDIR)$(pck_datadir)/requirements.txt
@$(INSTALL_SCRIPT) repology-openmamba.py $(DESTDIR)$(pck_datadir)/repology-openmamba.py
@$(INSTALL_DATA) VERSION $(DESTDIR)$(pck_datadir)/VERSION
@cp -a webbuild/html/* $(DESTDIR)$(htmldir)
install-data:

View File

@ -1 +1 @@
VERSION = 1.5.5
VERSION=1.6.4

View File

@ -1,18 +1,20 @@
#!/bin/bash
#
# Autodist -- batch build tool for RPM based distributions
# Copyright (C) 2006-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2006-2025 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=1.5.5
me=(${0##*/} $VERSION "Tue Jan 26 2016")
. /usr/share/autodist/VERSION
me=(${0##*/} $VERSION)
exec 3>`readlink /proc/self/fd/0`
BASE_REPOSITORY=base
function usage() {
echo "\
${me[0]} ${me[1]}
"$"Copyright (C) 2006-2016 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Copyright (C) 2006-2025 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Released under the terms of the GNU GPL v3 license"
echo "
"$"Batch build tool for bulding a whole distribution and much more.""
@ -915,10 +917,10 @@ function log_date() {
DISTDBFILES=
DISTDB=`fetch_repository_file ${AUTODIST_REPOSITORY/-*}/distdb`
DISTDB=`fetch_repository_file ${BASE_REPOSITORY}/distdb`
[ "$DISTDB" ] && DISTDBFILES="$DISTDB"
DISTDBARCH=`fetch_repository_file ${AUTODIST_REPOSITORY/-*}/distdb.$TARGETARCH`
DISTDBARCH=`fetch_repository_file ${BASE_REPOSITORY}/distdb.$TARGETARCH`
if [ "$DISTDBARCH" ]; then
DISTDBFILES="$DISTDBFILES $DISTDBARCH"
fi
@ -994,7 +996,7 @@ BUILDSLIST=`fetch_repository_file distromatic/$AUTODIST_REPOSITORY/builds-$TARGE
[ "$AUTODIST_DELAYED_REPOSITORY" ] && BUILDSLIST_DELAYED=`fetch_repository_file distromatic/$AUTODIST_DELAYED_REPOSITORY/builds-$TARGETARCH`
[ $? -eq 0 ] || echo "Warning: unable to fetch $BUILDSLIST">&2
LEGACYLIST=`fetch_repository_file ${AUTODIST_REPOSITORY/-*}/legacy`
LEGACYLIST=`fetch_repository_file ${BASE_REPOSITORY}/legacy`
[ "$LEGACYLIST" ] || LEGACYLIST=$SYSCONFDIR/legacy
[ $? -eq 0 ] || echo "Warning: unable to fetch $LEGACYLIST">&2

View File

@ -13,6 +13,7 @@ function clean() {
[ "$VERBOSE" ] && echo "Cleaning from base directory $dir..."
[ -e $dir/ ] && find $dir/ -mindepth 1 -maxdepth 1 -name "pipe\:\[*" -exec rm -f {} \;
[ -e $dir/RPM/SPECS/ ] && find $dir/RPM/SPECS/ -mindepth 1 -maxdepth 1 -type f -not -name "*.spec*" -exec rm -f {} \;
[ -e $dir/.autoport/${AUTOPORT_ARCH[$i]} ] && find /var/autodist/.autoport/${AUTOPORT_ARCH[$i]} -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -f {} \;
for arch in ${AUTODIST_ARCHS[*]}; do
[ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -mindepth 1 -maxdepth 1 -type f -mtime ${RPMS_CTIME_OLD} -exec rm -f {} \;
done
@ -39,6 +40,7 @@ function clean() {
}
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
[ "${AUTOPORT_DISABLE[$i]}" != "" ] && continue
if [ "${AUTOPORT_CHROOT[$i]}" ]; then
a=${AUTOPORT_CHROOT[$i]}
clean /var/autoport/$a/usr/src
@ -48,6 +50,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
autoport-chroot $a ccache -C
autoport-chroot $a yarn cache clean
elif [ "${AUTOPORT_UPDATE[$i]}" ]; then
clean /var/autodist
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
@ -59,5 +62,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
clean $WORKINGHOME
fi
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
sudo -u ${AUTOPORT_CHROOT_USER[$i]} ccache -C
sudo -u ${AUTOPORT_CHROOT_USER[$i]} yarn cache clean
fi
done

View File

@ -1,16 +1,20 @@
#!/usr/bin/python3
"""
autodist git integration
"""
import argparse
import glob
import os
import re
import rpm
import subprocess
import sys
import tempfile
from shutil import copyfile
from pyrpm.spec import Spec, replace_macros
from gitea import *
from git import Repo
from functools import cmp_to_key
from gitea import Gitea, NotFoundException, Organization, Repository
import rpm
from pyrpm.spec import Spec, replace_macros
from git import Repo
from configobj import ConfigObj
@ -18,9 +22,6 @@ cfg = ConfigObj(infile='/etc/autodist/config-git')
gitea = Gitea(cfg["GITEA_URL"], cfg["GITEA_TOKEN"])
org = Organization.request(gitea, cfg["GITEA_ORGANIZATION"])
# argparse options
options = None
def comparePkgInfo(item1, item2):
return rpm.labelCompare(
(str(item1['e']), item1['v'], item1['r']),
@ -41,6 +42,14 @@ def giteaGetRepository(repo_name):
except NotFoundException:
return None
def giteaGetRepositories(page, limit):
try:
path = f'/orgs/{cfg["GITEA_ORGANIZATION"]}/repos?page={page}&limit={limit}'
results = gitea.requests_get(path)
return [Repository.parse_response(gitea, result) for result in results]
except NotFoundException:
return None
def findOrCreateRepo(pkg_name, pkg_description=None, create=True):
# Replace '+' for repository name as it is not allowed
repo_name = pkg_name.replace('+','Plus')
@ -69,9 +78,29 @@ def findOrCreateRepo(pkg_name, pkg_description=None, create=True):
gitea_repo = giteaGetRepository(repo_name)
return gitea_repo
def commitReleaseFromDir(pkg_info, gitea_repo, repo, temp_dir):
global options
def archiveRepo(pkg_name):
# Replace '+' for repository name as it is not allowed
repo_name = pkg_name.replace('+','Plus')
# Get gitea repository instance
#try:
# gitea_repo = org.get_repository(repo_name)
gitea_repo = giteaGetRepository(repo_name)
if gitea_repo is None:
print(f'archiveRepo: repository {repo_name} not found')
return
if getattr(gitea_repo, "archived"):
print(f'Repository {repo_name} is already archived')
return False
setattr(gitea_repo, "archived", True)
gitea_repo.commit()
return True
def commitReleaseFromDir(options, pkg_info, gitea_repo, repo, temp_dir):
src_dir = pkg_info["src"]
if src_dir.endswith(".src.rpm"):
@ -80,11 +109,11 @@ def commitReleaseFromDir(pkg_info, gitea_repo, repo, temp_dir):
src_temp_dir = tempfile.TemporaryDirectory()
src_dir = src_temp_dir.name
subprocess.run(["autospec", "-x", pkg_info["src"], f'--destdir={src_dir}'],
stdout=subprocess.PIPE)
stdout=subprocess.PIPE, check=False)
# Delete binary source archives
for pattern in [
'*.zip','*.tar.bz2','*.tar.xz','*.tar.gz','*.tgz','*.txz','*.iso',
'*.run','*.dll','*.bin','*.jar','*.msi']:
'*.zip','*.tar.bz2','*.tar.xz','*.tar.gz','*.tar.lz','*.tgz','*.txz',
'*.iso','*.run','*.dll','*.bin','*.jar','*.msi','*.deb','*.rpm']:
for filename in glob.glob(f'{src_dir}/{pattern}'):
os.remove(filename)
@ -145,7 +174,7 @@ def commitReleaseFromDir(pkg_info, gitea_repo, repo, temp_dir):
return
# Create/update README.md
with open(f'{temp_dir.name}/README.md', "w") as readme_file:
with open(file=f'{temp_dir.name}/README.md', mode="w", encoding="utf-8") as readme_file:
readme_file.write(f"# {pkg_info['name']}\n\n{spec_description}")
repo.index.add(['README.md'])
@ -180,9 +209,7 @@ def commitReleaseFromDir(pkg_info, gitea_repo, repo, temp_dir):
repo.create_tag(new_tag, message=f'Release {new_tag}')
#origin.push(new_tag)
def findAndCommitPackageReleases(pkgname, pkgvr):
global options
def findAndCommitPackageReleases(options, pkgname, pkgvr):
print(f'Processing package {pkgname} on {cfg["GITEA_URL"]}...')
pkgs_info = []
@ -190,10 +217,10 @@ def findAndCommitPackageReleases(pkgname, pkgvr):
# Find from archive dir
pkgnamere = pkgname.replace('+','\+')
dirs = [f for f in os.listdir(f'{cfg["ARCHIVE_DIR"]}/{pkgname[0:1]}') if re.match(f'{pkgnamere}-[^-]*-[^-]*$', f)]
for dir in dirs:
pkg_dir = f'{cfg["ARCHIVE_DIR"]}/{pkgname[0:1]}/{dir}'
for _dir in dirs:
pkg_dir = f'{cfg["ARCHIVE_DIR"]}/{pkgname[0:1]}/{_dir}'
spec = Spec.from_file(f'{pkg_dir}/{pkgname}.spec')
parts = re.split(f'{pkgnamere}-([^-]*)-([^-]*)$', dir)
parts = re.split(f'{pkgnamere}-([^-]*)-([^-]*)$', _dir)
epoch = 0 if spec.epoch is None else int(spec.epoch)
version = parts[1]
@ -203,12 +230,12 @@ def findAndCommitPackageReleases(pkgname, pkgvr):
# Find from OLD_DIR
dirs = [f for f in os.listdir(f'{cfg["OLD_DIR"]}') if re.match(f'{pkgnamere}_[0-9]*.[0-9]*$', f)]
for dir in dirs:
srpms_list = glob.glob(f'{cfg["OLD_DIR"]}/{dir}/{pkgname}-*.src.rpm')
for _dir in dirs:
srpms_list = glob.glob(f'{cfg["OLD_DIR"]}/{_dir}/{pkgname}-*.src.rpm')
for srpm in srpms_list:
parts = re.split('.*-([^-]*)-([^-]*).src.rpm$', srpm)
epoch = subprocess.run(['rpm', '-q', '--queryformat=%{epoch}', '-p', srpm],
stdout=subprocess.PIPE).stdout.decode('utf-8')
stdout=subprocess.PIPE, check=False).stdout.decode('utf-8')
# result is "(none)" if no Epoch is set
if len(epoch) > 2:
epoch = "0"
@ -223,7 +250,7 @@ def findAndCommitPackageReleases(pkgname, pkgvr):
src_path = f'{cfg["SRPMS_DIR"]}/{srpm}'
parts = re.split('.*-([^-]*)-([^-]*).src.rpm$', srpm)
epoch = subprocess.run(['rpm', '-q', '--queryformat=%{epoch}', '-p', src_path],
stdout=subprocess.PIPE).stdout.decode('utf-8')
stdout=subprocess.PIPE, check=False).stdout.decode('utf-8')
# result is "(none)" if no Epoch is set
if len(epoch) > 2:
epoch = "0"
@ -266,7 +293,7 @@ def findAndCommitPackageReleases(pkgname, pkgvr):
#exit(1)
#pkg_dir = f'{cfg["ARCHIVE_DIR"]}/{pkgname[0:1]}/{pkgname}-{vr}'
commitReleaseFromDir(pkg_info, gitea_repo, repo, temp_dir)
commitReleaseFromDir(options, pkg_info, gitea_repo, repo, temp_dir)
new_commits = True
if new_commits:
@ -280,7 +307,8 @@ def findAndCommitPackageReleases(pkgname, pkgvr):
def main():
global options
# argparse options
options = None
parser = argparse.ArgumentParser(prog='autodist-git',
description='RPM repository sync and management with git service.',
@ -294,6 +322,9 @@ def main():
parser_syncpkg.add_argument('-d', '--delete', action='store_true', help="delete and recreate existing repository",
required=False)
parser_archiverepo = subparsers.add_parser('archiverepo', help="archive a specified repository package on git server")
parser_archiverepo.add_argument('pkgname', help="name of package")
parser_syncrepo = subparsers.add_parser('syncrepo', help="sync base repository with git server")
parser_syncrepo.add_argument('--from', dest='frompkg', help="from package name", required=False)
parser_syncrepo.add_argument('--to', dest='topkg', help="to package name", required=False)
@ -303,7 +334,7 @@ def main():
try:
options = parser.parse_args()
except:
exit(1)
sys.exit(1)
if options.mode == 'syncpkg':
if options.delete:
@ -315,10 +346,18 @@ def main():
if gitea_repo is not None:
print(f'Deleting repository for {options.pkgname}...')
gitea_repo.delete()
findAndCommitPackageReleases(options.pkgname, options.pkgver)
findAndCommitPackageReleases(options, options.pkgname, options.pkgver)
elif options.mode == 'archiverepo':
print(f'Archiving repository for {options.pkgname}...')
archiveRepo(options.pkgname)
elif options.mode == 'syncrepo':
# Get list for packages from SRPMS dir
dir_list = sorted(filter(os.path.isfile, glob.glob(f'{cfg["SRPMS_DIR"]}/*.src.rpm')))
# Check for package updates to sync with git repositories
print("Checking for package updates to sync with git repositories...")
for dir_file in dir_list:
parts = re.split('.*/([^/]*)-([^-]*)-([^-]*).src.rpm$', dir_file)
pkg_name = parts[1]
@ -343,7 +382,7 @@ def main():
found_newer = True
else:
for repo_tag in repo_tags:
parts = re.split(f'([^-]*)-([^-]*)$', repo_tag["name"])
parts = re.split('([^-]*)-([^-]*)$', repo_tag["name"])
tag_item = { 'e':0, 'v': parts[1], 'r': parts[2]}
compare = comparePkgInfo(pkg_item, tag_item)
if compare == 0:
@ -355,10 +394,28 @@ def main():
if not found_equal:
if repo_tags is not None:
print(f'{pkg_name} ({pkg_vr}): needs update')
findAndCommitPackageReleases(pkg_name, None)
findAndCommitPackageReleases(options, pkg_name, None)
if found_newer:
if options.verbose:
print(f'{pkg_name} ({pkg_vr}): found_equal={found_equal} found_newer={found_newer} found_older={found_older}')
# Check for git repositories to archive
print("Checking for git repositories to archive...")
pkg_names = []
for dir_file in dir_list:
parts = re.split('.*/([^/]*)-([^-]*)-([^-]*).src.rpm$', dir_file)
pkg_names.append(parts[1])
page = 1
while True:
gitea_repos = giteaGetRepositories(page, 50)
for gitea_repo in gitea_repos:
if not getattr(gitea_repo, "archived") and not gitea_repo.name.replace('Plus','+') in pkg_names:
print(f'Archiving repository {gitea_repo.name}')
archiveRepo(gitea_repo.name)
if len(gitea_repos) < 50:
break
page += 1
else:
parser.print_help()

View File

@ -1,22 +1,22 @@
#!/bin/bash
# autoport -- batch cross-build tool based on autodist
# Copyright (C) 2011-2024 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (C) 2011-2025 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=1.5.5
. /usr/share/autodist/VERSION
BASE_REPOSITORY=base
PORT_REPOSITORY=base
. /etc/autodist/config
me=(${0##*/} $VERSION "Sat Mar 20 2011")
me=(${0##*/} $VERSION)
function usage() {
echo "\
${me[0]} ${me[1]}
"$"Copyright (C) 2011-2023 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Copyright (C) 2011-2025 Silvan Calarco <silvan.calarco@mambasoft.it>""
"$"Released under the terms of the GNU GPL v3 license"
echo "
"$"Batch port and cross-build tool based on autodist.""

View File

@ -75,3 +75,31 @@ ftp_rw_srpms_dir[3]="/SRPMS.base"
arch_list[3]="i586 x86_64 aarch64"
arch_noarch_upload[3]="@arch@"
ftpdir_rw_old[3]="/old"
ftp_alias[4]="devel-kernel"
ftpurl_ro_rpms[4]="https://push.openmamba.org/pub/openmamba/devel-kernel/RPMS.@arch@"
ftpurl_ro_srpms[4]="https://push.openmamba.org/pub/openmamba/devel-kernel/SRPMS.base"
ftp_rw_server[4]="https://push.openmamba.org/pub/openmamba/devel-kernel"
ftp_rw_port[4]=
ftp_rw_passive_mode[4]=on
ftp_rw_user[4]=
ftp_rw_passwd[4]=
ftp_rw_rpms_dir[4]="/RPMS.@arch@"
ftp_rw_srpms_dir[4]="/SRPMS.base"
arch_list[4]="i586 x86_64 aarch64"
arch_noarch_upload[4]="@arch@"
ftpdir_rw_old[4]="/old"
ftp_alias[6]="devel-contrib"
ftpurl_ro_rpms[6]="https://push.openmamba.org/pub/openmamba/devel-contrib/RPMS.@arch@"
ftpurl_ro_srpms[6]="https://push.openmamba.org/pub/openmamba/devel-contrib/SRPMS.base"
ftp_rw_server[6]="https://push.openmamba.org/pub/openmamba/devel-contrib"
ftp_rw_port[6]=
ftp_rw_passive_mode[6]=on
ftp_rw_user[6]=
ftp_rw_passwd[6]=
ftp_rw_rpms_dir[6]="/RPMS.@arch@"
ftp_rw_srpms_dir[6]="/SRPMS.base"
arch_list[6]="i586 x86_64 aarch64"
arch_noarch_upload[6]="@arch@"
ftpdir_rw_old[6]="/old"

View File

@ -54,6 +54,10 @@ done
# Distribution global changes
sed -i "s|^Vendor:.*|Vendor: openmamba|;
s|^Distribution:.*|Distribution: openmamba|;
/^%debug_package.*/d;
/^#%patch.*/d;
s|^%patch -p|%patch 0 -p|;
s|^%patch0|%patch 0|;
/BuildRequires:[[:space:]]*libffmpeg-devel/d;
/^BuildRequires:[[:space:]]*libkdegames-devel/d;
/^BuildRequires:[[:space:]]*libkdegames5-devel/d;

View File

@ -327,7 +327,7 @@ input#repsearchtext {
width:100% !important;
height:350px;
overflow:auto;
overflow-x:hidden;
overflow-x:auto;
word-wrap: break-word;
font-family:monospace;
font-size:9pt;
@ -369,6 +369,11 @@ input#repsearchtext {
color:white;
}
.outputbox > pre {
white-space: pre-wrap;
word-break: break-word;
}
.outputbox > pre > p {
background-color:gray;
color:white;

View File

@ -1292,7 +1292,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
done
echo -n "</select>"
echo -n "&nbsp;<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"rpmforce\" value=\"force\">force&nbsp;</label>"
echo -n "&nbsp;<label style=\"padding:1px;\"><input type=checkbox id=\"debug\" value=\"debug\">debug&nbsp;</label>"
echo -n "&nbsp;<label style=\"padding:1px;\"><input type=checkbox id=\"noprep\" value=\"noprep\">no prep</label>"
echo -n "&nbsp;<label style=\"padding:1px;\"><input type=checkbox id=\"debug\" value=\"debug\">debug</label>"
# destination repository select
echo -n "<br>Send to:"
echo -n "<select id=sendrepository>"
@ -1423,6 +1424,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<input type=button value=\"build\" onclick="
echo -n "p=getCheckedValuesByName('autodistpkgscheckbox');ajax_getvalues(\""
echo -n "AUTODISTFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "AUTODISTNOPREP=\"+getElementById('noprep').checked+\"&"
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&"
@ -1490,6 +1492,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "p=getSelectedValueById('sendrepository');"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
echo -n "AUTODISTFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "AUTODISTNOPREP=\"+getElementById('noprep').checked+\"&"
echo -n "SENDREPOSITORY=\"+p+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "PACKAGE=$PACKAGEENCODED&REQUEST=autoportnp\""
@ -1729,6 +1732,7 @@ case $REQUEST in
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"unscheduled autodist job <b>$AUTODISTJOB</b>\" STIME=`date +%s`"
fi ;;
"autodistbuild") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
[ "$AUTODISTNOPREP" = "true" ] && AUTOSPEC="--noprep" || AUTOSPECADD=
autodistjobs=
if [ "$AUTODISTPKGS" ]; then
for p in $AUTODISTPKGS; do
@ -1737,7 +1741,7 @@ case $REQUEST in
else
autodistjobs="$AUTODISTJOB"
fi
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- $AUTOSPECADD --colors web" &>/dev/null
[ $? -ne 0 ] && RET=$? || {
RET=-1
echo "Autodist build start. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1803,10 +1807,12 @@ case $REQUEST in
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec $RPMARCHADD --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""
RET=$?
;;
"rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build"
"rpmbuild") AUTOSPECADD=""
[ "$RPMFORCE" = "true" ] && AUTOSPECADD="--force-build"
[ "$NOPREP" = "true" ] && AUTOSPECADD="${AUTOSPECADD} --noprep"
[ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \
RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\""
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5,6 -b $RPMFORCEADD $RPMARCHADD" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5,6 -b $AUTOSPECADD $RPMARCHADD" &>/dev/null
# && echo \"Webbuild HINT: now you may want to click on 'build requirements', add build requirements in .spec file and then 'recreate SRPMS'\""
[ $? -ne 0 ] && RET=$? || {
RET=-1

View File

@ -1,6 +1,6 @@
#
# webbuild functions-private include file
# Copyright (c) 2012-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2012-2024 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
repository_list() {
@ -152,6 +152,7 @@ function print_showlogcontrols() {
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=consolecmd&CONSOLECMD=\"+getElementById('consolecmd').value+\"&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "NOPREP=\"+getElementById('noprep').checked+\"&"
echo -n "DEBUG=\"+getElementById('debug').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# close tag
@ -192,7 +193,9 @@ function print_editorcontrols() {
echo -n "<input type=button value=\"build\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmbuild&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "NOPREP=\"+getElementById('noprep').checked+\"&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>"
# unpackaged files
echo -n "<input type=button value=\"unpackaged list\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospeclistcheck&"

View File

@ -88,11 +88,15 @@ if [ "$MODE" = "specinfo" ]; then
done < ${ENVPREFIX}${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec
[ "$AUTOBUILDREQ_BEGIN" -a "$AUTOBUILDREQ_END" -a ! "$AUTOBUILDREQ_UNDONE" ] || \
echo "SPECVAR_CHECK_NOAUTOBUILDREQ=1"
# _setup: prevent %setup macro expansion
$SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec --define \"%setup _setup\" > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null"
$SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null"
if [ -e $SPECFILE.tmp ]; then
echo "SPECVAR_Specfile=\"$SPECFILE\""
BUILDDIR=`grep -m1 "^_setup.*-n " $SPECFILE.tmp | sed "s|.*-n \([^[:space:]]*\).*|\1|"`
# Resolve builddir by parsing %setup macro or use default
BUILDDIR_UNPARSED=`grep "^%setup" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec | sed "s|.*-n \([^[:space:]]*\).*|\1|"`
if [ "${BUILDDIR_UNPARSED/%setup}" != "${BUILDDIR_UNPARSED}" ]; then
BUILDDIR_UNPARSED="$PACKAGE-%{version}"
fi
BUILDDIR=`rpmspec -q --srpm --queryformat "${BUILDDIR_UNPARSED}" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec`
while read line; do
set -- $line
[ "$1" = "%package" -o "$1" = "%description" ] && break
@ -104,17 +108,17 @@ if [ "$MODE" = "specinfo" ]; then
[ "$specvar" = "$lastspecvar" ] && varidx=$(($varidx + 1)) || varidx=0
echo "$specvar[$varidx]=\"${line//\"/}\""
[ "$specvaridx" != "" ] && echo "${specvar}_idx[$varidx]=$specvaridx"
[ "$specvar" = "SPECVAR_Version" -a ! "$BUILDDIR" ] && BUILDDIR="$PACKAGE-${line}"
[ "$specvar" = "SPECVAR_Version" ] && PACKAGE_VERSION="${line}"
fi
lastspecvar=$specvar
done < $SPECFILE.tmp
rm -f $SPECFILE.tmp
echo "SPECVAR_BUILDDIR=\"$BUILDDIR\""
echo "SPECVAR_BUILDROOT=\"$PACKAGE-root\""
echo "SPECVAR_RPMBUILDDIR=\"${WORKINGHOME}/RPM/BUILD\""
echo "SPECVAR_RPMSOURCESDIR=\"${WORKINGHOME}/RPM/SOURCES\""
echo "SPECVAR_RPMBUILDROOT=\"$RPMBUILDROOT\""
echo "SPECVAR_WORKINGHOME=\"$WORKINGHOME\""
echo "SPECVAR_RPMBUILDDIR=\"${WORKINGHOME}/RPM/BUILD/${PACKAGE}-${PACKAGE_VERSION}-build\""
echo "SPECVAR_RPMSOURCESDIR=\"${WORKINGHOME}/RPM/SOURCES\""
echo "SPECVAR_RPMBUILDROOT=\"${WORKINGHOME}/RPM/BUILD/${PACKAGE}-${PACKAGE_VERSION}-build/BUILDROOT\""
exit 0
fi
else