mirror of
https://github.com/clearlinux/common.git
synced 2026-06-17 03:26:29 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bfaefc491 | |||
| 64a20fa5c2 | |||
| e0b152250f | |||
| 70ca088ce6 | |||
| a3c7b734fa | |||
| 7ff8c3a6d5 | |||
| bdac11063e | |||
| 52f73c1530 | |||
| 072d9b81a2 | |||
| 85a3e1cd32 | |||
| 3bf41ad9c9 | |||
| 92b3d682ec | |||
| ce873b4b19 |
@@ -223,6 +223,7 @@ scanlicense:
|
||||
#help the variable BUMP_MSG is set, its value is used as the commit summary.
|
||||
#help Otherwise a generic commit summary is used.
|
||||
bump:
|
||||
git stash
|
||||
git pull --rebase
|
||||
$(MAKE) bumpnogit
|
||||
git add $(SPECFILE) release
|
||||
|
||||
@@ -5,3 +5,4 @@ GFDL-1.3+
|
||||
MIT-Opengroup
|
||||
WXwindows
|
||||
w3c
|
||||
libpng-2.0
|
||||
|
||||
@@ -26,6 +26,7 @@ LibreCAD
|
||||
Linux-PAM
|
||||
LuaJIT
|
||||
LyX
|
||||
MangoHud
|
||||
MarkupSafe
|
||||
ModemManager
|
||||
MuseScore
|
||||
@@ -62,6 +63,8 @@ R-BMA
|
||||
R-BatchJobs
|
||||
R-BayesFactor
|
||||
R-BiasedUrn
|
||||
R-Biobase
|
||||
R-BiocGenerics
|
||||
R-BiocManager
|
||||
R-BoolNet
|
||||
R-BradleyTerry2
|
||||
@@ -266,6 +269,7 @@ R-calibrator
|
||||
R-callr
|
||||
R-car
|
||||
R-carData
|
||||
R-cards
|
||||
R-caret
|
||||
R-cclust
|
||||
R-cellranger
|
||||
@@ -1113,6 +1117,7 @@ ansible
|
||||
ansible-core
|
||||
antlr4-python3-runtime
|
||||
apache-ant
|
||||
apache-arrow
|
||||
appstream
|
||||
appstream-glib
|
||||
apr
|
||||
@@ -1159,7 +1164,10 @@ avahi
|
||||
awesome-wm
|
||||
awscli
|
||||
axel
|
||||
azure-c-logging
|
||||
azure-configs
|
||||
azure-macro-utils-c
|
||||
azure-umock-c
|
||||
babeltrace
|
||||
babl
|
||||
baloo
|
||||
@@ -1230,6 +1238,7 @@ byobu
|
||||
bz2file
|
||||
bzip2
|
||||
c-ares
|
||||
c-blosc
|
||||
c-blosc2
|
||||
cJSON
|
||||
c_rehash
|
||||
@@ -1324,6 +1333,7 @@ colord-kde
|
||||
colordiff
|
||||
columbiad
|
||||
compat-Botan-soname2
|
||||
compat-abseil-cpp-rolling
|
||||
compat-atkmm-soname16
|
||||
compat-babeltrace-one
|
||||
compat-cairomm-soname10
|
||||
@@ -1335,8 +1345,10 @@ compat-gcc-10
|
||||
compat-gcr-soname1
|
||||
compat-glibmm-soname24
|
||||
compat-gnome-bluetooth-soname-13
|
||||
compat-grpc-soname66
|
||||
compat-gsl-soname27
|
||||
compat-gtksourceview-soname3
|
||||
compat-icu4c-rolling
|
||||
compat-json-c-soname4
|
||||
compat-libffi-soname6
|
||||
compat-libffi-soname7
|
||||
@@ -1390,6 +1402,7 @@ cups-filters
|
||||
cups-pk-helper
|
||||
curl
|
||||
cycler
|
||||
cyme
|
||||
cyrus-sasl
|
||||
dapl
|
||||
darktable
|
||||
@@ -1570,6 +1583,7 @@ fwupd
|
||||
fwupd-efi
|
||||
garcon
|
||||
gawk
|
||||
gbinder-python
|
||||
gc
|
||||
gcab
|
||||
gcc
|
||||
@@ -1686,6 +1700,9 @@ goaccess
|
||||
gobject-introspection
|
||||
golang-github-cpuguy83-go-md2man
|
||||
goocanvas
|
||||
google-benchmark
|
||||
google-cloud-cpp
|
||||
google-crc32c
|
||||
googletest
|
||||
gparted
|
||||
gpaste
|
||||
@@ -1749,6 +1766,7 @@ gzip
|
||||
hamlib
|
||||
haproxy
|
||||
hardinfo
|
||||
hardinfo2
|
||||
harfbuzz
|
||||
haveged
|
||||
hdf5
|
||||
@@ -1759,6 +1777,7 @@ help2man
|
||||
hexchat
|
||||
hexedit
|
||||
hicolor-icon-theme
|
||||
highway
|
||||
hiredis-c
|
||||
hostname
|
||||
howdy
|
||||
@@ -1770,7 +1789,6 @@ hub
|
||||
hugo
|
||||
hunspell
|
||||
hwloc
|
||||
hyperscan
|
||||
hyphen
|
||||
i2c-tools
|
||||
i3
|
||||
@@ -2179,6 +2197,7 @@ libfontenc
|
||||
libfprint
|
||||
libfreehand
|
||||
libftdi1
|
||||
libgbinder
|
||||
libgcrypt
|
||||
libgd
|
||||
libgdata
|
||||
@@ -2187,6 +2206,7 @@ libgee
|
||||
libgeotiff
|
||||
libgit2
|
||||
libgit2-glib
|
||||
libglibutil
|
||||
libglvnd
|
||||
libgnome-keyring
|
||||
libgnomekbd
|
||||
@@ -2271,6 +2291,7 @@ libodfgen
|
||||
libogg
|
||||
libopenmpt
|
||||
libopenzwave
|
||||
libopusenc
|
||||
liborcus
|
||||
libosinfo
|
||||
libpagemaker
|
||||
@@ -2323,6 +2344,7 @@ libsoup
|
||||
libspatialindex
|
||||
libspatialite
|
||||
libspectre
|
||||
libspelling
|
||||
libspiro
|
||||
libspnav
|
||||
libspng
|
||||
@@ -2416,6 +2438,8 @@ llvm
|
||||
llvm14
|
||||
llvm15
|
||||
llvm16
|
||||
llvm17
|
||||
llvm18
|
||||
lm-sensors
|
||||
lmdb
|
||||
logrotate
|
||||
@@ -2437,6 +2461,7 @@ luarocks
|
||||
lutris
|
||||
luv
|
||||
lv2
|
||||
lxc
|
||||
lynx
|
||||
lz4
|
||||
lzlib
|
||||
@@ -2487,6 +2512,7 @@ micro-config-drive-aws
|
||||
micro-config-drive-equinix
|
||||
micro-config-drive-oci
|
||||
milou
|
||||
mimalloc
|
||||
mimetreeparser
|
||||
minetest
|
||||
minetest_game
|
||||
@@ -2523,6 +2549,7 @@ motd-update
|
||||
motif
|
||||
mozjs102
|
||||
mozjs115
|
||||
mozjs128
|
||||
mozjs91
|
||||
mpc
|
||||
mpfr
|
||||
@@ -2575,6 +2602,7 @@ nettle
|
||||
network-manager-applet
|
||||
networkmanager-qt
|
||||
newt
|
||||
nextcloud-desktop
|
||||
nfs-utils
|
||||
nftables
|
||||
nghttp2
|
||||
@@ -3086,6 +3114,7 @@ perl-IPC-ShareLite
|
||||
perl-IPC-Shareable
|
||||
perl-IPC-System-Simple
|
||||
perl-Image-Base
|
||||
perl-Image-ExifTool
|
||||
perl-Image-Info
|
||||
perl-Image-Size
|
||||
perl-Image-Xbm
|
||||
@@ -3717,6 +3746,7 @@ pypi-aiosignal
|
||||
pypi-aiosmtpd
|
||||
pypi-aiosqlite
|
||||
pypi-alabaster
|
||||
pypi-altair
|
||||
pypi-altgraph
|
||||
pypi-amqp
|
||||
pypi-aniso8601
|
||||
@@ -3790,6 +3820,8 @@ pypi-blessed
|
||||
pypi-blinker
|
||||
pypi-blivet
|
||||
pypi-blockdiag
|
||||
pypi-blosc
|
||||
pypi-blosc2
|
||||
pypi-bokeh
|
||||
pypi-boolean.py
|
||||
pypi-booleanoperations
|
||||
@@ -3856,6 +3888,7 @@ pypi-cons
|
||||
pypi-contextlib2
|
||||
pypi-contextvars
|
||||
pypi-contourpy
|
||||
pypi-controlnet_aux
|
||||
pypi-cookiecutter
|
||||
pypi-coverage
|
||||
pypi-coverage_enable_subprocess
|
||||
@@ -3915,12 +3948,17 @@ pypi-docopt
|
||||
pypi-docstring_parser
|
||||
pypi-docstring_to_markdown
|
||||
pypi-docutils
|
||||
pypi-doit
|
||||
pypi-doxypypy
|
||||
pypi-doxyqml
|
||||
pypi-dpcontracts
|
||||
pypi-dulwich
|
||||
pypi-durationpy
|
||||
pypi-ecdsa
|
||||
pypi-editables
|
||||
pypi-editdistance
|
||||
pypi-edlib
|
||||
pypi-einops
|
||||
pypi-elementpath
|
||||
pypi-enrich
|
||||
pypi-entrypoints
|
||||
@@ -3971,6 +4009,7 @@ pypi-ftfy
|
||||
pypi-funcparserlib
|
||||
pypi-future
|
||||
pypi-gast
|
||||
pypi-gdown
|
||||
pypi-gevent
|
||||
pypi-geventhttpclient
|
||||
pypi-ghp_import
|
||||
@@ -4117,6 +4156,9 @@ pypi-jupyterlab_link_share
|
||||
pypi-jupyterlab_pygments
|
||||
pypi-jupyterlab_server
|
||||
pypi-jupyterlab_widgets
|
||||
pypi-jupyterlite_core
|
||||
pypi-jupyterlite_pyodide_kernel
|
||||
pypi-jupyterlite_sphinx
|
||||
pypi-jxmlease
|
||||
pypi-kcc
|
||||
pypi-kerberos
|
||||
@@ -4199,6 +4241,7 @@ pypi-mutagen
|
||||
pypi-mypy_extensions
|
||||
pypi-myst_nb
|
||||
pypi-myst_parser
|
||||
pypi-narwhals
|
||||
pypi-natsort
|
||||
pypi-nbclassic
|
||||
pypi-nbclient
|
||||
@@ -4207,12 +4250,14 @@ pypi-nbformat
|
||||
pypi-nbsphinx
|
||||
pypi-nbval
|
||||
pypi-ndg_httpsclient
|
||||
pypi-ndindex
|
||||
pypi-neat_python
|
||||
pypi-nest_asyncio
|
||||
pypi-netapp_lib
|
||||
pypi-netdisco
|
||||
pypi-netifaces
|
||||
pypi-networkx
|
||||
pypi-nftables
|
||||
pypi-nh3
|
||||
pypi-nibabel
|
||||
pypi-nltk
|
||||
@@ -4301,6 +4346,7 @@ pypi-poetry
|
||||
pypi-poetry_core
|
||||
pypi-poetry_plugin_export
|
||||
pypi-polib
|
||||
pypi-polyleven
|
||||
pypi-port_for
|
||||
pypi-portalocker
|
||||
pypi-portend
|
||||
@@ -4329,18 +4375,21 @@ pypi-py3dns
|
||||
pypi-py3nvml
|
||||
pypi-py_cpuinfo
|
||||
pypi-pyaml
|
||||
pypi-pyarrow
|
||||
pypi-pyasn1
|
||||
pypi-pyasn1_modules
|
||||
pypi-pybind11
|
||||
pypi-pybtex
|
||||
pypi-pybtex_docutils
|
||||
pypi-pycares
|
||||
pypi-pyclip
|
||||
pypi-pyclipper
|
||||
pypi-pycodestyle
|
||||
pypi-pycollada
|
||||
pypi-pycosat
|
||||
pypi-pycountry
|
||||
pypi-pycparser
|
||||
pypi-pycrdt
|
||||
pypi-pycryptodome
|
||||
pypi-pycryptodomex
|
||||
pypi-pycups
|
||||
@@ -4590,6 +4639,7 @@ pypi-subprocess_tee
|
||||
pypi-suds
|
||||
pypi-sure
|
||||
pypi-svg.path
|
||||
pypi-tables
|
||||
pypi-tabulate
|
||||
pypi-tap.py
|
||||
pypi-tblib
|
||||
@@ -4604,9 +4654,11 @@ pypi-text_unidecode
|
||||
pypi-textdistance
|
||||
pypi-textfsm
|
||||
pypi-texttable
|
||||
pypi-thefuzz
|
||||
pypi-threadpoolctl
|
||||
pypi-three_merge
|
||||
pypi-tifffile
|
||||
pypi-timm
|
||||
pypi-tinycss2
|
||||
pypi-tldextract
|
||||
pypi-tokenizers
|
||||
@@ -4616,6 +4668,7 @@ pypi-tomli_w
|
||||
pypi-tomlkit
|
||||
pypi-toolz
|
||||
pypi-torchmetrics
|
||||
pypi-torchvision
|
||||
pypi-tornado
|
||||
pypi-tornado_xstatic
|
||||
pypi-tox
|
||||
@@ -4797,6 +4850,7 @@ qhull
|
||||
qmapshack
|
||||
qml-box2d
|
||||
qpdf
|
||||
qpl
|
||||
qqc2-desktop-style
|
||||
qrencode
|
||||
qscintilla
|
||||
@@ -5084,6 +5138,7 @@ tig
|
||||
tigervnc
|
||||
time
|
||||
tini
|
||||
tinyxml2
|
||||
tiptop
|
||||
tk
|
||||
tmux
|
||||
@@ -5135,7 +5190,9 @@ vala
|
||||
valgrind
|
||||
valijson
|
||||
valkey
|
||||
vapoursynth
|
||||
vbox-integration
|
||||
vectorscan
|
||||
vid.stab
|
||||
vifm
|
||||
vim
|
||||
@@ -5155,6 +5212,7 @@ vsqlite
|
||||
vte
|
||||
waffle
|
||||
wavpack
|
||||
waydroid
|
||||
wayland
|
||||
wayland-protocols
|
||||
waypipe
|
||||
@@ -5168,10 +5226,12 @@ wget
|
||||
which
|
||||
whois
|
||||
wine
|
||||
winegui
|
||||
wireless-regdb-master
|
||||
wireplumber
|
||||
wireshark
|
||||
wl-clipboard
|
||||
wlrobs
|
||||
wlroots
|
||||
wmctrl
|
||||
woff2
|
||||
@@ -5189,6 +5249,7 @@ xapian-core
|
||||
xastir
|
||||
xauth
|
||||
xbitmaps
|
||||
xboxdrv
|
||||
xcb-proto
|
||||
xcb-util-cursor
|
||||
xcb-util-xrm
|
||||
@@ -5265,6 +5326,7 @@ xscreensaver
|
||||
xsel
|
||||
xset
|
||||
xsetroot
|
||||
xsimd
|
||||
xss-lock
|
||||
xterm
|
||||
xtrans
|
||||
|
||||
@@ -50,16 +50,17 @@ def setup_content(url):
|
||||
|
||||
|
||||
def setup_cargo_vendor(path):
|
||||
cargo_paths = []
|
||||
for dirpath, _, files in os.walk(path):
|
||||
for fname in files:
|
||||
if fname == "Cargo.toml":
|
||||
return dirpath
|
||||
return False
|
||||
cargo_paths.append(os.path.join(dirpath, fname))
|
||||
return cargo_paths
|
||||
|
||||
|
||||
def update_cargo_vendor(path, name, git):
|
||||
def update_cargo_vendor(tmpdir, cargo_paths, name, git):
|
||||
git_uri = os.path.join(git, name)
|
||||
vendor_path = os.path.join(path, 'vendor')
|
||||
vendor_path = os.path.join(tmpdir, 'vendor')
|
||||
subprocess.run(f"git clone {git_uri} {vendor_path}", shell=True, check=True,
|
||||
stdout=subprocess.DEVNULL)
|
||||
vendor_git = os.path.join(vendor_path, '.git')
|
||||
@@ -69,20 +70,26 @@ def update_cargo_vendor(path, name, git):
|
||||
stdout=subprocess.DEVNULL)
|
||||
subprocess.run(f"git remote add origin {git_uri}", cwd=vendor_path,
|
||||
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,
|
||||
backup_vendor_git = os.path.join(tmpdir, 'clear-linux-vendor-git')
|
||||
subprocess.run(f"cp -a {vendor_git} {backup_vendor_git}", cwd=tmpdir,
|
||||
shell=True, check=True, stdout=subprocess.DEVNULL)
|
||||
shutil.rmtree(vendor_path)
|
||||
cargo_vendors = subprocess.run('cargo vendor', cwd=path, shell=True,
|
||||
vendor_cmd = 'cargo vendor ' + ' '.join([f"-s {x}" for x in cargo_paths[:-1]])
|
||||
vendor_cmd += f" --manifest-path {cargo_paths[-1]}"
|
||||
cargo_vendors = subprocess.run(vendor_cmd, cwd=tmpdir, shell=True,
|
||||
check=True, stdout=subprocess.PIPE,
|
||||
universal_newlines=True).stdout
|
||||
with open(os.path.join(vendor_path, ".gitattributes"), "w", encoding='utf8') as gafile:
|
||||
gafile.write("* text=false\n")
|
||||
subprocess.run(f"cp -a {backup_vendor_git} {vendor_git}", cwd=path,
|
||||
subprocess.run(f"cp -a {backup_vendor_git} {vendor_git}", cwd=tmpdir,
|
||||
shell=True, check=True, stdout=subprocess.DEVNULL)
|
||||
repo = Repo(vendor_path)
|
||||
if not (len(repo.untracked_files) > 0 or repo.is_dirty()):
|
||||
return False, ""
|
||||
# Always use the newest tag as sometimes a new tag will
|
||||
# be created but the package won't be updated to use it
|
||||
# for a different failure reason.
|
||||
tag = sorted(repo.tags, key=lambda x: x.name, reverse=True)[0]
|
||||
return tag, cargo_vendors
|
||||
subprocess.run('git add .', cwd=vendor_path, shell=True, check=True,
|
||||
stdout=subprocess.DEVNULL)
|
||||
subprocess.run('git commit -m "vendor update"', cwd=vendor_path,
|
||||
@@ -107,11 +114,11 @@ def update_cargo_sources(name, tag, cargo_vendors):
|
||||
with open('Makefile', encoding='utf8') as mfile:
|
||||
for line in mfile.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_replace}-{tag}.tar.xz", line)
|
||||
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz', line):
|
||||
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz',
|
||||
f"{archive_replace}-{tag}.tar.gz", line)
|
||||
else:
|
||||
new_archives = f"{line[:-1]} {archive_replace}-{tag}.tar.xz ./vendor\n"
|
||||
new_archives = f"{line[:-1]} {archive_replace}-{tag}.tar.gz ./vendor\n"
|
||||
print(new_archives.replace('ARCHIVES = ', '', 1))
|
||||
makefile.append(new_archives)
|
||||
else:
|
||||
@@ -124,11 +131,11 @@ def update_cargo_sources(name, tag, cargo_vendors):
|
||||
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)
|
||||
if re.search(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz', line):
|
||||
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.gz',
|
||||
f"{archive_match}-{tag}.tar.gz", line)
|
||||
else:
|
||||
new_archives = f"{line[:-1]} {archive_match}-{tag}.tar.xz ./vendor\n"
|
||||
new_archives = f"{line[:-1]} {archive_match}-{tag}.tar.gz ./vendor\n"
|
||||
options.append(new_archives)
|
||||
else:
|
||||
options.append(line)
|
||||
@@ -139,7 +146,6 @@ def update_cargo_sources(name, tag, cargo_vendors):
|
||||
|
||||
|
||||
def main():
|
||||
updated = False
|
||||
args = get_args()
|
||||
|
||||
vtype = vendor_check()
|
||||
@@ -149,14 +155,12 @@ def main():
|
||||
|
||||
tdir = setup_content(args.url)
|
||||
if vtype == 'cargo':
|
||||
vdir = setup_cargo_vendor(tdir)
|
||||
if vdir:
|
||||
tag, cargo_vendors = update_cargo_vendor(vdir, args.name, args.git)
|
||||
if tag:
|
||||
update_cargo_sources(args.name, tag, cargo_vendors)
|
||||
updated = True
|
||||
if not updated:
|
||||
print(args.archives)
|
||||
cargo_paths = setup_cargo_vendor(tdir)
|
||||
if len(cargo_paths) == 0:
|
||||
print(args.archives)
|
||||
else:
|
||||
tag, cargo_vendors = update_cargo_vendor(tdir, cargo_paths, args.name, args.git)
|
||||
update_cargo_sources(args.name, tag, cargo_vendors)
|
||||
shutil.rmtree(tdir)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user