Compare commits

..

15 Commits

Author SHA1 Message Date
Arjan van de Ven 59ea0b102e new packages file 2024-07-09 18:23:06 +00:00
William Douglas e4c604a161 Export the output of cargo vendor
autospec learned how to use 'cargo vendor' output as a drop in
configuration file so put the output of cargo vendor there.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-08 15:11:34 -07:00
William Douglas 59c4520f37 Fix import order
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-08 14:07:10 -07:00
William Douglas 16f813a390 Add support for update.first
Add additional capability for update target to read a package's
update.first file that will run make update on each of the packages
included in that file.

The intended usage model is for packages that need to be updated in
order to specify that order via the update.first (the packages are
updated in the order specified unless a package in the list also has
an update.first file).

As part of this change, force the update target to always build in
koji synchronously to avoid issues where the update being depended on
isn't finished in koji.

Loops are not supported and will cause problems.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 15:03:11 -07:00
William Douglas 79eebc6aa6 Remove autospecnewgo target and its component parts
This wasn't a practical target and is no longer used so remove it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 13:33:17 -07:00
William Douglas d1accc8077 Fix CLEANUP option handling for autospecnew target
Signed-off-by: William Douglas <william.douglas@intel.com>
2024-07-03 11:34:09 -07:00
Arjan van de Ven b23d156f2c update packages file 2024-07-01 16:20:05 +00:00
Arjan van de Ven 39e8d4e68a update packages 2024-06-20 22:38:41 +00:00
Arjan van de Ven 9d440aff3a update packages 2024-06-13 20:01:45 +00:00
Arjan van de Ven c1e426713a packages update 2024-05-27 15:34:45 +00:00
William Douglas d9e4f478eb Rework vendoring support
Changes vendor from a target (it could still have a stand-alone target
but it wouldn't be used by the autospec target).

This change is needed because the Makefile is rewritten in the
autospec target but the ARCHIVES make variable is going to use the
value when make is executed. The common change causes the ARCHIVES
value to be eval'd during the autospec target execution in order for
the update from the vendor script to be seen by make.

The vendor script changes fix bugs in updating the options.conf and
Makefile. It also now handles returning the original ARCHIVES value as
well as prevent subshell scripts from outputting and adding badness
into the eval'd ARCHIVES variable.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-05-22 12:26:37 -07:00
William Douglas 96b366e71f Don't blacklist the update target directory
This is shipped by the filesystem package.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-29 12:39:38 -07:00
Brett T. Warden 84097fd526 Don't alter a list we're iterating through
Fix a couple of places where we're trying to remove files from the files
list while we're iterating through it -- replicate the change elsewhere
to keep a temporary list of the files to remove, then iterate through
*that* list after iterating through the global files list.
2024-04-24 10:59:16 -07:00
William Douglas c2cd51b5f2 Have vendor.py also update the options.conf file
This file is used for spec and upstream content so updating it is
important for improving the build automation.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-04-18 13:55:36 -07:00
Arjan van de Ven ed1ef58d9a update packages 2024-04-17 01:23:14 +00:00
7 changed files with 162 additions and 423 deletions
+8 -25
View File
@@ -157,10 +157,6 @@ pullrebase:
fi \
fi
# help vendor: Attempt to create an updated vendor tar archive if needed
vendor: preautospec-checks pullrebase clean-old-content
@ $(TOPLVL)/projects/common/vendor.py $(firstword $(NEWURL) $(URL)) $(PKG_NAME) $(VND_BASE_URL)
preautospec-checks:
#help autospec: automatically generates a specfile. If there is
@@ -174,8 +170,8 @@ autospec: preautospec-checks pullrebase localreponotice clean-old-content
echo "Specfile already exists and was not created by autospec.py! Aborting."; \
exit 1; \
fi
$(eval ARCHIVES = $(shell $(TOPLVL)/projects/common/vendor.py '$(value ARCHIVES)' $(firstword $(NEWURL) $(URL)) $(PKG_NAME) $(VND_BASE_URL)))
@printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(PKG_NAME) '$(firstword $(value NEWURL) $(value URL))' '$(value ARCHIVES)' > Makefile
@$(MAKE) vendor
python3 $(TOPLVL)/projects/autospec/autospec/autospec.py \
--target . \
--integrity \
@@ -411,16 +407,18 @@ update-versions:
#help If no update.sh exists, update the version, autospec and push the
#help update to koji (bumping the bump.list if found).
update:
@if [ -f update.first ]; then \
for pkg in $$(< update.first); do \
(cd "../$${pkg}" || exit 1; $(MAKE) update-versions || exit 0; $(MAKE) update) || exit; \
done; \
fi
@if [ -f update.sh ]; then \
./update.sh; \
else \
$(MAKE) -s update-versions && \
$(MAKE) autospec CLEANUP=1 && \
if [ -f bump.list ]; then \
$(MAKE) -s koji; \
else \
$(MAKE) -s koji-nowait; \
fi \
$(MAKE) -s koji && \
$(MAKE) koji-waitrepo; \
fi \
logcheck:
@@ -444,21 +442,6 @@ repoadd: $(TOPLVL)/repo
$(MAKE) -s localrepocreate
$(MAKE) -s localrepoenable
#help repostage: Stages locally-built RPMs for this package to the local RPM
#help directory. If this directory does not yet exist, it is created and
#help enabled.
repostage: $(TOPLVL)/repo
@if [ -z "${LATEST_RPMS}" ]; then \
echo "No rpms found in rpms/ directory."; \
exit 1; \
fi
$(MAKE) -s repodel NO_CREATEREPO=1
@for r in ${LATEST_RPMS}; do \
echo "+$${rpm#rpms/}"; \
echo "$${rpm#rpms/}" >> .repo-index; \
done; \
flock $</repo.lock ln -f -t $< ${LATEST_RPMS}
#help repodel: Removes RPMs from the local RPM repository that were
#help previously added by 'make repoadd' for this package.
repodel: $(TOPLVL)/repo
+1 -46
View File
@@ -237,7 +237,7 @@ autospecnew: preautospecnew-checks localreponotice
--mock-config $(MOCK_CONFIG_VAL) \
--mock-opts="$(MOCK_OPTS)" \
$${SETVERSION:+ --version $${SETVERSION}} \
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
${NON_INTERACTIVE} ${SKIP_GIT} $(if $(CLEANUP),-C) \
$(URL); \
if [ $$? -eq 0 ]; then \
$(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
@@ -256,51 +256,6 @@ autospecnew: preautospecnew-checks localreponotice
exit 1; \
fi
#help autospecnewgo: Creates a new autospec package with (dependencies)
#help for a given URL=$(URL) with NAME=$(NAME). Several files used by
#help autospec will be created in the help process.
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options
#help to autospec.
#help For more information about autospec, see the project page on Github https://github.com/clearlinux/autospec
autospecnewgo: preautospecnew-checks localreponotice
@if [ -z $(NAME) ] || [ -z $(URL) ]; then \
echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \
exit 1; \
fi
-$(MAKE) clone_$(NAME)
@if [ ! -d $(TOPLVL)/packages/$(NAME)/.git ]; then \
echo "no remote repository found, creating new package repository and running autospec"; \
mkdir -p $(TOPLVL)/packages/$(NAME); \
( \
cd $(TOPLVL)/packages/$(NAME); \
git init -b main; \
git remote add origin $(PKG_BASE_URL)/$(NAME); \
$(call gitoliteurl,packages/$(NAME)); \
$(call subjectprefix,$(NAME)); \
); \
printf 'PKG_NAME := %s\nURL = %s\nARCHIVES = %s\n\ninclude ../common/Makefile.common\n' $(NAME) '$(value URL)' '$(value ARCHIVES)' > $(TOPLVL)/packages/$(NAME)/Makefile; \
python3 $(TOPLVL)/projects/common/go-builder.py \
--target packages/$(NAME) \
--integrity \
--config "$(AUTOSPEC_CONF)" \
--name $(NAME) \
--archives $(ARCHIVES) \
--mock-config $(MOCK_CONFIG_VAL) \
--mock-opts "$(MOCK_OPTS)" \
$(URL); \
if [ $$? -eq 0 ]; then \
$(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
python3 $(TOPLVL)/projects/common/patchfilter.py <(git -C $(TOPLVL)/packages/$(NAME) show) > $(TOPLVL)/packages/$(NAME)/for-review.txt; \
python3 $(TOPLVL)/projects/common/patchfilter.py <(git -C $(TOPLVL)/packages/$(NAME) show); \
else \
exit 1; \
fi; \
else \
echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \
exit 1; \
fi
#help repoenable: Enables the local RPM repository for use with Yum/DNF and
#help Mock. If this repository does not yet exist, it is created.
repoenable: localrepoenable ;
-1
View File
@@ -2,4 +2,3 @@
/usr/lib/systemd/system/sysinit.target.wants/systemd-firstboot.service
/usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
/usr/lib/systemd/system/sysinit.target.wants/systemd-update-done.service
/usr/lib/systemd/system/update-triggers.target.wants
-285
View File
@@ -1,285 +0,0 @@
#!/usr/bin/env python3
#
# gowrap.py - part of autospec
# Copyright (C) 2019 Intel Corporation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import os
import shutil
import subprocess
import sys
import tempfile
def parse_args():
"""Parse commandline arguments."""
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Location of package archive")
parser.add_argument("-t", "--target", dest="target", action="store",
default=None,
help="Target location to create or reuse")
parser.add_argument("-c", "--config", dest="config", action="store",
default="/usr/share/defaults/autospec/autospec.conf",
help="Set configuration file to use")
parser.add_argument("-n", "--name", action="store", dest="name", default="",
help="Override the package name")
parser.add_argument("-i", "--integrity", action="store_true",
default=False,
help="Search for package signature from source URL and "
"attempt to verify package")
parser.add_argument("-m", "--mock-config", action="store", default="clear",
help="Value to pass with Mock's -r option. Defaults to "
"\"clear\", meaning that Mock will use "
"/etc/mock/clear.cfg.")
parser.add_argument("-o", "--mock-opts", action="store", default="",
help="Arbitrary options to pass down to mock when "
"building a package.")
parser.add_argument('-a', "--archives", action="store",
dest="archives", default=[], nargs='*',
help="tarball URLs for additional source archives and"
" a location for the sources to be extacted to (e.g."
" http://example.com/downloads/dependency.tar.gz"
" /directory/relative/to/extract/root )")
return parser.parse_args()
def missing_dependencies(name):
"""Check if the build failed due to missing dependencies."""
root_log = os.path.join("packages", name, "results", "root.log")
if not os.path.exists(root_log):
return False
with open(root_log, "r") as lfile:
for line in lfile.readlines():
if "No matching package to install" in line:
return True
return False
def already_built(name, version):
"""Check if the package and version are already built."""
if not os.path.exists(os.path.join("packages", name, "rpms")):
return False
vpath = os.path.join("packages", name, "versions")
if not os.path.exists(vpath):
return False
with open(vpath, "r") as vfile:
if version not in [x.strip() for x in vfile.readlines()]:
return False
return True
def build(path, args, name, url, version):
"""Try and build a package."""
if version:
ver_arg = ["-v", version]
else:
ver_arg = []
if already_built(name, version):
return True
print(f"Trying to autospec {name} - {version}")
proc = subprocess.run(["python3",
f"{path}/../autospec/autospec/autospec.py", url,
"-c", args.config, "-t", f"packages/{name}",
"-n", name, "-m", args.mock_config,
"-o", args.mock_opts, "-i"] + ver_arg, capture_output=True)
if proc.returncode == 0:
subprocess.run(["make", "link-new-rpms", f"PKG_REPO_DIR=packages/{name}"],
capture_output=True)
return proc.returncode == 0
def parse_go_mod(path):
"""Parse go.mod file for build requirements.
File content looks as follows:
module example.com/foo/bar
require (
github.com/BurntSushi/toml v0.3.1
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999
github.com/inconshreveable/mousetrap v1.0.0 // indirect
"github.com/spf13/cobra" v0.0.3
github.com/spf13/pflag v1.0.3 // indirect
)
Need to handle all require lines including //indirect.
Skip requires that use .git for now. May need to be handled
differently.
"""
reqs = []
with open(path, "r") as gfile:
dep_start = False
for line in gfile.readlines():
# Ideally the mod file is generated and the format is
# always correct but add a few defenses just in case
line = line.strip()
if line.startswith("//"):
# Skip comments
continue
if dep_start:
# End of the require section
if line.startswith(")"):
break
req = line.split()[:2]
req[0] = req[0].replace('"', '')
if req[0].endswith(".git"):
continue
reqs.append(req)
continue
if line.startswith("require ("):
dep_start = True
return reqs
def get_dependencies(name):
"""Return path to the go.mod file if it exists."""
command = None
path = None
pdir = os.path.join("packages", name)
reqs = []
for fname in os.listdir(pdir):
# Find the archive
if fname.endswith("zip"):
command = ["unzip", fname]
elif ".tar." in fname:
command = ["tar", "xf", fname]
else:
command = None
if command:
# Decompress archive
tdir = tempfile.mkdtemp()
tfile = os.path.join(tdir, fname)
shutil.copyfile(os.path.join(pdir, fname), tfile)
proc = subprocess.run(command, cwd=tdir, capture_output=True)
if not proc.returncode:
# inspect contents for a "go.sum" file
for root, _, files in os.walk(tdir):
if "go.mod" in files:
path = f"{name}.gomod"
shutil.copyfile(os.path.join(root, "go.mod"), path)
reqs += parse_go_mod(path)
os.unlink(path)
shutil.rmtree(tdir)
return reqs
def encode_requirements(requirement):
"""Encode the project's module and version."""
# Default dependency base proxy url
base_url = "https://proxy.golang.org/"
# Encoding based on
# https://tip.golang.org/cmd/go/#hdr-Module_proxy_protocol
encoded_module = ""
for char in requirement[0]:
if char.isupper():
encoded_module += "!" + char.lower()
else:
encoded_module += char
encoded_version = ""
for char in requirement[1]:
if char.isupper():
encoded_version += "!" + char.lower()
else:
encoded_version += char
return (encoded_module, encoded_version)
def initialize_package(name, url, version, path, args):
"""Setup package and try to build it."""
if already_built(name, version):
return True
print(f"Trying to autospecnew {name} - {version}")
proc = subprocess.run(["make", "autospecnew", f"URL={url}", f"NAME={name}", f"SETVERSION={version}"], capture_output=True)
if f"{name} already exists at" in proc.stdout.decode("utf-8"):
return build(path, args, name, url, version)
return proc.returncode == 0
def build_recursive(path, args, name, url, version=None, success=None):
"""Try and recursively build packages."""
if not success:
# First package being built, common utilities already run
# so just use autospec directly
success = {}
ret = build(path, args, name, url, version)
else:
ret = initialize_package(name, url, version, path, args)
if ret:
# Completed so we are done!
return True
if not missing_dependencies(name):
# Failed but not due to missing dependencies, bail
print(f"Unknown error building {name} - {version}")
return False
reqs = get_dependencies(name)
if not reqs:
# Didn't try and add anything so don't need to build again
print(f"Build failed with no missing requirements: {name} - {version}")
return False
print(f"First attempt to build failed due to missing dependencies {name} - {version}\n")
for req in reqs:
ereq = encode_requirements(req)
rname = "go-" + req[0].replace("/", "-")
rurl = f"https://proxy.golang.org/{ereq[0]}/@v/list"
if (rname, req[1]) in success:
# Rebuild detected, figure out if it is okay or not
if success[(rname, req[1])]:
# Already succeeded building req short circuit success
continue
else:
# Encountered a build loop, bail out as this likely
# requires manual fixing
print(f"Detected build loop when building {rname} - {req[1]}")
return True
success[(rname, req[1])] = False
if not build_recursive(path, args, rname, rurl, req[1], success):
print(f"Failed to build dependency {rname} - {req[1]}")
return False
success[(rname, req[1])] = True
subprocess.run(["make", "repodel"], cwd=f"packages/{rname}", capture_output=True)
subprocess.run(["make", "repostage"], cwd=f"packages/{rname}", capture_output=True)
# Create the repo with the new packages added
subprocess.run(["make", "localrepocreate"], capture_output=True)
# Retry previously failed build assuming dependencies got added
print(f"Rebuilding after resolving dependencies {name} - {version}")
ret = build(path, args, name, url, version)
print("")
return ret
def main():
"""Start program execution."""
args = parse_args()
path = os.path.dirname(os.path.realpath(__file__))
return build_recursive(path, args, args.name, args.url)
if __name__ == '__main__':
if not main():
sys.exit(-1)
print("\n\nBuild completed\n\n")
+90 -41
View File
@@ -43,10 +43,12 @@ OpenSP
PDAL
PyMySQL
PyQt5
PyQt6
PySocks
PyYAML
QAT-ZSTD-Plugin
QAT_engine
QR-Code-generator
QXlsx
R
R-AER
@@ -104,11 +106,11 @@ R-ICEbox
R-ICS
R-ICSNP
R-IRdisplay
R-IRkernel
R-ISOcodes
R-ISwR
R-Iso
R-JM
R-KMsurv
R-Lahman
R-LearnBayes
R-Luminescence
@@ -336,6 +338,7 @@ R-distr
R-distrEx
R-distributional
R-dlm
R-doBy
R-doMC
R-doMPI
R-doParallel
@@ -375,6 +378,7 @@ R-estimability
R-etm
R-evaluate
R-evd
R-exactRankTests
R-expint
R-expm
R-expsmooth
@@ -413,6 +417,7 @@ R-fixest
R-flashClust
R-flexmix
R-flexsurv
R-flexsurvcure
R-flextable
R-float
R-fontBitstreamVera
@@ -460,9 +465,13 @@ R-ggfortify
R-ggjoy
R-ggplot2
R-ggplot2movies
R-ggpubr
R-ggrepel
R-ggridges
R-ggsci
R-ggsignif
R-ggstats
R-ggtext
R-ggvis
R-gh
R-git2r
@@ -482,6 +491,7 @@ R-gower
R-gplots
R-gridBase
R-gridExtra
R-gridtext
R-gsl
R-gss
R-gtable
@@ -536,6 +546,7 @@ R-kernlab
R-kimisc
R-kit
R-klaR
R-km.ci
R-kmi
R-knitr
R-ks
@@ -596,6 +607,7 @@ R-mathjaxr
R-matrixStats
R-matrixcalc
R-maxLik
R-maxstat
R-mclogit
R-mclust
R-mcmc
@@ -612,6 +624,7 @@ R-mime
R-miniUI
R-minpack.lm
R-minqa
R-minty
R-mirt
R-misc3d
R-miscF
@@ -842,6 +855,7 @@ R-rsdmx
R-rstan
R-rstanarm
R-rstantools
R-rstatix
R-rstpm2
R-rstudioapi
R-rsvg
@@ -922,7 +936,9 @@ R-styler
R-subplex
R-subselect
R-superpc
R-survMisc
R-survey
R-survminer
R-svUnit
R-svglite
R-sys
@@ -1057,6 +1073,7 @@ WPEBackend-fdo
WireGuard
XStatic-term.js
Z3
aardvark-dns
abireport
abseil-cpp
accel-config
@@ -1065,7 +1082,6 @@ acl
acpica-unix2
ade
adwaita-icon-theme
aesara
akonadi
akonadi-calendar
akonadi-calendar-tools
@@ -1100,7 +1116,6 @@ ark
armadillo
arp-scan
arpack-ng
artikulate
asciidoc
asciidoctor
asciinema
@@ -1147,7 +1162,7 @@ bash-completion
bashdb
bats
bc
bcache-tools
bcachefs-tools
bcc
bcftools
bdftopcf
@@ -1175,6 +1190,7 @@ boto3
botocore
bovo
box2d
bpftool
bpftrace
breeze
breeze-gtk
@@ -1206,6 +1222,7 @@ byobu
bz2file
bzip2
c-ares
c-blosc2
cJSON
c_rehash
ca-certs
@@ -1218,12 +1235,12 @@ calendarsupport
can-utils
cantarell-fonts
cantata
cantor
capnproto
capslock
capstone
casync
catch2
cbindgen
ccache
ccid
cdparanoia
@@ -1231,6 +1248,7 @@ cereal
cfitsio
cgdb
cgit
chafa
check
cheese
chirp
@@ -1310,6 +1328,7 @@ compat-gcc-10
compat-gcr-soname1
compat-glibmm-soname24
compat-gnome-bluetooth-soname-13
compat-gsl-soname27
compat-gtksourceview-soname3
compat-json-c-soname4
compat-libffi-soname6
@@ -1322,6 +1341,7 @@ compat-libvpx-soname7
compat-libvpx-soname8
compat-pangomm-soname14
compat-protobuf-soname29
compat-protobuf-soname32
compat-re2-soname10
compat-readline-soname5
compat-taglib-soname1
@@ -1375,6 +1395,7 @@ dbus-glib
dbus-python
dconf
dconf-editor
ddcutil
ddd
deap
debugedit
@@ -1434,6 +1455,7 @@ dunst
duperemove
dvisvgm
dwarves
dymo-cups-drivers
dyskctl
e2fsprogs
earlyoom
@@ -1482,8 +1504,10 @@ fakeroot
falcosecurity-libs
fann
farstream
fastfetch
faultstat
fcgi
fdk-aac
fdupes
feh
fetchmail
@@ -1501,6 +1525,7 @@ fish
flac
flare-engine
flare-game
flatpack-kcm
flatpak
flatpak-builder
fldigi
@@ -1542,7 +1567,6 @@ gc
gcab
gcc
gcc11
gcc14
gcc7
gcc8
gcc9
@@ -1707,6 +1731,7 @@ gtk3
gtk4
gtkmm2
gtkmm3
gtkmm4
gtksourceview
gtksourceview4
gtkspell3
@@ -1715,7 +1740,6 @@ guile
gutenprint
gvfs
gvim
gwenview
gzip
hamlib
haproxy
@@ -1791,7 +1815,6 @@ iotop
ipaddr
ipe
iperf
ipmctl
ipmitool
ipp-crypto
iproute2
@@ -1827,8 +1850,6 @@ json-glib
jsoncpp
juk
kaccounts-integration
kactivities
kactivities-stats
kactivitymanagerd
kalarm
kalgebra
@@ -1845,7 +1866,6 @@ kbackup
kbd
kblackbox
kblocks
kblog
kbookmarks
kbounce
kbreakout
@@ -1859,6 +1879,7 @@ kcmutils
kcodecs
kcolorchooser
kcolorpicker
kcolorscheme
kcompletion
kconfig
kconfigwidgets
@@ -1880,27 +1901,24 @@ kded
kdeedu-data
kdegraphics-mobipocket
kdegraphics-thumbnailers
kdelibs4support
kdenetwork-filesharing
kdenlive
kdepim-runtime
kdeplasma-addons
kdesdk-kio
kdesdk-thumbnailers
kdesignerplugin
kdesu
kdf
kdiagram
kdialog
kdiamond
kdiff3
kdnssd
kdoctools
kdsoap
kdsoap-ws-discovery-client
keditbookmarks
keepalived
keepassxc
kemoticons
kernel-config
kernel-install
kexec-tools
@@ -1908,27 +1926,24 @@ keychain
keyutils
kfilemetadata
kfind
kfloppy
kfourinline
kgamma5
kgamma
kgeography
kget
kglobalaccel
kglobalacceld
kgoldrunner
kgpg
kguiaddons
khangman
khelpcenter
kholidays
khotkeys
khtml
ki18n
kicad
kicad-packages3D
kiconthemes
kidentitymanagement
kidletime
kig
kigo
killbots
kimageannotator
@@ -1936,11 +1951,11 @@ kimageformats
kimagemapeditor
kimap
kinfocenter
kinit
kio
kio-admin
kio-extras
kio-zeroconf
kirigami
kirigami-addons
kirigami-gallery
kirigami2
@@ -1951,7 +1966,6 @@ kiten
kitinerary
kjobwidgets
kjs
kjsembed
kjumpingcube
kldap
kleopatra
@@ -1964,11 +1978,9 @@ kmail
kmail-account-wizard
kmailtransport
kmbox
kmediaplayer
kmenuedit
kmime
kmines
kmix
kmod
kmousetool
kmouth
@@ -2005,10 +2017,8 @@ krb5
krdc
kreversi
kronosnet
kross
kruler
krunner
krusader
ksanecore
kscreen
kscreenlocker
@@ -2021,9 +2031,9 @@ ksnakeduel
kspaceduel
ksquares
ksshaskpass
kstars
kstatusnotifieritem
ksudoku
ksysguard
ksvg
ksystemlog
ksystemstats
kteatime
@@ -2033,7 +2043,6 @@ ktexttemplate
ktextwidgets
ktimer
ktnef
ktp-desktop-applets
ktuberling
kturtle
kubernetes
@@ -2044,7 +2053,6 @@ kwallet
kwallet-pam
kwalletmanager
kwayland
kwayland-integration
kwayland-server
kwidgetsaddons
kwin
@@ -2052,11 +2060,9 @@ kwindowsystem
kwordquiz
kwrited
kxmlgui
kxmlrpcclient
kyotocabinet
ladspa_sdk
latencytop
latte-dock
layer-shell-qt
lcms2
lcov
@@ -2092,6 +2098,7 @@ libaccounts-glib
libaccounts-qt
libadwaita
libaio
libajantv2
libao
libaom
libappindicator
@@ -2103,6 +2110,7 @@ libatomic_ops
libavif
libavtp
libb64
libbacktrace
libblockdev
libbpf
libbsd
@@ -2129,6 +2137,7 @@ libcryptui
libcuckoo
libcxx
libdaemon
libdatachannel
libdatrie
libdazzle
libdbusmenu
@@ -2198,6 +2207,7 @@ libiscsi
libisofs
libjcat
libjpeg-turbo
libjuice
libkcapi
libkcddb
libkcompactdisc
@@ -2207,7 +2217,6 @@ libkdepim
libkeduvocdocument
libkexiv2
libkgapi
libkipi
libkleo
libkmahjongg
libkomparediff2
@@ -2230,6 +2239,7 @@ libmodplug
libmodulemd
libmpack
libmpack-lua
libmsgraph
libmspack
libmspub
libmtp
@@ -2266,12 +2276,14 @@ libpeas
libpinyin
libpipeline
libplacebo
libplasma
libplist
libpng
libportal
libproxy
libpsl
libpthread-stubs
libptytty
libpwquality
libqaccessibilityclient
libqalculate
@@ -2402,7 +2414,6 @@ lm-sensors
lmdb
logrotate
logutils
lokalize
lpeg
lsacpi
lshw
@@ -2458,7 +2469,6 @@ meson
messagelib
meta-c-basic
meta-desktop-gnome
meta-desktop-kde
meta-os-core
meta-os-core-plus
metacity
@@ -2471,6 +2481,7 @@ micro-config-drive-aws
micro-config-drive-equinix
micro-config-drive-oci
milou
mimetreeparser
minetest
minetest_game
mingw-binutils
@@ -2497,6 +2508,7 @@ modsecurity
modsecurity-nginx
modules
mokutil
mold
mono
moreutils
mosh
@@ -2546,6 +2558,7 @@ neovim
net-snmp
net-tools
netaddr
netavark
netbase
netcdf
netcdf-fortran
@@ -2574,8 +2587,10 @@ nicstat
nim
ninja
nload
nlohmann_json
nlopt
nmap
node-addon-api
nodejs
nose-parameterized
not-ffmpeg
@@ -2601,12 +2616,12 @@ nut
nv-codec-headers
nvme-cli
oath-toolkit
obs-studio
ocaml
ocamlbuild
ocl-icd
octave
oiio
okteta
okular
oneDPL
oneVPL
@@ -2635,6 +2650,7 @@ openpace
opensm
openssh
openssl
openvino
openvpn
openvswitch
optipng
@@ -2650,7 +2666,7 @@ osm-gps-map
ostree
otp
oxygen
oxygen-icons5
oxygen-icons
oxygen-sounds
p11-kit
p7zip
@@ -2669,6 +2685,7 @@ parallel
parley
parted
pass
passt
passwdqc
patch
patchelf
@@ -3604,18 +3621,24 @@ pipewire
pixman
pkcs11-helper
pkg-config
plasma-activities
plasma-activities-stats
plasma-browser-integration
plasma-desktop
plasma-discover
plasma-framework
plasma-disks
plasma-firewall
plasma-integration
plasma-nm
plasma-pa
plasma-systemmonitor
plasma-vault
plasma-wayland-protocols
plasma-welcome
plasma-workspace
plasma-workspace-wallpapers
plasma5support
plog
plzip
pm-graph
pmdk
@@ -3627,6 +3650,7 @@ podman
polkit
polkit-kde-agent
polkit-qt
polkit-qt6
poppler
poppler-data-clr-rename
popt
@@ -3660,7 +3684,9 @@ psstop
pth
pugixml
pulseaudio
pulseaudio-qt
purpose
puzzles
pv
pwgen
pyatspi
@@ -3787,6 +3813,7 @@ pypi-certifi
pypi-cffi
pypi-cffsubr
pypi-cfgv
pypi-chai
pypi-chaospy
pypi-chardet
pypi-charset_normalizer
@@ -3881,6 +3908,8 @@ pypi-docopt
pypi-docstring_parser
pypi-docstring_to_markdown
pypi-docutils
pypi-doxypypy
pypi-doxyqml
pypi-dpcontracts
pypi-dulwich
pypi-ecdsa
@@ -3920,6 +3949,7 @@ pypi-flaky
pypi-flask
pypi-flatbuffers
pypi-flatten_json
pypi-flexparser
pypi-flit
pypi-flit_core
pypi-flit_scm
@@ -3981,6 +4011,7 @@ pypi-hatch_requirements_txt
pypi-hatch_vcs
pypi-hatchling
pypi-heapdict
pypi-hishel
pypi-hjson
pypi-hkp4py
pypi-home_assistant_frontend
@@ -4040,7 +4071,6 @@ pypi-jaraco.functools
pypi-jaraco.text
pypi-jarn.viewdoc
pypi-javaproperties
pypi-jax
pypi-jedi
pypi-jeepney
pypi-jellyfish
@@ -4088,6 +4118,7 @@ pypi-kiwisolver
pypi-krb5
pypi-kubernetes
pypi-langcodes
pypi-language_data
pypi-lark_parser
pypi-latexcodec
pypi-lavacli
@@ -4113,6 +4144,7 @@ pypi-lxml
pypi-lz4
pypi-macholib
pypi-mako
pypi-marisa_trie
pypi-markdown
pypi-markdown2
pypi-markdown_exec
@@ -4132,6 +4164,7 @@ pypi-mkdocs
pypi-mkdocs_autorefs
pypi-mkdocs_exclude
pypi-mkdocs_gen_files
pypi-mkdocs_get_deps
pypi-mkdocs_htmlproofer_plugin
pypi-mkdocs_material_extensions
pypi-mkdocs_monorepo_plugin
@@ -4179,6 +4212,7 @@ pypi-nocasedict
pypi-nocaselist
pypi-nodeenv
pypi-notebook_shim
pypi-numexpr
pypi-numpoly
pypi-numpy
pypi-numpydoc
@@ -4196,6 +4230,7 @@ pypi-outcome
pypi-overrides
pypi-ovirt_imageio
pypi-packaging
pypi-packaging_legacy
pypi-paginate
pypi-paho_mqtt
pypi-pandocfilters
@@ -4216,9 +4251,11 @@ pypi-pathlib2
pypi-pathspec
pypi-patsy
pypi-pbr
pypi-pbs_installer
pypi-pdfminer.six
pypi-pdm
pypi-pdm_backend
pypi-pdm_build_locked
pypi-pdm_pep517
pypi-pecan
pypi-ped
@@ -4260,6 +4297,7 @@ pypi-portend
pypi-posix_ipc
pypi-poyo
pypi-pre_commit
pypi-pretty_errors
pypi-prettytable
pypi-probed
pypi-progress
@@ -4267,6 +4305,7 @@ pypi-progressbar
pypi-prometheus_client
pypi-prompt_toolkit
pypi-proto_plus
pypi-protobuf
pypi-psautohint
pypi-psutil
pypi-psycopg2
@@ -4307,6 +4346,7 @@ pypi-pyelftools
pypi-pyfakefs
pypi-pyflakes
pypi-pygame
pypi-pygdbmi
pypi-pygithub
pypi-pygments
pypi-pyicu
@@ -4454,6 +4494,7 @@ pypi-safetensors
pypi-salib
pypi-sanic_routing
pypi-scikit_build
pypi-scikit_build_core
pypi-scikit_image
pypi-scikit_learn
pypi-scp
@@ -4533,6 +4574,7 @@ pypi-sqlalchemy
pypi-sqlparse
pypi-sshtunnel
pypi-stack_data
pypi-starlette
pypi-storops
pypi-strictyaml
pypi-subprocess_tee
@@ -4582,6 +4624,7 @@ pypi-ttp
pypi-twine
pypi-typed_ast
pypi-typeguard
pypi-types_cffi
pypi-types_colorama
pypi-types_cryptography
pypi-types_dataclasses
@@ -4625,6 +4668,7 @@ pypi-urlobject
pypi-urwid
pypi-user_agents
pypi-userpath
pypi-uvicorn
pypi-uvloop
pypi-venusian
pypi-verboselogs
@@ -4638,6 +4682,7 @@ pypi-vsts_cd_manager
pypi-waitress
pypi-warlock
pypi-watchdog
pypi-watchfiles
pypi-wbdata
pypi-wcmatch
pypi-wcwidth
@@ -4734,6 +4779,8 @@ qbittorrent
qca
qca-qt5
qcoro
qcoro6
qdmr
qemu
qemu-guest-additions
qgit
@@ -4851,7 +4898,6 @@ rlwrap
rng-tools
robin-map
roboto
rocs
rofi
rpcbind
rpcsvc-proto
@@ -4866,6 +4912,7 @@ rtmpdump
rttr
ruby
runc
rust-bindgen
rustc
rxvt-unicode
s2tc
@@ -5062,12 +5109,13 @@ usb-modeswitch
usb-modeswitch-data
usbredir
usbutils
user-manager
userspace-rcu
usrbinjava
usrbinvi
usrsctp
utf8proc
utfcpp
uthash
util-linux
util-macros
uwsgi
@@ -5174,6 +5222,7 @@ xfce4-whiskermenu-plugin
xfconf
xfdesktop
xfontsel
xfsdump
xfsprogs
xfwm4
xhost
+6 -2
View File
@@ -98,9 +98,13 @@ def zap_entire_file_end(filename):
global files
global files_chunks
global files_header
files_to_remove = list()
for file in files:
if file.endswith(filename):
files.remove(file)
# Don't modify the original list while iterating over it
files_to_remove.append(file)
for file in files_to_remove:
files.remove(file)
def zap_line_in_file_substring(filename, match):
global header
@@ -186,7 +190,7 @@ def zap_empty_chunks():
files_to_remove = list()
for file in files:
if file not in files_chunks:
files.remove(file)
files_to_remove.append(file)
continue
to_remove = list()
for chunk in files_chunks[file]:
+57 -23
View File
@@ -9,9 +9,8 @@ import subprocess
import tempfile
import time
from git import Repo
import requests
from git import Repo
def vendor_check():
@@ -30,6 +29,7 @@ def vendor_check():
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('archives')
parser.add_argument('url')
parser.add_argument('name')
parser.add_argument('git')
@@ -44,7 +44,7 @@ def setup_content(url):
with open(outfile, 'wb') as cfile:
cfile.write(response.content)
subprocess.run(f"tar xf {outfile}", shell=True, cwd=tdir, check=True)
subprocess.run(f"tar xf {outfile}", shell=True, cwd=tdir, check=True, stdout=subprocess.DEVNULL)
os.remove(outfile)
return tdir
@@ -60,69 +60,103 @@ def setup_cargo_vendor(path):
def update_cargo_vendor(path, name, git):
git_uri = os.path.join(git, name)
vendor_path = os.path.join(path, 'vendor')
subprocess.run(f"git clone {git_uri} {vendor_path}", shell=True, check=True)
subprocess.run(f"git clone {git_uri} {vendor_path}", shell=True, check=True,
stdout=subprocess.DEVNULL)
vendor_git = os.path.join(vendor_path, '.git')
if not os.path.isdir(vendor_git):
# initialize a git repo
subprocess.run('git init .', cwd=vendor_path, shell=True, check=True)
subprocess.run('git init .', cwd=vendor_path, shell=True, check=True,
stdout=subprocess.DEVNULL)
subprocess.run(f"git remote add origin {git_uri}", cwd=vendor_path,
shell=True, check=True)
shell=True, check=True, stdout=subprocess.DEVNULL)
backup_vendor_git = os.path.join(path, 'clear-linux-vendor-git')
subprocess.run(f"cp -a {vendor_git} {backup_vendor_git}", cwd=path,
shell=True, check=True)
shell=True, check=True, stdout=subprocess.DEVNULL)
shutil.rmtree(vendor_path)
subprocess.run('cargo vendor', cwd=path, shell=True, check=True)
cargo_vendors = subprocess.run('cargo vendor', cwd=path, shell=True,
check=True, stdout=subprocess.PIPE,
universal_newlines=True).stdout
subprocess.run(f"cp -a {backup_vendor_git} {vendor_git}", cwd=path,
shell=True, check=True)
shell=True, check=True, stdout=subprocess.DEVNULL)
repo = Repo(vendor_path)
if not (len(repo.untracked_files) > 0 or repo.is_dirty()):
return False
subprocess.run('git add .', cwd=vendor_path, shell=True, check=True)
return False, ""
subprocess.run('git add .', cwd=vendor_path, shell=True, check=True,
stdout=subprocess.DEVNULL)
subprocess.run('git commit -m "vendor update"', cwd=vendor_path,
shell=True, check=True)
shell=True, check=True, stdout=subprocess.DEVNULL)
gmt = time.gmtime()
tag = f"{gmt.tm_year}-{gmt.tm_mon:02d}-{gmt.tm_mday:02d}-{gmt.tm_hour:02d}-{gmt.tm_min:02d}-{gmt.tm_sec:02d}"
subprocess.run(f"git tag {tag}", cwd=vendor_path, shell=True,
check=True)
check=True, stdout=subprocess.DEVNULL)
subprocess.run(f"git push origin main:main {tag}", cwd=vendor_path,
shell=True, check=True)
shell=True, check=True, stdout=subprocess.DEVNULL)
time.sleep(30)
return tag
return tag, cargo_vendors
def update_cargo_sources(name, tag):
def update_cargo_sources(name, tag, cargo_vendors):
makefile = []
archive_match = os.path.join('$(CGIT_BASE_URL)', 'vendor', name,
options = []
archive_match = os.path.join(r'\$\(CGIT_BASE_URL\)', 'vendor', name,
'snapshot', name)
archive_replace = os.path.join('$(CGIT_BASE_URL)', 'vendor', name,
'snapshot', name)
with open('Makefile', encoding='utf8') as mfile:
for line in mfile.readlines():
if line.startswith('ARCHIVES'):
if re.match(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz', line):
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz', line):
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz',
f"{archive_match}-{tag}.tar.xz\n", line)
f"{archive_replace}-{tag}.tar.xz", line)
else:
new_archives = f"ARCHIVES = {archive_match}-{tag}.tar.xz ./vendor\n"
new_archives = f"{line[:-1]} {archive_replace}-{tag}.tar.xz ./vendor\n"
print(new_archives.replace('ARCHIVES = ', '', 1))
makefile.append(new_archives)
else:
makefile.append(line)
with open('Makefile', 'w', encoding='utf8') as mfile:
mfile.writelines(makefile)
archive_match = os.path.join('http://localhost', 'cgit', 'vendor', name,
'snapshot', name)
with open('options.conf', encoding='utf8') as ofile:
for line in ofile.readlines():
if line.startswith('archives'):
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz', line):
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz',
f"{archive_match}-{tag}.tar.xz", line)
else:
new_archives = f"{line[:-1]} {archive_match}-{tag}.tar.xz ./vendor\n"
options.append(new_archives)
else:
options.append(line)
with open('options.conf', 'w', encoding='utf8') as ofile:
ofile.writelines(options)
with open('cargo_vendors', 'w', encoding='utf8') as cfile:
cfile.write(cargo_vendors)
def main():
updated = False
args = get_args()
vtype = vendor_check()
if not vtype:
print(args.archives)
return
args = get_args()
tdir = setup_content(args.url)
if vtype == 'cargo':
vdir = setup_cargo_vendor(tdir)
if vdir:
tag = update_cargo_vendor(vdir, args.name, args.git)
tag, cargo_vendors = update_cargo_vendor(vdir, args.name, args.git)
if tag:
update_cargo_sources(args.name, tag)
update_cargo_sources(args.name, tag, cargo_vendors)
updated = True
if not updated:
print(args.archives)
shutil.rmtree(tdir)
if __name__ == '__main__':
main()