mirror of
https://github.com/clearlinux/common.git
synced 2026-06-16 11:06:15 +00:00
Compare commits
262 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| accf578c02 | |||
| efe2b2bccf | |||
| 9f77cbb6e3 | |||
| bd6c14938b | |||
| 32729558d9 | |||
| b2ad8dbda8 | |||
| e545190de3 | |||
| 9921115897 | |||
| 8d5f8e37c5 | |||
| 6bc5718c25 | |||
| a21156767e | |||
| 9dd5bb895b | |||
| 67b7ef2bf4 | |||
| 6ad56934fd | |||
| 7b08135720 | |||
| 168c9b8606 | |||
| 3ff4181689 | |||
| a581ac8fbf | |||
| 601ca9e0fc | |||
| 8848658fcf | |||
| b76a7bc7f8 | |||
| f8f9619eec | |||
| b7b8774581 | |||
| b3618cc43c | |||
| 921ac270fe | |||
| f41acbdeb0 | |||
| 83a461fe40 | |||
| 6876f3d11e | |||
| 5a4dd4451a | |||
| d48889eb29 | |||
| b402f2bbdf | |||
| 1fcaa4aea6 | |||
| 71b927321f | |||
| 40f17091a6 | |||
| 3b062e1b45 | |||
| 3c3fc1a16c | |||
| 3c7aac6a8e | |||
| baf555428f | |||
| 262d005c62 | |||
| ceff8301a1 | |||
| 8eb7264597 | |||
| c10d558ee6 | |||
| bd75d90fc7 | |||
| 081c620f82 | |||
| 7e017ee247 | |||
| 5b43360fe8 | |||
| eb8879f0f0 | |||
| f18ba9060d | |||
| 9fc1471023 | |||
| 9885cdbf9b | |||
| ce12c754ba | |||
| b363871adf | |||
| c028ea0072 | |||
| 7dc414433f | |||
| 50f18a0146 | |||
| 51c26d9a01 | |||
| c143f7ee95 | |||
| 81bd7f5e54 | |||
| 5d8e976a2a | |||
| 7d624ab7ae | |||
| ba14c4e50f | |||
| 34fb007895 | |||
| 153c8cf8f7 | |||
| be45cbcf9e | |||
| 853cc64dff | |||
| 7e81742862 | |||
| a6eceb3613 | |||
| 9956be75dc | |||
| c99415521e | |||
| 775d77c942 | |||
| 0c80ea9b2d | |||
| e75cdd1186 | |||
| 90f2aab33a | |||
| 64fa18b676 | |||
| dc6677df7e | |||
| 68d78be45d | |||
| 47e3b379d9 | |||
| b089c2eee1 | |||
| b66637b940 | |||
| 0802f3932b | |||
| 2507032cba | |||
| 5a1d5567ca | |||
| 05a7063d8e | |||
| 11ebc1c8fc | |||
| 463ae178c2 | |||
| 1d4aba3f8f | |||
| c7fc2c3961 | |||
| 82cd0ecd3f | |||
| f754a866c0 | |||
| 5d17b16122 | |||
| 51b040bccb | |||
| ad94d692e1 | |||
| 8f08161958 | |||
| 490bd76041 | |||
| 461918321b | |||
| 836969dddf | |||
| cabadbf7e3 | |||
| 2e20586c58 | |||
| bd721579a7 | |||
| f75cf1807e | |||
| 49f6d1b502 | |||
| 284ad47e91 | |||
| 7b3321fa58 | |||
| b2c8135aad | |||
| 8150769596 | |||
| a093411597 | |||
| e429dcaa45 | |||
| 06d1a29dc1 | |||
| 1548275e4b | |||
| fd0963167b | |||
| 517f5bc371 | |||
| 284ccd9ce0 | |||
| 43d436eec3 | |||
| 2bb93912f6 | |||
| 3a0c58c76f | |||
| 5519d04178 | |||
| e733b31a68 | |||
| 46bb95d483 | |||
| afafad1ed9 | |||
| bd030b99fe | |||
| 179cec491a | |||
| 3f9a4421d4 | |||
| 519fe3ef50 | |||
| a95343b9d1 | |||
| 4ffa3d7af0 | |||
| 05115e1bc3 | |||
| fff95669db | |||
| 36d363d533 | |||
| 74028d1094 | |||
| e9baf282b5 | |||
| fa36a19fe7 | |||
| cf4599a923 | |||
| 3e7a03c6b6 | |||
| c4e133da04 | |||
| 295db72a7c | |||
| a4927695e0 | |||
| e2ede0ec09 | |||
| d3f7e72d7c | |||
| ce67fd374a | |||
| 1feea0f15e | |||
| 4c1c55f03e | |||
| 214ebc3f93 | |||
| 00997dcd48 | |||
| 07fdbe3153 | |||
| b671ab5709 | |||
| fc29b4c1c3 | |||
| f108ac36d6 | |||
| 1c2bc9d50c | |||
| 8952175bc9 | |||
| 3812469ac2 | |||
| d1b434583a | |||
| dbd3c9accf | |||
| 6214fa5e9f | |||
| 8e9dd55e0f | |||
| 9ee80a2635 | |||
| 653105ffdf | |||
| a67fe47e39 | |||
| 103222eb4e | |||
| 0304bbd6b1 | |||
| 4ca1662790 | |||
| 94e2c39146 | |||
| d67be8a71b | |||
| 130f0f089e | |||
| a75e19a379 | |||
| d2e1c72c33 | |||
| b94a1c537f | |||
| 164dd8300e | |||
| 32141b9181 | |||
| bc66045b2d | |||
| 649a59bf12 | |||
| b1706fe2c4 | |||
| 6548a7a206 | |||
| a3fcd6a943 | |||
| 3c834e4761 | |||
| 77c334ec1a | |||
| 7c013dd5df | |||
| a499f61626 | |||
| 794174863b | |||
| dedad8c6c7 | |||
| 54737f7d97 | |||
| 56fdddbca3 | |||
| 58dff13c12 | |||
| 45a416f269 | |||
| b09ef7403e | |||
| 2059376f34 | |||
| 4501493d03 | |||
| df3579f538 | |||
| 3c01990ffc | |||
| 991e0baaaa | |||
| 434ab82632 | |||
| 0f814b2df9 | |||
| f2c3f4f95b | |||
| 590efe2b9c | |||
| 7919adae9f | |||
| 8ea05f2ae4 | |||
| 3560600fb6 | |||
| 0e54abbb3f | |||
| 3e7f5be6fc | |||
| 36d3edd56c | |||
| 9008cbccba | |||
| 04022fb765 | |||
| 424c34140e | |||
| f85cd42756 | |||
| e7afb1ae5e | |||
| 2c52a5ab39 | |||
| d84fec113e | |||
| f1b1424db4 | |||
| df8b789d60 | |||
| 78d7b4366b | |||
| 7be12344b6 | |||
| 04e58480cb | |||
| ebcc67f00b | |||
| f5b1aa8c87 | |||
| c61c91f9f2 | |||
| a57af837d8 | |||
| 03ba957d5f | |||
| d661496a4c | |||
| 4e1ce01d4e | |||
| dfeb8f9862 | |||
| 79c4befdea | |||
| c8c0c08100 | |||
| 877cd04101 | |||
| 7453e26bc7 | |||
| 11e0b5baee | |||
| 54c652944f | |||
| ef5179c975 | |||
| fc9793ff4e | |||
| 1508582709 | |||
| fca82072fa | |||
| 7fb07fdb29 | |||
| 387cb23c79 | |||
| c63ed02014 | |||
| d0773602f5 | |||
| 7b2b947843 | |||
| e619aeeab5 | |||
| f041821042 | |||
| 04e79ac6f7 | |||
| 942c21283f | |||
| 0803beead9 | |||
| 8bf3888935 | |||
| 3f2c7de583 | |||
| 514048840f | |||
| 012a1a3767 | |||
| 0168eb6258 | |||
| 2212f350e9 | |||
| 75a06769ea | |||
| 797f6c050c | |||
| 3169a8db4c | |||
| c6e5d09862 | |||
| 76d551ae77 | |||
| 92202763aa | |||
| 3a666723c1 | |||
| ed7e63d752 | |||
| bf6c49b8b9 | |||
| cc0b7da35a | |||
| 33febf4489 | |||
| 52ab50a9c7 | |||
| 70d40d9b59 | |||
| 8b709c2e1b | |||
| ea4e713277 | |||
| ca817a8c5e | |||
| db80ffd052 |
+55
-4
@@ -15,6 +15,7 @@ SRPMVERS = $(shell [ ! -f $(SPECFILE) ] || rpmspec -D '_vendor clr' --srpm -q --
|
||||
SRPMFILE = results/$(SRPMVERS).src.rpm
|
||||
|
||||
LATEST_RPMS = $(wildcard rpms/*.rpm)
|
||||
DEBUGINFO_RPM = $(wildcard rpms/*-debuginfo-*.rpm)
|
||||
RPMS ?= $(LATEST_RPMS)
|
||||
|
||||
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
|
||||
@@ -69,10 +70,9 @@ proper: repodel
|
||||
mockclean:
|
||||
$(MOCK) --clean --scrub=all
|
||||
|
||||
#help mockproper: Clean mock chroot and cache directories for this package.
|
||||
#help mockproper: Clean mock chroot
|
||||
mockproper:
|
||||
$(MOCK) --clean --scrub=all --uniqueext=$(PKG_NAME)
|
||||
$(MOCK) --clean --scrub=chroot --uniqueext=$(PKG_NAME)
|
||||
$(MOCK) --clean --uniqueext=$(PKG_NAME)
|
||||
|
||||
configemail:
|
||||
@test -d .git || git init
|
||||
@@ -154,13 +154,15 @@ pullrebase:
|
||||
fi \
|
||||
fi
|
||||
|
||||
preautospec-checks:
|
||||
|
||||
#help autospec: automatically generates a specfile. If there is
|
||||
#help already a specfile, it will be overwritten. Several files used by
|
||||
#help autospec will be created in the process.
|
||||
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options
|
||||
#help to autospec.
|
||||
#help For more information, see the project at https://github.com/clearlinux/autospec
|
||||
autospec: pullrebase localreponotice clean-old-content
|
||||
autospec: preautospec-checks pullrebase localreponotice clean-old-content
|
||||
@if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \
|
||||
echo "Specfile already exists and was not created by autospec.py! Aborting."; \
|
||||
exit 1; \
|
||||
@@ -184,6 +186,8 @@ autospec: pullrebase localreponotice clean-old-content
|
||||
bash update_changelog.sh ; \
|
||||
git commit --amend --no-edit Change* ; \
|
||||
fi
|
||||
git diff | grep -q index || python3 $(TOPLVL)/projects/common/patchfilter.py > for-review.txt ;
|
||||
git diff | grep -q index || python3 $(TOPLVL)/projects/common/patchfilter.py ;
|
||||
|
||||
#help autospecnogit: Runs autospec, but does not create a commit
|
||||
autospecnogit:
|
||||
@@ -406,6 +410,44 @@ install:
|
||||
done
|
||||
@$(MAKE) loop-down DEVICE=6
|
||||
|
||||
#help install-debuginfo-local: Install locally built debuginfo RPM to
|
||||
#help the automatic debuginfo cache location (/var/cache/debuginfo)
|
||||
install-debuginfo-local:
|
||||
@if [ -z "${DEBUGINFO_RPM}" ]; then \
|
||||
echo "No debuginfo to install... skipping"; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
echo -n "Installing ${DEBUGINFO_RPM}... "; \
|
||||
tmpdir=$$(mktemp -d); \
|
||||
rpm2cpio ${DEBUGINFO_RPM} | ( cd $$tmpdir; cpio -i -d -u 2> /dev/null); \
|
||||
dest=/var/cache/debuginfo/lib; \
|
||||
find $$tmpdir/usr/lib/debug/ -mindepth 1 -maxdepth 1 2> /dev/null | while read -r d; do \
|
||||
sudo chown -R dbginfo:dbginfo "$$d"; \
|
||||
sudo cp -a "$$d" $$dest/; \
|
||||
done; \
|
||||
dest=/var/cache/debuginfo/src; \
|
||||
find $$tmpdir/usr/src/debug/ -mindepth 1 -maxdepth 1 2> /dev/null | while read -r d; do \
|
||||
sudo chown -R dbginfo:dbginfo "$$d"; \
|
||||
sudo cp -a "$$d" $$dest/; \
|
||||
done; \
|
||||
sudo rm -rf $$tmpdir; \
|
||||
echo "done"
|
||||
|
||||
#help install-local: Install locally built RPMs to the root filesystem. Note that the
|
||||
#help debuginfo RPM installs to /var/cache/debuginfo
|
||||
install-local:
|
||||
@for r in $(filter-out ${DEBUGINFO_RPM},${RPMS}); do \
|
||||
echo -n "Installing $$r... "; \
|
||||
rpm2cpio $$r | (cd /; sudo cpio -i -d -u 2> /dev/null); \
|
||||
echo "done"; \
|
||||
done
|
||||
@$(MAKE) -s install-debuginfo-local
|
||||
|
||||
#help install-mock: Install locally built RPMs to the mock rootcache
|
||||
#help filesystem. This command is usually used with "make shell".
|
||||
install-mock: repoadd
|
||||
$(MOCK) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME) -i $(filter-out ${DEBUGINFO_RPM},${RPMS})
|
||||
|
||||
#help generateupstream: Run this rule to create or update the 'upstream' file
|
||||
#help by downloading the upstream source tarballs listed in the spec file and
|
||||
#help calculating their hashes. Autospec performs this step automatically, so
|
||||
@@ -433,6 +475,15 @@ generateupstream:
|
||||
drop-abandoned: $(SPECFILE)
|
||||
python3 $(TOPLVL)/projects/common/drop-abandoned-patches.py $(SPECFILE)
|
||||
|
||||
#help cloc: Count lines of code with the `cloc` tool on the full sources of package
|
||||
cloc: $(SRPMFILE)
|
||||
@$(MOCK) -r $(TOPLVL)/repo/clear.cfg $(SRPMFILE) --result=results/ --no-cleanup-after
|
||||
@$(MOCK) --chroot --copyin /usr/bin/cloc /usr/bin/cloc --result=results/ --no-cleanup-after
|
||||
@$(MOCK) --result=results/ --no-cleanup-after --chroot '/usr/bin/cloc /builddir > /tmp/cloc.txt'
|
||||
@$(MOCK) --copyout /tmp/cloc.txt results/ --result=results/
|
||||
@$(MOCK) --clean --scrub=chroot --uniqueext=$(PKG_NAME)
|
||||
cat results/cloc.txt
|
||||
|
||||
# Define site local common targets in a separate makefile
|
||||
-include $(TOPLVL)/projects/common/Makefile.common.site_local
|
||||
|
||||
|
||||
+9
-3
@@ -190,13 +190,15 @@ releases: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
|
||||
provides:
|
||||
@$(TOPLVL)/projects/common/provides.sh -f $(FP) -r $(RN)
|
||||
|
||||
preautospecnew-checks:
|
||||
|
||||
#help autospecnew: Creates a new autospec package with for a given URL=$(URL)
|
||||
#help with NAME=$(NAME). Several files used by 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
|
||||
autospecnew: localreponotice
|
||||
autospecnew: preautospecnew-checks localreponotice
|
||||
@if [ -z $(NAME) ] || [ -z $(URL) ]; then \
|
||||
echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \
|
||||
exit 1; \
|
||||
@@ -224,8 +226,12 @@ autospecnew: localreponotice
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
|
||||
$(URL); \
|
||||
[ $$? -eq 0 ] && $(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
|
||||
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
|
||||
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); \
|
||||
fi; \
|
||||
else \
|
||||
echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \
|
||||
exit 1; \
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -99,6 +99,8 @@ CECILL-2.0
|
||||
CECILL-2.1
|
||||
CECILL-B
|
||||
CECILL-C
|
||||
CERN-OHL-1.1
|
||||
CERN-OHL-1.2
|
||||
CNRI-Jython
|
||||
CNRI-Python
|
||||
CNRI-Python-GPL-Compatible
|
||||
@@ -169,6 +171,7 @@ Giftware
|
||||
Glide
|
||||
Glulxe
|
||||
HPND
|
||||
HPND-sell-variant
|
||||
HaskellReport
|
||||
IBM-pibs
|
||||
ICU
|
||||
@@ -182,6 +185,7 @@ Info-ZIP
|
||||
Intel
|
||||
Intel-ACPI
|
||||
Interbase-1.0
|
||||
JPNIC
|
||||
JSON
|
||||
JasPer-2.0
|
||||
LAL-1.2
|
||||
@@ -257,6 +261,9 @@ ODC-By-1.0
|
||||
ODbL-1.0
|
||||
OFL-1.0
|
||||
OFL-1.1
|
||||
OGL-UK-1.0
|
||||
OGL-UK-2.0
|
||||
OGL-UK-3.0
|
||||
OGTSL
|
||||
OLDAP-1.1
|
||||
OLDAP-1.2
|
||||
@@ -313,6 +320,7 @@ SPL-1.0
|
||||
SWL
|
||||
Saxpath
|
||||
Sendmail
|
||||
Sendmail-8.23
|
||||
SimPL-2.0
|
||||
Sleepycat
|
||||
Spencer-86
|
||||
@@ -320,6 +328,7 @@ Spencer-94
|
||||
Spencer-99
|
||||
StandardML-NJ
|
||||
SugarCRM-1.1.3
|
||||
TAPR-OHL-1.0
|
||||
TCL
|
||||
TCP-wrappers
|
||||
TMate
|
||||
@@ -358,6 +367,8 @@ Zimbra-1.4
|
||||
Zlib
|
||||
bzip2-1.0.5
|
||||
bzip2-1.0.6
|
||||
copyleft-next-0.3.0
|
||||
copyleft-next-0.3.1
|
||||
curl
|
||||
diffmark
|
||||
dvipdfm
|
||||
@@ -366,6 +377,7 @@ eGenix
|
||||
gSOAP-1.3b
|
||||
gnuplot
|
||||
iMatix
|
||||
libpng-2.0
|
||||
libtiff
|
||||
mpich2
|
||||
psfrag
|
||||
|
||||
+348
@@ -0,0 +1,348 @@
|
||||
#!/usr/bin/python3
|
||||
import sys
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
header = list()
|
||||
files = list()
|
||||
files_chunks = dict() # dict to list
|
||||
files_header = dict() # dict to list
|
||||
|
||||
|
||||
|
||||
def push_chunk(file, chunk):
|
||||
global files_chunks
|
||||
|
||||
if len(chunk) == 0:
|
||||
return
|
||||
|
||||
if file not in files_chunks:
|
||||
files_chunks[file] = list()
|
||||
|
||||
files_chunks[file].append(chunk)
|
||||
|
||||
|
||||
def parse_patch(lines):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
|
||||
phase = 0
|
||||
|
||||
currentfile = ""
|
||||
currentchunk = list()
|
||||
|
||||
|
||||
for line in lines:
|
||||
line = line.replace("\n","")
|
||||
|
||||
if line.startswith("diff --git"):
|
||||
|
||||
push_chunk(currentfile, currentchunk)
|
||||
currentchunk = list()
|
||||
|
||||
filename = line.replace("diff --git","")
|
||||
index= filename.find("b/")
|
||||
if index >= 0:
|
||||
filename = filename[index:].strip()
|
||||
currentfile = filename
|
||||
files.append(currentfile)
|
||||
phase = 1
|
||||
|
||||
if line.startswith("@@"):
|
||||
push_chunk(currentfile, currentchunk)
|
||||
currentchunk = list()
|
||||
phase = 2
|
||||
|
||||
|
||||
if phase == 0:
|
||||
header.append(line)
|
||||
if phase == 1:
|
||||
if currentfile not in files_header:
|
||||
files_header[currentfile] = list()
|
||||
files_header[currentfile].append(line)
|
||||
if phase == 2:
|
||||
currentchunk.append(line)
|
||||
|
||||
push_chunk(currentfile, currentchunk)
|
||||
currentchunk = list()
|
||||
|
||||
def print_all():
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
|
||||
for line in header:
|
||||
print(line)
|
||||
for file in files:
|
||||
for line in files_header[file]:
|
||||
print(line)
|
||||
if file in files_chunks:
|
||||
for chunk in files_chunks[file]:
|
||||
for line in chunk:
|
||||
print(line)
|
||||
|
||||
|
||||
def zap_entire_file(filename):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
if filename in files:
|
||||
files.remove(filename)
|
||||
|
||||
def zap_entire_file_end(filename):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
for file in files:
|
||||
if file.endswith(filename):
|
||||
files.remove(file)
|
||||
|
||||
def zap_line_in_file(filename, match):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
for file in files:
|
||||
if file.endswith(filename):
|
||||
for chunk in files_chunks[filename]:
|
||||
to_delete = list()
|
||||
for line in chunk:
|
||||
if line == ("+" + match):
|
||||
to_delete.append(line)
|
||||
if line == ("-" + match):
|
||||
to_delete.append(line)
|
||||
for line in to_delete:
|
||||
chunk.remove(line)
|
||||
|
||||
|
||||
def zap_line_in_file_start(filename, match):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
|
||||
for file in files:
|
||||
if file.endswith(filename):
|
||||
for chunk in files_chunks[file]:
|
||||
to_remove = list()
|
||||
for line in chunk:
|
||||
if line.startswith("+" + match):
|
||||
to_remove.append(line)
|
||||
if line.startswith("-" + match):
|
||||
to_remove.append(line)
|
||||
for line in to_remove:
|
||||
chunk.remove(line)
|
||||
|
||||
def zap_plus_line_in_file(filename):
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
|
||||
for file in files:
|
||||
if file.endswith(filename):
|
||||
for chunk in files_chunks[file]:
|
||||
to_remove = list()
|
||||
for line in chunk:
|
||||
if line.startswith("+"):
|
||||
to_remove.append(line)
|
||||
for line in to_remove:
|
||||
chunk.remove(line)
|
||||
|
||||
|
||||
|
||||
def chunk_empty(chunk):
|
||||
for line in chunk:
|
||||
if len(line) > 0 and line[0] == '+':
|
||||
return False
|
||||
return True
|
||||
|
||||
def zap_empty_chunks():
|
||||
global header
|
||||
global files
|
||||
global files_chunks
|
||||
global files_header
|
||||
files_to_remove = list()
|
||||
for file in files:
|
||||
if file not in files_chunks:
|
||||
files.remove(file)
|
||||
continue
|
||||
to_remove = list()
|
||||
for chunk in files_chunks[file]:
|
||||
if chunk_empty(chunk):
|
||||
to_remove.append(chunk)
|
||||
for c in to_remove:
|
||||
files_chunks[file].remove(c)
|
||||
if len(files_chunks[file]) == 0:
|
||||
files_to_remove.append(file)
|
||||
|
||||
for file in files_to_remove:
|
||||
files.remove(file)
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
filename = sys.argv[1]
|
||||
|
||||
with open (filename, "r") as myfile:
|
||||
lines = myfile.readlines()
|
||||
else:
|
||||
output = subprocess.check_output("git show", shell=True).decode("latin-1")
|
||||
lines = output.split("\n")
|
||||
|
||||
parse_patch(lines)
|
||||
|
||||
zap_entire_file("b/release")
|
||||
zap_entire_file("b/buildreq_cache")
|
||||
zap_entire_file("b/.gitignore")
|
||||
zap_entire_file("b/upstream")
|
||||
zap_entire_file("b/NEWS")
|
||||
zap_entire_file("b/ChangeLog")
|
||||
zap_entire_file_end("xz.sig")
|
||||
zap_entire_file_end("gz.sig")
|
||||
zap_entire_file_end("bz2.sig")
|
||||
|
||||
zap_line_in_file("b/testresults", "Total : 0")
|
||||
zap_line_in_file("b/testresults", "Pass : 0")
|
||||
zap_line_in_file("b/testresults", "Fail : 0")
|
||||
zap_line_in_file("b/testresults", "XFail : 0")
|
||||
zap_line_in_file("b/testresults", "Skip : 0")
|
||||
|
||||
zap_line_in_file("b/requires_ban", "#FOO")
|
||||
zap_line_in_file("b/Makefile", "ARCHIVES = ")
|
||||
zap_line_in_file("b/Makefile", "include ../common/Makefile.common")
|
||||
zap_line_in_file("b/Makefile", "")
|
||||
|
||||
zap_line_in_file_start(".spec", "Release :")
|
||||
zap_line_in_file_start(".spec", "Source99 :")
|
||||
zap_line_in_file_start(".spec", "Source0 :")
|
||||
zap_line_in_file_start(".spec", "export SOURCE_DATE_EPOCH")
|
||||
zap_line_in_file_start(".spec", "%setup -q -n ")
|
||||
zap_line_in_file_start(".spec", "URL :")
|
||||
zap_line_in_file_start(".spec", "Version :")
|
||||
zap_line_in_file_start(".spec", "Group : Development/Tools")
|
||||
zap_line_in_file_start(".spec", "No detailed description available")
|
||||
zap_line_in_file_start(".spec", "bin components for the")
|
||||
zap_line_in_file_start(".spec", "dev components for the")
|
||||
zap_line_in_file_start(".spec", "lib components for the")
|
||||
zap_line_in_file_start(".spec", "data components for the")
|
||||
zap_line_in_file_start(".spec", "locales components for the")
|
||||
zap_line_in_file_start(".spec", "license components for the")
|
||||
zap_line_in_file_start(".spec", "Group: Default")
|
||||
zap_line_in_file_start(".spec", "export http_proxy=http://127.0.0.1:9/")
|
||||
zap_line_in_file_start(".spec", "export https_proxy=http://127.0.0.1:9/")
|
||||
zap_line_in_file_start(".spec", "export ftp_proxy=http://127.0.0.1:9/")
|
||||
zap_line_in_file_start(".spec", "export no_proxy=localhost,127.0.0.1,0.0.0.0")
|
||||
zap_line_in_file_start(".spec", "Summary:")
|
||||
zap_line_in_file_start(".spec", "Group: Development")
|
||||
zap_line_in_file_start(".spec", "Group: Binaries")
|
||||
zap_line_in_file_start(".spec", "Group: Data")
|
||||
zap_line_in_file_start(".spec", "Group: Libraries")
|
||||
zap_line_in_file_start(".spec", "export LANG=C")
|
||||
zap_line_in_file_start(".spec", "%description lib")
|
||||
zap_line_in_file_start(".spec", "%description bin")
|
||||
zap_line_in_file_start(".spec", "%description data")
|
||||
zap_line_in_file_start(".spec", "%description locales")
|
||||
zap_line_in_file_start(".spec", "%description dev")
|
||||
zap_line_in_file_start(".spec", "%description license")
|
||||
|
||||
zap_line_in_file_start("b/Makefile", "URL =")
|
||||
zap_line_in_file_start("b/Makefile", "PKG_NAME :=")
|
||||
|
||||
zap_line_in_file("b/options.conf", "archives = ")
|
||||
zap_line_in_file("b/options.conf", "giturl = ")
|
||||
zap_line_in_file("b/options.conf", "[package]")
|
||||
zap_line_in_file("b/options.conf", "")
|
||||
zap_line_in_file("b/options.conf", "[autospec]")
|
||||
zap_line_in_file("b/options.conf", "# build 32 bit libraries")
|
||||
zap_line_in_file("b/options.conf", "32bit = false")
|
||||
zap_line_in_file("b/options.conf", "# allow package to build with test failures")
|
||||
zap_line_in_file("b/options.conf", "allow_test_failures = false")
|
||||
zap_line_in_file("b/options.conf", "# unset %build ld_as_needed variable")
|
||||
zap_line_in_file("b/options.conf", "asneeded = false")
|
||||
zap_line_in_file("b/options.conf", "# this package is trusted enough to automatically update (used by other tools)")
|
||||
zap_line_in_file("b/options.conf", "autoupdate = false")
|
||||
zap_line_in_file("b/options.conf", "# extend flags with '-std=gnu++98")
|
||||
zap_line_in_file("b/options.conf", "broken_c++ = false")
|
||||
zap_line_in_file("b/options.conf", "# disable parallelization during build")
|
||||
zap_line_in_file("b/options.conf", "broken_parallel_build = false")
|
||||
zap_line_in_file("b/options.conf", "# this package is a library compatability package and only ships versioned library files")
|
||||
zap_line_in_file("b/options.conf", "compat = false")
|
||||
zap_line_in_file("b/options.conf", "# set conservative build flags")
|
||||
zap_line_in_file("b/options.conf", "conservative_flags = false")
|
||||
zap_line_in_file("b/options.conf", "# dev package requires the extras to be installed")
|
||||
zap_line_in_file("b/options.conf", "dev_requires_extras = false")
|
||||
zap_line_in_file("b/options.conf", "# pass -ffast-math to compiler")
|
||||
zap_line_in_file("b/options.conf", "fast-math = false")
|
||||
zap_line_in_file("b/options.conf", "# optimize build for speed over size")
|
||||
zap_line_in_file("b/options.conf", "funroll-loops = false")
|
||||
zap_line_in_file("b/options.conf", "# set flags to smallest -02 flags possible")
|
||||
zap_line_in_file("b/options.conf", "insecure_build = false")
|
||||
zap_line_in_file("b/options.conf", "# do not remove static libraries")
|
||||
zap_line_in_file("b/options.conf", "keepstatic = false")
|
||||
zap_line_in_file("b/options.conf", "# do not require autostart subpackage")
|
||||
zap_line_in_file("b/options.conf", "no_autostart = false")
|
||||
zap_line_in_file("b/options.conf", "# disable stripping binaries")
|
||||
zap_line_in_file("b/options.conf", "nostrip = false")
|
||||
zap_line_in_file("b/options.conf", "# optimize build for size over speed")
|
||||
zap_line_in_file("b/options.conf", "optimize_size = false")
|
||||
zap_line_in_file("b/options.conf", "# set profile for pgo")
|
||||
zap_line_in_file("b/options.conf", "pgo = false")
|
||||
zap_line_in_file("b/options.conf", "# set flags for security-sensitive builds")
|
||||
zap_line_in_file("b/options.conf", "security_sensitive = false")
|
||||
zap_line_in_file("b/options.conf", "# do not run test suite")
|
||||
zap_line_in_file("b/options.conf", "skip_tests = false")
|
||||
zap_line_in_file("b/options.conf", "# add .so files to the lib package instead of dev")
|
||||
zap_line_in_file("b/options.conf", "so_to_lib = false")
|
||||
zap_line_in_file("b/options.conf", "# configure build for avx2")
|
||||
zap_line_in_file("b/options.conf", "use_avx2 = false")
|
||||
zap_line_in_file("b/options.conf", "# configure build for avx512")
|
||||
zap_line_in_file("b/options.conf", "use_avx512 = false")
|
||||
zap_line_in_file("b/options.conf", "# add clang flags")
|
||||
zap_line_in_file("b/options.conf", "use_clang = false")
|
||||
zap_line_in_file("b/options.conf", "# configure build for lto")
|
||||
zap_line_in_file("b/options.conf", "use_lto = false")
|
||||
zap_line_in_file("b/options.conf", "# require package verification for build")
|
||||
zap_line_in_file("b/options.conf", "verify_required = true")
|
||||
|
||||
zap_line_in_file("b/buildreq_add", "# This file contains additional build requirements that did not get")
|
||||
zap_line_in_file("b/buildreq_add", "# picked up automatically. One name per line, no whitespace.")
|
||||
zap_line_in_file("b/buildreq_ban", "# This file contains build requirements that get picked up but are")
|
||||
zap_line_in_file("b/buildreq_ban", "# undesirable. One entry per line, no whitespace.")
|
||||
|
||||
|
||||
zap_line_in_file("b/excludes", "# This file contains the output files that need %exclude. Full path")
|
||||
zap_line_in_file("b/excludes", "# names, one per line.")
|
||||
|
||||
zap_line_in_file("b/pkgconfig_add", "# This file contains additional pkgconfig build requirements that did")
|
||||
zap_line_in_file("b/pkgconfig_add", "# not get picked up automatically. One name per line, no whitespace.")
|
||||
zap_line_in_file("b/pkgconfig_ban", "# This file contains pkgconfig build requirements that get picked up")
|
||||
zap_line_in_file("b/pkgconfig_ban", "# but are undesirable. One entry per line, no whitespace.")
|
||||
zap_line_in_file("b/requires_add", "# This file contains additional runtime requirements that did not get")
|
||||
zap_line_in_file("b/requires_add", "# picked up automatically. One name per line, no whitespace.")
|
||||
zap_line_in_file("b/requires_ban", "# This file contains runtime requirements that get picked up but are")
|
||||
zap_line_in_file("b/requires_ban", "# undesirable. One entry per line, no whitespace.")
|
||||
|
||||
zap_line_in_file_start(".spec", "Summary : No detailed summary available")
|
||||
|
||||
zap_plus_line_in_file("symbols")
|
||||
zap_plus_line_in_file("symbols32")
|
||||
|
||||
zap_entire_file("b/whatrequires")
|
||||
|
||||
zap_empty_chunks()
|
||||
|
||||
print_all()
|
||||
|
||||
if __name__ == '__main__':
|
||||
with tempfile.TemporaryDirectory() as workingdir:
|
||||
main()
|
||||
|
||||
+9
-1
@@ -43,11 +43,19 @@ if [ ! -f "$IMAGE" ]; then
|
||||
fi
|
||||
rm -f debug.log
|
||||
|
||||
# 10/25/2018: keep back compatibility for a while
|
||||
UEFI_BIOS="-bios OVMF.fd"
|
||||
|
||||
if [ -f OVMF_VARS.fd -a -f OVMF_CODE.fd ]; then
|
||||
UEFI_BIOS=" -drive file=OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on "
|
||||
UEFI_BIOS+=" -drive file=OVMF_VARS.fd,if=pflash,format=raw,unit=1 "
|
||||
fi
|
||||
|
||||
VMN=${VMN:=1}
|
||||
|
||||
qemu-system-x86_64 \
|
||||
-enable-kvm \
|
||||
-bios OVMF.fd \
|
||||
${UEFI_BIOS} \
|
||||
-smp sockets=1,cpus=4,cores=2 -cpu host \
|
||||
-m 1024 \
|
||||
-vga none -nographic \
|
||||
|
||||
+12
-3
@@ -6,6 +6,7 @@ SERVERCA=""
|
||||
CLIENTCA=""
|
||||
WORKSPACE="clearlinux"
|
||||
PACKAGE_REPOS=
|
||||
NEEDS_KVM_GROUP=
|
||||
|
||||
help() {
|
||||
printf "%s\n" >&2 "Usage: $SCRIPT [options]" \
|
||||
@@ -115,6 +116,10 @@ required_progs() {
|
||||
|
||||
required_progs
|
||||
|
||||
if ! groups | grep -qw kvm; then
|
||||
NEEDS_KVM_GROUP=1
|
||||
fi
|
||||
|
||||
echo "Initializing development workspace in \"$WORKSPACE\" . . ."
|
||||
|
||||
mkdir "$WORKSPACE"
|
||||
@@ -146,8 +151,10 @@ if [ "$USE_KOJI" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Adding user to kvm group . . ."
|
||||
sudo usermod -a -G kvm $USER
|
||||
if [ -n "$NEEDS_KVM_GROUP" ]; then
|
||||
echo "Adding user to kvm group . . ."
|
||||
sudo usermod -a -G kvm $USER
|
||||
fi
|
||||
|
||||
echo "Cloning special project repositories . . ."
|
||||
make ${JOBS_ARG} clone-projects
|
||||
@@ -179,7 +186,9 @@ if [ -z "$PACKAGE_REPOS" ]; then
|
||||
echo "NOTE: To clone all package repos, run \"cd $WORKSPACE; make [-j NUM] clone-packages\""
|
||||
echo "NOTE: To clone a single package repo with NAME, run \"cd $WORKSPACE; make clone_NAME\""
|
||||
fi
|
||||
echo 'NOTE: logout and log back in to finalize the setup process'
|
||||
if [ -n "$NEEDS_KVM_GROUP" ]; then
|
||||
echo 'NOTE: logout and log back in to finalize the setup process'
|
||||
fi
|
||||
|
||||
|
||||
# vi: ft=sh sw=2 et sts=2
|
||||
|
||||
Reference in New Issue
Block a user