mirror of
https://github.com/clearlinux/common.git
synced 2026-06-16 19:16:00 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b2e15fa59 | |||
| ec3903192a | |||
| da6bc31e4a | |||
| c360ffe52c | |||
| f092f66d8d | |||
| 704e8c90b8 | |||
| 1ca80a16a3 | |||
| 27e359bda0 | |||
| 3db02dd609 | |||
| 5866d7afbf | |||
| 437d1ee01a | |||
| cb5d78bb2f | |||
| 9bfaefc491 | |||
| 64a20fa5c2 | |||
| e0b152250f | |||
| 70ca088ce6 | |||
| a3c7b734fa | |||
| 7ff8c3a6d5 | |||
| bdac11063e |
@@ -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
|
||||
@@ -581,6 +582,78 @@ cloc: $(SRPMFILE)
|
||||
@$(MOCK) --clean --scrub=chroot --uniqueext=$(PKG_NAME)
|
||||
cat results/cloc.txt
|
||||
|
||||
#help catchup: Backport the commits from the current version to the upstream HEAD (not release).
|
||||
#help Only works if giturl is defined and the current package version can be mapped to a git tag.
|
||||
catchup:
|
||||
$(MAKE) catchup-HEAD
|
||||
|
||||
#help catchup-<commit|tag>: Backport the commits from the current version to the specified commit or tag.
|
||||
#help Only works if giturl is defined and the current package version can be mapped to a git tag.
|
||||
catchup-%:
|
||||
@target=$*; \
|
||||
giturl=$$(grep -E '^giturl\s*=\s*\S+' options.conf | sed 's/giturl\s*=\s*//' 2>/dev/null); \
|
||||
if [[ -z "$${giturl}" ]]; then \
|
||||
echo "Error: giturl not defined in options.conf"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
mkdir -p results; \
|
||||
if [[ -d results/$(PKG_NAME) ]]; then \
|
||||
echo "Reusing existing repository..."; \
|
||||
git -C results/$(PKG_NAME) fetch origin; \
|
||||
else \
|
||||
echo "Cloning upstream repository..."; \
|
||||
git -C results clone "$${giturl}" $(PKG_NAME); \
|
||||
fi; \
|
||||
if ! git -C results/$(PKG_NAME) rev-parse --verify --quiet "$${target}" >/dev/null; then \
|
||||
echo "Error: Target commit/tag $${target} not found"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
version=$$(rpm -q --qf '%{VERSION}\n' --specfile $(SPECFILE) | head -1); \
|
||||
echo "Version: $${version}"; \
|
||||
current_tag=$$(git -C results/$(PKG_NAME) tag --list | grep -E "^($(PKG_NAME)-)?v?$${version}$$") || { \
|
||||
echo "Error: No tag found for current package version"; \
|
||||
exit 1; \
|
||||
}; \
|
||||
echo "Catching up from $${current_tag} to $${target}"; \
|
||||
for commit in $$(git -C results/$(PKG_NAME) log --reverse --pretty=oneline $${current_tag}..$${target} | cut -d' ' -f1); do \
|
||||
$(MAKE) backport-$${commit}; \
|
||||
done;
|
||||
|
||||
|
||||
#help backport-<commit>: Retrieve a commit from the upstream git repository and save it as a backport patch.
|
||||
#help The giturl is read from options.conf.
|
||||
backport-%:
|
||||
@commit=$*; \
|
||||
echo "Backporting commit: $${commit}"; \
|
||||
giturl=$$(grep -E '^giturl\s*=\s*\S+' options.conf | sed 's/giturl\s*=\s*//' 2>/dev/null); \
|
||||
if [[ -z "$${giturl}" ]]; then \
|
||||
echo "Error: giturl not defined in options.conf"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
mkdir -p results; \
|
||||
if [[ -d results/$(PKG_NAME) ]]; then \
|
||||
echo "Reusing existing repository..."; \
|
||||
git -C results/$(PKG_NAME) fetch origin; \
|
||||
else \
|
||||
echo "Cloning upstream repository..."; \
|
||||
git -C results clone "$${giturl}" $(PKG_NAME); \
|
||||
fi; \
|
||||
full_commit=$$(git -C results/$(PKG_NAME) show --pretty=oneline $${commit} 2>/dev/null | head -1 | cut -d' ' -f 1); \
|
||||
if [[ -z "$${full_commit}" ]]; then \
|
||||
echo "Error: Commit for $${commit} not found"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
patch=backport-$${full_commit}.patch; \
|
||||
git -C results/$(PKG_NAME) format-patch -1 --stdout $${full_commit} > $${patch}; \
|
||||
if [[ -s $${patch} ]]; then \
|
||||
echo "$${patch} created"; \
|
||||
grep -qE "^$${patch}$$" series 2>/dev/null || echo "$${patch}" >> series; \
|
||||
else \
|
||||
rm -f $${patch}; \
|
||||
echo "Error: Failed to create backport patch"; \
|
||||
exit 1; \
|
||||
fi \
|
||||
|
||||
.PHONY: whatrequires
|
||||
#help whatrequires: Output a list of packages that directly depend on this one,
|
||||
#help showing the subpackage-level breakdown. Each line of output has the format
|
||||
|
||||
@@ -180,6 +180,7 @@ R-Ryacas
|
||||
R-SGP
|
||||
R-SGPdata
|
||||
R-SQUAREM
|
||||
R-SimDesign
|
||||
R-Sleuth2
|
||||
R-SnowballC
|
||||
R-SparseM
|
||||
@@ -232,6 +233,7 @@ R-bayesplot
|
||||
R-bazar
|
||||
R-bbmle
|
||||
R-bdsmatrix
|
||||
R-beepr
|
||||
R-beeswarm
|
||||
R-bench
|
||||
R-benchr
|
||||
@@ -871,6 +873,7 @@ R-rsvg
|
||||
R-runjags
|
||||
R-rversions
|
||||
R-rvest
|
||||
R-rworldmap
|
||||
R-s2
|
||||
R-sampling
|
||||
R-sandwich
|
||||
@@ -1117,6 +1120,7 @@ ansible
|
||||
ansible-core
|
||||
antlr4-python3-runtime
|
||||
apache-ant
|
||||
apache-arrow
|
||||
appstream
|
||||
appstream-glib
|
||||
apr
|
||||
@@ -1203,6 +1207,7 @@ boost
|
||||
borgbackup
|
||||
boto3
|
||||
botocore
|
||||
bottom
|
||||
bovo
|
||||
box2d
|
||||
bpftool
|
||||
@@ -1233,10 +1238,12 @@ buildreq-qmake
|
||||
buildreq-qt6
|
||||
buildreq-scons
|
||||
buildx
|
||||
bwidget
|
||||
byobu
|
||||
bz2file
|
||||
bzip2
|
||||
c-ares
|
||||
c-blosc
|
||||
c-blosc2
|
||||
cJSON
|
||||
c_rehash
|
||||
@@ -1331,17 +1338,20 @@ colord-kde
|
||||
colordiff
|
||||
columbiad
|
||||
compat-Botan-soname2
|
||||
compat-abseil-cpp-rolling
|
||||
compat-atkmm-soname16
|
||||
compat-babeltrace-one
|
||||
compat-cairomm-soname10
|
||||
compat-codec2-soname1
|
||||
compat-enchant-soname1
|
||||
compat-ffmpeg-4.4
|
||||
compat-ffmpeg-6
|
||||
compat-fuse-soname2
|
||||
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
|
||||
@@ -1357,6 +1367,7 @@ compat-libvpx-soname8
|
||||
compat-pangomm-soname14
|
||||
compat-protobuf-soname29
|
||||
compat-protobuf-soname32
|
||||
compat-python3-rolling
|
||||
compat-re2-soname10
|
||||
compat-readline-soname5
|
||||
compat-taglib-soname1
|
||||
@@ -1398,6 +1409,7 @@ cups-filters
|
||||
cups-pk-helper
|
||||
curl
|
||||
cycler
|
||||
cyme
|
||||
cyrus-sasl
|
||||
dapl
|
||||
darktable
|
||||
@@ -1576,6 +1588,7 @@ fsearch
|
||||
fuse
|
||||
fwupd
|
||||
fwupd-efi
|
||||
game-music-emu
|
||||
garcon
|
||||
gawk
|
||||
gbinder-python
|
||||
@@ -1835,6 +1848,7 @@ ipe
|
||||
iperf
|
||||
ipmitool
|
||||
ipp-crypto
|
||||
ipp-usb
|
||||
iproute2
|
||||
ipset
|
||||
iptables
|
||||
@@ -1847,6 +1861,7 @@ irrlicht
|
||||
irrlichtmt
|
||||
irssi
|
||||
isa-l
|
||||
isl
|
||||
iso-codes
|
||||
isodate
|
||||
isomd5sum
|
||||
@@ -2253,6 +2268,7 @@ libmbim
|
||||
libmediaart
|
||||
libmemcached
|
||||
libmicrohttpd
|
||||
libmikmod
|
||||
libmnl
|
||||
libmodbus
|
||||
libmodplug
|
||||
@@ -2339,6 +2355,7 @@ libsoup
|
||||
libspatialindex
|
||||
libspatialite
|
||||
libspectre
|
||||
libspelling
|
||||
libspiro
|
||||
libspnav
|
||||
libspng
|
||||
@@ -2372,6 +2389,7 @@ libva
|
||||
libva-intel-driver
|
||||
libva-utils
|
||||
libvdpau
|
||||
libversion
|
||||
libvirt
|
||||
libvirt-dbus
|
||||
libvirt-glib
|
||||
@@ -2425,6 +2443,7 @@ linux-ltscurrent
|
||||
linux-ltsprev
|
||||
linux-preempt-rt
|
||||
linux-tools
|
||||
linuxcnc
|
||||
linuxptp
|
||||
lksctp-tools
|
||||
lldpd
|
||||
@@ -2433,6 +2452,7 @@ llvm14
|
||||
llvm15
|
||||
llvm16
|
||||
llvm17
|
||||
llvm18
|
||||
lm-sensors
|
||||
lmdb
|
||||
logrotate
|
||||
@@ -2595,6 +2615,7 @@ nettle
|
||||
network-manager-applet
|
||||
networkmanager-qt
|
||||
newt
|
||||
nextcloud-desktop
|
||||
nfs-utils
|
||||
nftables
|
||||
nghttp2
|
||||
@@ -3636,7 +3657,6 @@ php-zmq
|
||||
picmi
|
||||
picocom
|
||||
pidgin
|
||||
pidgin-sipe
|
||||
pigeonhole
|
||||
pigz
|
||||
pim-data-exporter
|
||||
@@ -3724,6 +3744,7 @@ pynvim
|
||||
pyotherside
|
||||
pyotp
|
||||
pyparted
|
||||
pypi-Yapps
|
||||
pypi-absl_py
|
||||
pypi-abydos
|
||||
pypi-accelerate
|
||||
@@ -3741,7 +3762,6 @@ pypi-alabaster
|
||||
pypi-altair
|
||||
pypi-altgraph
|
||||
pypi-amqp
|
||||
pypi-aniso8601
|
||||
pypi-annotated_types
|
||||
pypi-ansi2html
|
||||
pypi-ansible_builder
|
||||
@@ -3777,7 +3797,6 @@ pypi-atpublic
|
||||
pypi-attr
|
||||
pypi-attrdict
|
||||
pypi-attrs
|
||||
pypi-autocommand
|
||||
pypi-automat
|
||||
pypi-awesomeversion
|
||||
pypi-awscrt
|
||||
@@ -3795,7 +3814,6 @@ pypi-babel
|
||||
pypi-backcall
|
||||
pypi-backoff
|
||||
pypi-backports.ssl_match_hostname
|
||||
pypi-bash_kernel
|
||||
pypi-bashlex
|
||||
pypi-bcrypt
|
||||
pypi-beartype
|
||||
@@ -3812,6 +3830,8 @@ pypi-blessed
|
||||
pypi-blinker
|
||||
pypi-blivet
|
||||
pypi-blockdiag
|
||||
pypi-blosc
|
||||
pypi-blosc2
|
||||
pypi-bokeh
|
||||
pypi-boolean.py
|
||||
pypi-booleanoperations
|
||||
@@ -3832,14 +3852,12 @@ pypi-cachy
|
||||
pypi-cairocffi
|
||||
pypi-cairosvg
|
||||
pypi-calver
|
||||
pypi-capturer
|
||||
pypi-cattrs
|
||||
pypi-cerberus
|
||||
pypi-certbot
|
||||
pypi-certbot_dns_google
|
||||
pypi-certifi
|
||||
pypi-cffi
|
||||
pypi-cffsubr
|
||||
pypi-cfgv
|
||||
pypi-chai
|
||||
pypi-chaospy
|
||||
@@ -3849,7 +3867,6 @@ pypi-check_jsonschema
|
||||
pypi-check_manifest
|
||||
pypi-cheetah3
|
||||
pypi-cheroot
|
||||
pypi-cherrypy
|
||||
pypi-cibuildwheel
|
||||
pypi-ciscoisesdk
|
||||
pypi-ciso8601
|
||||
@@ -3861,11 +3878,11 @@ pypi-click_log
|
||||
pypi-clikit
|
||||
pypi-cloudevents
|
||||
pypi-cloudflare
|
||||
pypi-clr_artifact
|
||||
pypi-cmarkgfm
|
||||
pypi-cmd2
|
||||
pypi-codecov
|
||||
pypi-colorama
|
||||
pypi-coloredlogs
|
||||
pypi-colorlog
|
||||
pypi-columnize
|
||||
pypi-comm
|
||||
@@ -3886,6 +3903,7 @@ pypi-coveralls
|
||||
pypi-cppy
|
||||
pypi-crashtest
|
||||
pypi-crcmod
|
||||
pypi-crypt_r
|
||||
pypi-cryptography
|
||||
pypi-cryptography_vectors
|
||||
pypi-cs
|
||||
@@ -3908,6 +3926,7 @@ pypi-decorator
|
||||
pypi-deepmerge
|
||||
pypi-deepspeed
|
||||
pypi-dep_logic
|
||||
pypi-dependency_groups
|
||||
pypi-deprecated
|
||||
pypi-deprecation
|
||||
pypi-devpi_client
|
||||
@@ -3943,8 +3962,11 @@ pypi-doxypypy
|
||||
pypi-doxyqml
|
||||
pypi-dpcontracts
|
||||
pypi-dulwich
|
||||
pypi-durationpy
|
||||
pypi-ecdsa
|
||||
pypi-editables
|
||||
pypi-editdistance
|
||||
pypi-edlib
|
||||
pypi-einops
|
||||
pypi-elementpath
|
||||
pypi-enrich
|
||||
@@ -4099,10 +4121,8 @@ pypi-isort
|
||||
pypi-itsdangerous
|
||||
pypi-janus
|
||||
pypi-jaraco.classes
|
||||
pypi-jaraco.collections
|
||||
pypi-jaraco.context
|
||||
pypi-jaraco.functools
|
||||
pypi-jaraco.text
|
||||
pypi-jarn.viewdoc
|
||||
pypi-javaproperties
|
||||
pypi-jedi
|
||||
@@ -4115,7 +4135,6 @@ pypi-jinxed
|
||||
pypi-jmespath
|
||||
pypi-joblib
|
||||
pypi-josepy
|
||||
pypi-jsmin
|
||||
pypi-json5
|
||||
pypi-jsondiff
|
||||
pypi-jsonlines
|
||||
@@ -4145,7 +4164,6 @@ pypi-jupyterlab_server
|
||||
pypi-jupyterlab_widgets
|
||||
pypi-jupyterlite_core
|
||||
pypi-jupyterlite_pyodide_kernel
|
||||
pypi-jupyterlite_sphinx
|
||||
pypi-jxmlease
|
||||
pypi-kcc
|
||||
pypi-kerberos
|
||||
@@ -4163,6 +4181,7 @@ pypi-lazy
|
||||
pypi-lazy_loader
|
||||
pypi-lazy_object_proxy
|
||||
pypi-ldap3
|
||||
pypi-legacy_cgi
|
||||
pypi-levenshtein
|
||||
pypi-libarchive_c
|
||||
pypi-libevdev
|
||||
@@ -4237,12 +4256,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
|
||||
@@ -4331,6 +4352,7 @@ pypi-poetry
|
||||
pypi-poetry_core
|
||||
pypi-poetry_plugin_export
|
||||
pypi-polib
|
||||
pypi-polyleven
|
||||
pypi-port_for
|
||||
pypi-portalocker
|
||||
pypi-portend
|
||||
@@ -4344,6 +4366,7 @@ pypi-progress
|
||||
pypi-progressbar
|
||||
pypi-prometheus_client
|
||||
pypi-prompt_toolkit
|
||||
pypi-propcache
|
||||
pypi-proto_plus
|
||||
pypi-protobuf
|
||||
pypi-psautohint
|
||||
@@ -4372,6 +4395,7 @@ pypi-pycollada
|
||||
pypi-pycosat
|
||||
pypi-pycountry
|
||||
pypi-pycparser
|
||||
pypi-pycrdt
|
||||
pypi-pycryptodome
|
||||
pypi-pycryptodomex
|
||||
pypi-pycups
|
||||
@@ -4397,7 +4421,6 @@ pypi-pylint
|
||||
pypi-pymdown_extensions
|
||||
pypi-pynacl
|
||||
pypi-pynetbox
|
||||
pypi-pynsist
|
||||
pypi-pynvml
|
||||
pypi-pyomo
|
||||
pypi-pyopengl
|
||||
@@ -4487,6 +4510,7 @@ pypi-rapidfuzz
|
||||
pypi-rapidfuzz_capi
|
||||
pypi-rcssmin
|
||||
pypi-rdflib
|
||||
pypi-re2
|
||||
pypi-readme_renderer
|
||||
pypi-readtime
|
||||
pypi-recommonmark
|
||||
@@ -4496,7 +4520,6 @@ pypi-regress
|
||||
pypi-reportlab
|
||||
pypi-repoze.lru
|
||||
pypi-requests
|
||||
pypi-requests_download
|
||||
pypi-requests_file
|
||||
pypi-requests_gssapi
|
||||
pypi-requests_kerberos
|
||||
@@ -4512,7 +4535,6 @@ pypi-retrolab
|
||||
pypi-retry
|
||||
pypi-retry_decorator
|
||||
pypi-retryz
|
||||
pypi-retype
|
||||
pypi-rfc3339_validator
|
||||
pypi-rfc3986
|
||||
pypi-rfc3986_validator
|
||||
@@ -4621,6 +4643,7 @@ pypi-subprocess_tee
|
||||
pypi-suds
|
||||
pypi-sure
|
||||
pypi-svg.path
|
||||
pypi-tables
|
||||
pypi-tabulate
|
||||
pypi-tap.py
|
||||
pypi-tblib
|
||||
@@ -4635,6 +4658,7 @@ pypi-text_unidecode
|
||||
pypi-textdistance
|
||||
pypi-textfsm
|
||||
pypi-texttable
|
||||
pypi-thefuzz
|
||||
pypi-threadpoolctl
|
||||
pypi-three_merge
|
||||
pypi-tifffile
|
||||
@@ -4654,7 +4678,6 @@ pypi-tornado_xstatic
|
||||
pypi-tox
|
||||
pypi-tqdm
|
||||
pypi-traitlets
|
||||
pypi-trampolim
|
||||
pypi-transformers
|
||||
pypi-translationstring
|
||||
pypi-trimesh
|
||||
@@ -4664,7 +4687,6 @@ pypi-trove_classifiers
|
||||
pypi-truststore
|
||||
pypi-ttp
|
||||
pypi-twine
|
||||
pypi-typed_ast
|
||||
pypi-typeguard
|
||||
pypi-types_cffi
|
||||
pypi-types_colorama
|
||||
@@ -4695,7 +4717,6 @@ pypi-tzdata
|
||||
pypi-tzlocal
|
||||
pypi-ua_parser
|
||||
pypi-uc_micro_py
|
||||
pypi-ufo2ft
|
||||
pypi-ufolib2
|
||||
pypi-uharfbuzz
|
||||
pypi-ujson
|
||||
@@ -4964,6 +4985,7 @@ s3fs-fuse
|
||||
salt
|
||||
samba
|
||||
samtools
|
||||
sane-airscan
|
||||
sane-backends
|
||||
sassc
|
||||
sbc
|
||||
@@ -4976,6 +4998,7 @@ scour
|
||||
scowl
|
||||
screen
|
||||
scummvm
|
||||
scx
|
||||
sddm
|
||||
sddm-kcm
|
||||
seahorse
|
||||
@@ -5087,7 +5110,9 @@ tallow
|
||||
tar
|
||||
taskwarrior
|
||||
tbb
|
||||
tbtools
|
||||
tcl
|
||||
tclx
|
||||
tcpdump
|
||||
tdb
|
||||
tecla
|
||||
@@ -5156,7 +5181,6 @@ usb-modeswitch-data
|
||||
usbredir
|
||||
usbutils
|
||||
userspace-rcu
|
||||
usrbinjava
|
||||
usrbinvi
|
||||
usrsctp
|
||||
utf8proc
|
||||
@@ -5302,6 +5326,7 @@ xrandr
|
||||
xrdb
|
||||
xrdp
|
||||
xrestop
|
||||
xscorch
|
||||
xscreensaver
|
||||
xsel
|
||||
xset
|
||||
|
||||
@@ -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,16 +70,18 @@ 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()):
|
||||
@@ -111,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:
|
||||
@@ -128,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)
|
||||
@@ -152,11 +155,11 @@ def main():
|
||||
|
||||
tdir = setup_content(args.url)
|
||||
if vtype == 'cargo':
|
||||
vdir = setup_cargo_vendor(tdir)
|
||||
if not vdir:
|
||||
cargo_paths = setup_cargo_vendor(tdir)
|
||||
if len(cargo_paths) == 0:
|
||||
print(args.archives)
|
||||
else:
|
||||
tag, cargo_vendors = update_cargo_vendor(vdir, args.name, args.git)
|
||||
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