[gentoo-commits] proj/tatt:master commit in: templates/

2023-04-24 Thread Sam James
commit: b300d2f02c89a0babe14ace86fb129075cf68faa
Author: Viorel Munteanu  gentoo  org>
AuthorDate: Wed Feb 22 10:07:49 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Apr 25 03:45:14 2023 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=b300d2f0

Update commit and bug messages

According to this:
https://wiki.gentoo.org/wiki/Project:AMD64_Arch_Testers
"On Bugzilla, do not use the comment 'amd64 stable', use 'amd64 tested'
or 'amd64 ok' instead"

I looked at recent stabilization commits and bugs and I updated the
messages to match.

Signed-off-by: Viorel Munteanu  gentoo.org>
Closes: https://github.com/gentoo/tatt/pull/78
Signed-off-by: Sam James  gentoo.org>

 templates/commit-header | 6 +++---
 templates/updatebug | 7 ++-
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/templates/commit-header b/templates/commit-header
index 5b99e7a..867e624 100644
--- a/templates/commit-header
+++ b/templates/commit-header
@@ -2,11 +2,11 @@
 pushd @@REPODIR@@ > /dev/null
 
 if [ "@@NEWKEYWORD@@" = "@@ARCH@@" ]; then
-   DESCR="@@ARCH@@ stable"
+   DESCR="Stabilize @@ARCH@@"
 else
-   DESCR="@@ARCH@@ keyworded"
+   DESCR="Keyword @@ARCH@@"
 fi
 
 if [ -n "@@BUG@@" ]; then
-   DESCR="${DESCR} (bug #@@BUG@@)"
+   DESCR="${DESCR}, #@@BUG@@"
 fi

diff --git a/templates/updatebug b/templates/updatebug
index 548aa06..f17d653 100644
--- a/templates/updatebug
+++ b/templates/updatebug
@@ -37,10 +37,7 @@ def main():
 
# We don't close bugs which still have other arches for obvious reasons,
# and security bugs because stabilization is not the last step for them.
-   if '@@NEWKEYWORD@@' == '@@ARCH@@':
-   comment = "@@ARCH@@ stable"
-   else:
-   comment = "@@ARCH@@ keyworded"
+   comment = "@@ARCH@@ done"
params['cc'] = {}
if has_my_arch:
params['cc']['remove'] = ['@@ARCH@@@gentoo.org']
@@ -48,7 +45,7 @@ def main():
if has_other_arches or 'Security' in response['product']:
params['comment']['body'] = comment
else:
-   params['comment']['body'] = comment + ', closing'
+   params['comment']['body'] = comment + '\r\n\r\nall arches done'
params['status'] = 'RESOLVED'
params['resolution'] = 'FIXED'
 



[gentoo-commits] proj/tatt:master commit in: /

2023-04-24 Thread Sam James
commit: 8313ab7e2acaf36fcdf2e6381aabfe60ddb306f9
Author: Sam James  gentoo  org>
AuthorDate: Tue Apr 25 03:45:38 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Apr 25 03:45:38 2023 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=8313ab7e

setup.py: crank to 0.11

Signed-off-by: Sam James  gentoo.org>

 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 6d2d730..bc84512 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 setup(name = "tatt",
-  version = "0.10",
+  version = "0.11",
   packages = find_packages(),
   scripts = ['scripts/tatt'],
   package_data = {



[gentoo-commits] proj/tatt:master commit in: templates/

2023-04-24 Thread Sam James
commit: cef1db7c4c2f5de26117a1676588cd7742a8
Author: Viorel Munteanu  gentoo  org>
AuthorDate: Wed Feb 22 10:07:21 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Apr 25 03:45:14 2023 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=cef1db7c

Replace repoman with pgkdev

Signed-off-by: Viorel Munteanu  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 templates/commit-snippet-2 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/commit-snippet-2 b/templates/commit-snippet-2
index 577db3b..93aed7b 100644
--- a/templates/commit-snippet-2
+++ b/templates/commit-snippet-2
@@ -1,7 +1,8 @@
 # Code for checking consistency of @@EBUILD@@
 pushd @@CP@@ > /dev/null
 
-repoman -d full || exit 1
-repoman -m "@@CP@@: ${DESCR}" commit || exit 1
+pkgcheck scan || exit 1
+git add @@EBUILD@@ || exit 1
+pkgdev commit -m "@@CP@@: ${DESCR}" --signoff || exit 1
 
 popd > /dev/null



[gentoo-commits] proj/tatt:master commit in: /

2022-10-12 Thread Sam James
commit: 19ad4fb89c8939f5d0f993536079870cec4c025d
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct 12 19:36:35 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct 12 19:36:39 2022 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=19ad4fb8

setup.py: 0.10

Signed-off-by: Sam James  gentoo.org>

 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 81904f3..6d2d730 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 setup(name = "tatt",
-  version = "0.9",
+  version = "0.10",
   packages = find_packages(),
   scripts = ['scripts/tatt'],
   package_data = {



[gentoo-commits] proj/tatt:master commit in: tatt/

2022-10-12 Thread Sam James
commit: 70486f7f37870796975ce228751fee68c64cfc88
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct 12 19:34:37 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct 12 19:34:37 2022 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=70486f7f

scriptwriter.py: only query rdeps site if rdeps config > 0

No point fetching if we're not testing any.

Signed-off-by: Sam James  gentoo.org>

 tatt/scriptwriter.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py
index 4d60e34..38437f5 100644
--- a/tatt/scriptwriter.py
+++ b/tatt/scriptwriter.py
@@ -120,7 +120,8 @@ def writerdepscript(job, config):
 for p in job.packageList:
 atom = p.packageCatName()
 pkgs.append(atom)
-rdeps = rdeps + stablerdeps (atom, config)
+if config['rdeps'] > 0:
+rdeps = rdeps + stablerdeps (atom, config)
 if len(rdeps) == 0:
 print("No stable rdeps for " + job.name)
 return



[gentoo-commits] proj/tatt:master commit in: tatt/

2021-11-02 Thread Sam James
commit: efb6c67172d2f53047dca0dd0573ee2de559f4d7
Author: Sam James  gentoo  org>
AuthorDate: Tue Nov  2 12:12:37 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Nov  2 12:12:37 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=efb6c671

tatt/dot-tatt-spec: default to arch=amd64, not x86

Signed-off-by: Sam James  gentoo.org>

 tatt/dot-tatt-spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tatt/dot-tatt-spec b/tatt/dot-tatt-spec
index 33aff95..67eb90b 100644
--- a/tatt/dot-tatt-spec
+++ b/tatt/dot-tatt-spec
@@ -2,7 +2,7 @@ successmessage=string(default="Archtested on @@ARCH@@: 
Everything fine")
 
ignoreprefix=string_list(default=list("elibc_","video_cards_","linguas_","python_targets_","python_single_target_","kdeenablefinal","test","debug"))
 template-dir=string(default="/usr/share/tatt/templates/")
 unmaskdir=string(default="/etc/portage/package.accept_keywords")
-arch=string(default="x86")
+arch=string(default="amd64")
 defaultopts=string(default="")
 emergeopts=string(default="")
 rdeps=integer(0,512,default=10)



[gentoo-commits] proj/tatt:master commit in: /

2021-11-02 Thread Sam James
commit: 0ef17201771e8658de76be559dbbe5a752dcf296
Author: Sam James  gentoo  org>
AuthorDate: Sun Oct 31 22:11:13 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Nov  2 11:52:22 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=0ef17201

templates/tatt_functions.sh: create logs dir

Signed-off-by: Sam James  gentoo.org>

 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index fcd23cb..81904f3 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 setup(name = "tatt",
-  version = "0.2",
+  version = "0.9",
   packages = find_packages(),
   scripts = ['scripts/tatt'],
   package_data = {



[gentoo-commits] proj/tatt:master commit in: templates/

2021-10-31 Thread Sam James
commit: f78714d5cb93f4f88e0dd0ddd592c76dc932c277
Author: Sam James  gentoo  org>
AuthorDate: Sun Oct 31 22:11:13 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Oct 31 22:11:13 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=f78714d5

templates/tatt_functions.sh: create logs dir

Signed-off-by: Sam James  gentoo.org>

 templates/tatt_functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index d4e7cdf..a672caf 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -31,6 +31,7 @@ function tatt_pkg_error
   BUILDDIR=/var/tmp/portage/${CP}
   BUILDLOG=${BUILDDIR}/temp/build.log
   if [[ -n "${TATT_BUILDLOGDIR}" && -s "${BUILDLOG}" ]]; then
+mkdir -p "${TATT_BUILDLOGDIR}"
 LOGNAME=$(mktemp -p "${TATT_BUILDLOGDIR}" 
"${CP/\//_}_${TATT_TEST_TYPE}_X")
 mv "${BUILDLOG}" "${LOGNAME}"
 echo "log has been saved as ${LOGNAME}" >> "${TATT_REPORTFILE}"



[gentoo-commits] proj/tatt:master commit in: tatt/

2021-10-20 Thread Sam James
commit: 2995ef1e25ed96bb79bd1a262a3578d633cb7a5c
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct 20 06:00:58 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct 20 06:01:13 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=2995ef1e

packageFinder.py: strip out ~ from 'arch' before passing to nattka

Reported-by: Jakov Smolić  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 tatt/packageFinder.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index fe1256e..4b32b6e 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -11,7 +11,7 @@ def findPackages (s, arch, repo, bugnum=False):
 
 if bugnum:
 print("Using Nattka to process the bug")
-output = subprocess.check_output(['nattka', '--repo', repo, 
'apply', '-a', arch, '-n', bugnum, '--ignore-sanity-check', 
'--ignore-dependencies'])
+output = subprocess.check_output(['nattka', '--repo', repo, 
'apply', '-a', arch.replace("~", ""), '-n', bugnum, '--ignore-sanity-check', 
'--ignore-dependencies'])
 output = output.decode("utf8").split("\n")
 output = [line for line in output if not line.startswith("#")]
 output = [line.split(" ")[0] for line in output]



[gentoo-commits] proj/tatt:master commit in: templates/

2021-07-04 Thread Rolf Eike Beer
commit: d930e543077f38007a34921506c1e09d5f42c9a0
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Sun Jul  4 15:43:26 2021 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Sun Jul  4 15:43:45 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=d930e543

initialize the result var for revdep test scripts

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 templates/revdep-header | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/revdep-header b/templates/revdep-header
index 5731d5d..8148053 100644
--- a/templates/revdep-header
+++ b/templates/revdep-header
@@ -10,6 +10,8 @@ export TATT_EMERGEOPTS="@@EMERGEOPTS@@"
 
 source "@@TEMPLATEDIR@@tatt_functions.sh"
 
+test_ret=0
+
 export USE
 
 echo -e "revdep tests started on $(date)\n" >> @@REPORTFILE@@



[gentoo-commits] proj/tatt:master commit in: templates/

2021-06-29 Thread Rolf Eike Beer
commit: 5b0d77c02b3bf855fc6117f7ac736f3462694aeb
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Mon Jun 28 15:09:10 2021 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Mon Jun 28 15:12:18 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=5b0d77c0

tatt_functions.sh: keep original use flags when doing initial minimal build

Otherwise missing python_targets_* or ruby_targets_* may cause the build to fail
early.

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 templates/tatt_functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index bd21e46..d4e7cdf 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -49,7 +49,7 @@ function tatt_test_pkg
 
# Do a first pass to avoid circular dependencies
# --onlydeps should mean we're avoiding (too much) duplicate work
-   USE="minimal -doc" emerge --onlydeps -q1 --with-test-deps 
${TATT_EMERGEOPTS} "${1:?}"
+   USE="${USE} minimal -doc" emerge --onlydeps -q1 --with-test-deps 
${TATT_EMERGEOPTS} "${1:?}"
 
 if ! emerge --onlydeps -q1 --with-test-deps ${TATT_EMERGEOPTS} "${1:?}"; 
then
   echo "merging test dependencies of ${1} failed" >> "${TATT_REPORTFILE}"



[gentoo-commits] proj/tatt:master commit in: templates/

2021-06-17 Thread Sam James
commit: b9b22135a5095cbcc4c26dc9573a0e677f2637f5
Author: Sam James  gentoo  org>
AuthorDate: Thu Jun 17 22:04:00 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Jun 17 22:04:00 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=b9b22135

tatt_functions.sh: avoid circular dependencies with USE="minimal -doc"

Emerge test dependencies with USE="minimal -doc" first. This should avoid 
circular
dependencies at least with a lot of dev-perl/* packages.

Signed-off-by: Sam James  gentoo.org>

 templates/tatt_functions.sh | 5 +
 1 file changed, 5 insertions(+)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 0e95e9a..bd21e46 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -46,6 +46,11 @@ function tatt_test_pkg
 {
   if [ "${1:?}" == "--test" ]; then
 shift
+
+   # Do a first pass to avoid circular dependencies
+   # --onlydeps should mean we're avoiding (too much) duplicate work
+   USE="minimal -doc" emerge --onlydeps -q1 --with-test-deps 
${TATT_EMERGEOPTS} "${1:?}"
+
 if ! emerge --onlydeps -q1 --with-test-deps ${TATT_EMERGEOPTS} "${1:?}"; 
then
   echo "merging test dependencies of ${1} failed" >> "${TATT_REPORTFILE}"
   return 1



[gentoo-commits] proj/tatt:master commit in: scripts/

2021-05-29 Thread Rolf Eike Beer
commit: f21b0d05feb942e814a94190b63e0b918f622bab
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Sat May 29 08:29:56 2021 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Sat May 29 08:33:22 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=f21b0d05

output a proper error message if the bug does not exist

Otherwise one would see the following misleading message:

File "/usr/lib/python-exec/python3.8/tatt", line 155, in 
  response = response["bugs"][0]
  IndexError: list index out of range

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 scripts/tatt | 4 
 1 file changed, 4 insertions(+)

diff --git a/scripts/tatt b/scripts/tatt
index 7524c8b..7d0f378 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -152,6 +152,10 @@ if options.bugnum:
 if "message" in response:
 print(response["message"])
 sys.exit(1)
+if len(response["bugs"]) == 0:
+print("bug " + options.bugnum + " not found in bugzilla")
+sys.exit(1)
+
 response = response["bugs"][0]
 if "KEYWORDREQ" in response["keywords"] or response["component"] == 
"Keywording":
 # This is a keywording bug:



[gentoo-commits] proj/tatt:master commit in: templates/, tatt/

2021-05-19 Thread Rolf Eike Beer
commit: e4daa909cf3f2dc00a535e2ab88a0b3ec7bafb85
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Wed May 19 15:51:33 2021 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Wed May 19 15:52:57 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=e4daa909

add a return code to the revdep test script

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 tatt/scriptwriter.py | 5 +
 templates/revdep-footer  | 2 ++
 templates/revdep-snippet | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py
index c540626..4d60e34 100644
--- a/tatt/scriptwriter.py
+++ b/tatt/scriptwriter.py
@@ -151,6 +151,11 @@ def writerdepscript(job, config):
 # Todo: remove duplicates
 outfile.write(rdepTestString(job, r, config))
 os.fchmod(outfile.fileno(), 0o744)
+
+if os.path.exists(config['template-dir'] + "revdep-footer"):
+footer = scriptTemplate(job, config, "revdep-footer")
+outfile.write(footer)
+
 outfile.close()
 
 

diff --git a/templates/revdep-footer b/templates/revdep-footer
new file mode 100644
index 000..90349dc
--- /dev/null
+++ b/templates/revdep-footer
@@ -0,0 +1,2 @@
+
+exit ${test_ret}

diff --git a/templates/revdep-snippet b/templates/revdep-snippet
index ca99034..7a5a8a9 100644
--- a/templates/revdep-snippet
+++ b/templates/revdep-snippet
@@ -1 +1 @@
-@@USE@@ tatt_test_pkg --test "@@CPV@@"
+@@USE@@ tatt_test_pkg --test "@@CPV@@" || test_ret=1



[gentoo-commits] proj/tatt:master commit in: templates/

2021-05-19 Thread Rolf Eike Beer
commit: 0a68e9fa39ed3de7caeeaa4f925b34e36eec2d97
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Wed May 19 15:40:20 2021 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Wed May 19 15:40:20 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=0a68e9fa

templates/tatt_functions.sh: don't be too verbose when building test deps

Also correctly signal failure to the caller when this fails.

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 templates/tatt_functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 75f6ba4..0e95e9a 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -46,9 +46,9 @@ function tatt_test_pkg
 {
   if [ "${1:?}" == "--test" ]; then
 shift
-if ! emerge --onlydeps -1 --with-test-deps ${TATT_EMERGEOPTS} "${1:?}"; 
then
+if ! emerge --onlydeps -q1 --with-test-deps ${TATT_EMERGEOPTS} "${1:?}"; 
then
   echo "merging test dependencies of ${1} failed" >> "${TATT_REPORTFILE}"
-  return 0
+  return 1
 fi
 TFEATURES="${FEATURES} test"
   else



[gentoo-commits] proj/tatt:master commit in: templates/

2021-03-03 Thread Sam James
commit: ad209cde65eb56bc53fbe08106a6059daca1293b
Author: Sam James  gentoo  org>
AuthorDate: Thu Mar  4 00:25:39 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Mar  4 00:25:39 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=ad209cde

templates/tatt_functions.sh: add explanatory comment

See: 96a87558e37bc639a90ad17d4ffe07fc4bb2f30f
Bug: #72
Signed-off-by: Sam James  gentoo.org>

 templates/tatt_functions.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 78b65ee..75f6ba4 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -55,6 +55,8 @@ function tatt_test_pkg
 TFEATURES="${FEATURES}"
   fi
 
+  # --usepkg-exclude needs the package name, so let's extract it
+  # from the atom we have
   local name=$(portageq pquery "${1:?}" -n)
 
   eout=$( FEATURES="${TFEATURES}" emerge -1 --getbinpkg=n 
--usepkg-exclude="${name}" ${TATT_EMERGEOPTS} "${1:?}" 2>&1 1>/dev/tty )



[gentoo-commits] proj/tatt:master commit in: templates/

2021-03-03 Thread Sam James
commit: 96a87558e37bc639a90ad17d4ffe07fc4bb2f30f
Author: Sam James  gentoo  org>
AuthorDate: Thu Mar  4 00:20:44 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Mar  4 00:20:44 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=96a87558

templates/tatt_functions.sh: pass package name (not atom) to --usepkg-exclude

Fixes: eafc7c666d773cfd3b8295474a24cb6eef0919ce
Fixes: https://github.com/gentoo/tatt/issues/72
Signed-off-by: Sam James  gentoo.org>

 templates/tatt_functions.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 2893dc0..78b65ee 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -55,7 +55,9 @@ function tatt_test_pkg
 TFEATURES="${FEATURES}"
   fi
 
-  eout=$( FEATURES="${TFEATURES}" emerge -1 --getbinpkg=n 
--usepkg-exclude="${1:?}" ${TATT_EMERGEOPTS} "${1:?}" 2>&1 1>/dev/tty )
+  local name=$(portageq pquery "${1:?}" -n)
+
+  eout=$( FEATURES="${TFEATURES}" emerge -1 --getbinpkg=n 
--usepkg-exclude="${name}" ${TATT_EMERGEOPTS} "${1:?}" 2>&1 1>/dev/tty )
   if [[ $? == 0 ]] ; then
 if [ -n "${TFEATURES}" ]; then
   echo -n "FEATURES='${TFEATURES}' " >> "${TATT_REPORTFILE}"



[gentoo-commits] proj/tatt:master commit in: tatt/

2021-02-24 Thread Sam James
commit: b64c30c124116d88ffb7339db6a7dd798b22e04f
Author: Sam James  gentoo  org>
AuthorDate: Wed Feb 24 21:45:25 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 24 21:45:25 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=b64c30c1

tatt/usecombis.py: Tidy up

Signed-off-by: Sam James  gentoo.org>

 tatt/usecombis.py | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tatt/usecombis.py b/tatt/usecombis.py
index c24a82c..1603b6b 100644
--- a/tatt/usecombis.py
+++ b/tatt/usecombis.py
@@ -56,20 +56,20 @@ def findUseFlagCombis (package, config, port):
 ignore_use_expand = False
 
 while len(swlist) < config['usecombis'] and len(rnds) < s:
-if attempts >= 1 and not ignore_use_expand:
-# After 1 attempts, let's give up on USE_EXPAND.
-ignore_use_expand = True
-attempts = 0
+if attempts >= 1:
+if not ignore_use_expand:
+# After 1 attempts, let's give up on USE_EXPAND.
+ignore_use_expand = True
+attempts = 0
 
-print("Giving up on USE_EXPAND after {0} tries to find valid 
USE combinations".format(attempts))
-print("We've found {0} USE combinations so 
far".format(len(swlist)))
-uselist = [use for use in uselist if not "_" in use]
-
-if attempts >= 1 and ignore_use_expand:
-# Let's give up entirely and use what we have.
-print("Giving up on finding more USE combinations after {0} 
further attempts".format(attempts))
-print("We've found {0} USE combinations".format(len(swlist)))
-break
+print("Giving up on USE_EXPAND after {0} tries to find 
valid USE combinations".format(attempts))
+print("We've found {0} USE combinations so 
far".format(len(swlist)))
+uselist = [use for use in uselist if not "_" in use]
+else:
+# Let's give up entirely and use what we have.
+print("Giving up on finding more USE combinations after 
{0} further attempts".format(attempts))
+print("We've found {0} USE 
combinations".format(len(swlist)))
+break
 
 r = random.randint(0, s-1)
 if r in rnds:



[gentoo-commits] proj/tatt:master commit in: tatt/

2021-02-16 Thread Sam James
commit: d023294af12750f1c9ff4d97b4d449eae6f57dcb
Author: Sam James  gentoo  org>
AuthorDate: Wed Feb 17 03:04:51 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 17 03:04:51 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=d023294a

tatt/usecombis.py: Give up after too many USE-generation attempts

Closes: #40
Signed-off-by: Sam James  gentoo.org>

 tatt/usecombis.py | 21 +
 1 file changed, 21 insertions(+)

diff --git a/tatt/usecombis.py b/tatt/usecombis.py
index fb67be7..c24a82c 100644
--- a/tatt/usecombis.py
+++ b/tatt/usecombis.py
@@ -46,11 +46,31 @@ def findUseFlagCombis (package, config, port):
 swlist.append(2**len(uselist) - 1)
 # Test if we can exhaust all USE-combis by computing the binary logarithm.
 elif len(uselist) > math.log(config['usecombis'],2):
+
 # Generate a sample of USE combis
 s = 2**(len (uselist))
 rnds = set()
 random.seed()
+
+attempts = 0
+ignore_use_expand = False
+
 while len(swlist) < config['usecombis'] and len(rnds) < s:
+if attempts >= 1 and not ignore_use_expand:
+# After 1 attempts, let's give up on USE_EXPAND.
+ignore_use_expand = True
+attempts = 0
+
+print("Giving up on USE_EXPAND after {0} tries to find valid 
USE combinations".format(attempts))
+print("We've found {0} USE combinations so 
far".format(len(swlist)))
+uselist = [use for use in uselist if not "_" in use]
+
+if attempts >= 1 and ignore_use_expand:
+# Let's give up entirely and use what we have.
+print("Giving up on finding more USE combinations after {0} 
further attempts".format(attempts))
+print("We've found {0} USE combinations".format(len(swlist)))
+break
+
 r = random.randint(0, s-1)
 if r in rnds:
 # already checked
@@ -58,6 +78,7 @@ def findUseFlagCombis (package, config, port):
 rnds.add(r)
 
 if not check_uses(ruse, uselist, r, package):
+attempts += 1
 # invalid combination
 continue
 



[gentoo-commits] proj/tatt:master commit in: templates/

2021-02-16 Thread Sam James
commit: eafc7c666d773cfd3b8295474a24cb6eef0919ce
Author: John Helmert III  posteo  net>
AuthorDate: Wed Feb 17 03:08:09 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 17 03:09:16 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=eafc7c66

templates/tatt_functions.sh: Don't use binpkgs when running the build test

This should force building the package even if
EMERGE_DEFAULT_OPTS has --usepkg=y or --getbinpkg=y, or if
FEATURES=getbinpkg.

Signed-off-by: John Helmert III  posteo.net>
Closes: https://github.com/gentoo/tatt/pull/71
Signed-off-by: Sam James  gentoo.org>

 templates/tatt_functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 57d3d65..2893dc0 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -55,7 +55,7 @@ function tatt_test_pkg
 TFEATURES="${FEATURES}"
   fi
 
-  eout=$( FEATURES="${TFEATURES}" emerge -1 ${TATT_EMERGEOPTS} "${1:?}" 2>&1 
1>/dev/tty )
+  eout=$( FEATURES="${TFEATURES}" emerge -1 --getbinpkg=n 
--usepkg-exclude="${1:?}" ${TATT_EMERGEOPTS} "${1:?}" 2>&1 1>/dev/tty )
   if [[ $? == 0 ]] ; then
 if [ -n "${TFEATURES}" ]; then
   echo -n "FEATURES='${TFEATURES}' " >> "${TATT_REPORTFILE}"



[gentoo-commits] proj/tatt:master commit in: scripts/

2021-02-09 Thread Sam James
commit: 0c0c7c098f18234c4ebdec93c1799b16e8b26cd0
Author: Sam James  gentoo  org>
AuthorDate: Wed Feb 10 02:47:20 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 10 02:47:20 2021 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=0c0c7c09

scripts/tatt: drop invalid ~ prefix to arch

Signed-off-by: Sam James  gentoo.org>

 scripts/tatt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tatt b/scripts/tatt
index 463e737..7524c8b 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -168,7 +168,7 @@ if options.bugnum:
 if response["cf_stabilisation_atoms"]:
 myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], 
get_repo_dir(config['repodir']), options.bugnum)
 if len(myJob.packageList) == 0 and ("KEYWORDREQ" in 
response["keywords"] or response["component"] == "Keywording"):
-myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + 
config['arch'], get_repo_dir(config['repodir']), options.bugnum)
+myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], 
get_repo_dir(config['repodir']), options.bugnum)
 else:
 response = session.get(config["bugzilla-url"] + 
"/rest/bug/{}/attachment".format(options.bugnum), 
params=params).json()["bugs"][str(options.bugnum)]
 for attachment in response:



[gentoo-commits] proj/tatt:master commit in: tatt/, scripts/

2020-09-11 Thread Sam James
commit: cc36b5e3e11a4b07b4b4ee0da8e58f8d2da296af
Author: Sam James  gentoo  org>
AuthorDate: Sat Jun 20 18:13:23 2020 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 10 19:07:30 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=cc36b5e3

tatt: Support file-only jobs via Nattka

Signed-off-by: Sam James  gentoo.org>
Closes: https://github.com/gentoo/tatt/pull/67
Signed-off-by: Sam James  gentoo.org>

 scripts/tatt  | 2 +-
 tatt/packageFinder.py | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/tatt b/scripts/tatt
index 27e9b61..463e737 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -142,7 +142,7 @@ if options.infile:
 else:
 myJob.type="stable"
 
-myJob.packageList = packageFinder.findPackages(packraw, targetarch)
+myJob.packageList = packageFinder.findPackages(packraw, targetarch, 
get_repo_dir(config['repodir']))
 ## -b and a bugnumber was given ?
 if options.bugnum:
 print("Bugnumber:  " + options.bugnum)

diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index 24c69ac..fe1256e 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -2,10 +2,10 @@
 import subprocess
 from .gentooPackage import gentooPackage as gP
 
-def findPackages (s, arch, repo, bugnum):
-""" Given a string s,
-and a string arch
-return all gentooPackages from that string that need actioning on that 
arch """
+def findPackages (s, arch, repo, bugnum=False):
+""" Given a string s, a string arch, a string path to the repo, and
+an integer bugnum, return all gentooPackages from that string
+that need actioning on that arch """
 
 packages = []
 



[gentoo-commits] proj/tatt:master commit in: scripts/, tatt/

2020-09-11 Thread Sam James
commit: f36367445c64e28200a3fbb8ef7be4295cabeba9
Author: Sam James  gentoo  org>
AuthorDate: Sat May  2 05:25:35 2020 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 10 19:07:29 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=f3636744

package lists: Use nattka to parse keywording bugs

NATTkA is now used for most of the package lists on Bugzilla.
Use it to parse the lists because currently we cannot handle
package atoms with no version in keywording bugs.

Closes: https://github.com/gentoo/tatt/issues/66
Closes: https://github.com/gentoo/tatt/issues/65
Signed-off-by: Sam James  gentoo.org>

 scripts/tatt  |  7 ---
 tatt/packageFinder.py | 17 ++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/scripts/tatt b/scripts/tatt
index b08adfd..9936006 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -166,9 +166,9 @@ if options.bugnum:
 sys.exit(1)
 if myJob.packageList==None:
 if response["cf_stabilisation_atoms"]:
-myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'])
+myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], 
config['repodir'], options.bugnum)
 if len(myJob.packageList) == 0 and ("KEYWORDREQ" in 
response["keywords"] or response["component"] == "Keywording"):
-myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + 
config['arch'])
+myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + 
config['arch'], config['repodir'], options.bugnum)
 else:
 response = session.get(config["bugzilla-url"] + 
"/rest/bug/{}/attachment".format(options.bugnum), 
params=params).json()["bugs"][str(options.bugnum)]
 for attachment in response:
@@ -176,7 +176,7 @@ if options.bugnum:
 continue
 for flag in attachment['flags']:
 if flag["name"] == "stabilization-list" and flag["status"] 
== '+':
-myJob.packageList = 
packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), 
config['arch'])
+myJob.packageList = 
packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), 
config['arch'], config['repodir'],  options.bugnum)
 
 
 # joint code for -f and -b
@@ -209,6 +209,7 @@ if myJob.packageList is not None and len(myJob.packageList) 
> 0:
 
 for p in myJob.packageList:
 print("Found the following package atom : " + p.packageString())
+
 # check if the package already has the needed keywords
 kw = port.aux_get(dep_getcpv(p.packageString()), ["KEYWORDS"])
 if len(kw) > 0:

diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index a404d39..24c69ac 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -1,17 +1,28 @@
 """module for extracting packages from a package/architecture list """
-
+import subprocess
 from .gentooPackage import gentooPackage as gP
 
-def findPackages (s, arch):
+def findPackages (s, arch, repo, bugnum):
 """ Given a string s,
 and a string arch
 return all gentooPackages from that string that need actioning on that 
arch """
 
 packages = []
 
-for line in s.splitlines():
+if bugnum:
+print("Using Nattka to process the bug")
+output = subprocess.check_output(['nattka', '--repo', repo, 
'apply', '-a', arch, '-n', bugnum, '--ignore-sanity-check', 
'--ignore-dependencies'])
+output = output.decode("utf8").split("\n")
+output = [line for line in output if not line.startswith("#")]
+output = [line.split(" ")[0] for line in output]
+else:
+print("Manually processing")
+output = s.splitlines()
+
+for line in output:
 if not line:
 continue
+
 atom, _, arches = line.replace('\t', ' ').partition(' ')
 archlist = arches.split(' ')
 if not arches or arch in archlist or ('~' + arch) in archlist:



[gentoo-commits] proj/tatt:master commit in: tatt/, scripts/

2020-09-11 Thread Sam James
commit: 042010b840bd920cece9ef00d06db392f142a7b3
Author: Sam James  gentoo  org>
AuthorDate: Sun Jun  7 01:15:09 2020 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 10 19:07:29 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=042010b8

tool: Refactor repodir handling

* Use given repodir in config if not blank
* Ditch ~/gentoo-x86 default (it's ancient)
  and error out if it doesn't exist
* If no repodir given, guess:
* /var/db/repos/gentoo, and then
* /usr/portage

Now that we use nattka, we need a working repodir.
Try some sensible defaults if the given one doesn't
work.

tatt: Support file-only jobs via Nattka

Signed-off-by: Sam James  gentoo.org>

 scripts/tatt   |  8 
 tatt/dot-tatt-spec |  2 +-
 tatt/tool.py   | 20 
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/scripts/tatt b/scripts/tatt
index 9936006..27e9b61 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -19,6 +19,7 @@ from tatt.scriptwriter import writecommitscript as writeCommit
 from tatt.scriptwriter import writeCleanUpScript as writeCleanup
 from tatt.tattConfig import tattConfig as tattConfig
 from tatt.job import job as job
+from tatt.tool import get_repo_dir
 
 # Generate a global config obj, reading from ~/.tatt #
 config = tattConfig()
@@ -142,7 +143,6 @@ if options.infile:
 myJob.type="stable"
 
 myJob.packageList = packageFinder.findPackages(packraw, targetarch)
-
 ## -b and a bugnumber was given ?
 if options.bugnum:
 print("Bugnumber:  " + options.bugnum)
@@ -166,9 +166,9 @@ if options.bugnum:
 sys.exit(1)
 if myJob.packageList==None:
 if response["cf_stabilisation_atoms"]:
-myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], 
config['repodir'], options.bugnum)
+myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], config['arch'], 
get_repo_dir(config['repodir']), options.bugnum)
 if len(myJob.packageList) == 0 and ("KEYWORDREQ" in 
response["keywords"] or response["component"] == "Keywording"):
-myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + 
config['arch'], config['repodir'], options.bugnum)
+myJob.packageList = 
packageFinder.findPackages(response["cf_stabilisation_atoms"], '~' + 
config['arch'], get_repo_dir(config['repodir']), options.bugnum)
 else:
 response = session.get(config["bugzilla-url"] + 
"/rest/bug/{}/attachment".format(options.bugnum), 
params=params).json()["bugs"][str(options.bugnum)]
 for attachment in response:
@@ -176,7 +176,7 @@ if options.bugnum:
 continue
 for flag in attachment['flags']:
 if flag["name"] == "stabilization-list" and flag["status"] 
== '+':
-myJob.packageList = 
packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), 
config['arch'], config['repodir'],  options.bugnum)
+myJob.packageList = 
packageFinder.findPackages(base64.b64decode(attachment["data"]).decode("utf8"), 
config['arch'], get_repo_dir(config['repodir']), options.bugnum)
 
 
 # joint code for -f and -b

diff --git a/tatt/dot-tatt-spec b/tatt/dot-tatt-spec
index 1d9fe9d..33aff95 100644
--- a/tatt/dot-tatt-spec
+++ b/tatt/dot-tatt-spec
@@ -7,7 +7,7 @@ defaultopts=string(default="")
 emergeopts=string(default="")
 rdeps=integer(0,512,default=10)
 usecombis=integer(0,512,default=12)
-repodir=string(default="./gentoo-x86")
+repodir=string(default="")
 
tinderbox-url=string(default="https://qa-reports.gentoo.org/output/genrdeps/rindex/;)
 safedir=string(default="")
 bugzilla-url=string(default="https://bugs.gentoo.org;)

diff --git a/tatt/tool.py b/tatt/tool.py
index 450ed6a..1322315 100644
--- a/tatt/tool.py
+++ b/tatt/tool.py
@@ -1,3 +1,5 @@
+import os
+
 """ Helper functions used in tatt"""
 
 ## Getting unique elements of a list ##
@@ -17,3 +19,21 @@ def unique(seq, idfun=None):
 seen[marker] = 1
 result.append(item)
 return result
+
+def get_repo_dir(repodir):
+# Prefer the repo dir in the config
+if repodir:
+if os.path.isdir(repodir):
+return repodir
+else:
+raise ValueError("Repo dir does not seem to be a directory")
+
+# No path given in config
+if os.path.isdir("/var/db/repos/gentoo/"):
+print("Using /var/db/repos/gentoo/ as fallback")
+return "/var/db/repos/gentoo"
+elif os.path.isdir("/usr/portage/"):
+print("Using /usr/portage/ as fallback")
+return "/usr/portage/"
+
+raise ValueError("Repo dir not given and fallbacks failed")



[gentoo-commits] proj/tatt:master commit in: /

2020-05-02 Thread Rolf Eike Beer
commit: ef69120341c04fddd6bb8335fabe3c12e7392af5
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Sat May  2 09:57:33 2020 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Sat May  2 09:57:33 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=ef691203

man: fix example config file layout

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 tatt.5 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tatt.5 b/tatt.5
index 3a84ec0..59e0273 100644
--- a/tatt.5
+++ b/tatt.5
@@ -16,7 +16,7 @@ which usually resides \fI 
/usr/lib/${python}/site-packages/tatt \fI
 #successmessage='Archtested on @@ARCH@@: Everything fine'
 
 .br
-#ignoreprefix contains a list of use flag prefixes to be ignored 
+# ignoreprefix contains a list of use flag prefixes to be ignored
 .br
 
#ignoreprefix="elibc_","video_cards_","linguas_","kdeenablefinal","test","debug"
 
@@ -49,8 +49,7 @@ which usually resides \fI 
/usr/lib/${python}/site-packages/tatt \fI
 
 .br
 # Location of a checked out CVS Gentoo tree for repoman checks and 
-.br
-commit scripts.
+# commit scripts.
 .br
 #repodir="./gentoo-x86"
 



[gentoo-commits] proj/tatt:master commit in: tatt/, /, scripts/, templates/

2020-05-02 Thread Rolf Eike Beer
commit: a5f83728d12e841c67e9e264baa4d71d26aba0d4
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Sat May  2 10:32:37 2020 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Sat May  2 10:48:43 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=a5f83728

remove unmaskfile config option, use unmaskdir instead

Write one unmask file per job, so cleanup can simply be rm.

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 README.md|  5 +++--
 scripts/tatt | 30 ++
 tatt.5   |  5 +++--
 tatt/dot-tatt-spec   |  2 +-
 tatt/scriptwriter.py |  4 ++--
 templates/cleanup|  2 +-
 6 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index 6e6799a..46b7f7d 100644
--- a/README.md
+++ b/README.md
@@ -100,8 +100,9 @@ The specification of the configuration file can be found in 
dot-tatt-spec which
 # to change this)
 # template-dir="/usr/share/tatt/templates/"
 
-# Where do you want tatt to put unmasked packages.
-# unmaskfile="/etc/portage/package.accept_keywords/archtest"
+# Where do you want tatt to put unmasked packages. Writes one file per
+# job in this directory.
+# unmaskdir="/etc/portage/package.accept_keywords"
 
 # You can customize the maximal number of rdeps to be tested as follows:
 # rdeps=3

diff --git a/scripts/tatt b/scripts/tatt
index 3e0d56c..b08adfd 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -239,30 +239,36 @@ if myJob.packageList is not None and 
len(myJob.packageList) > 0:
 myJob.packageList = filteredPackages
 
 # Unmasking:
+unmaskname=config['unmaskdir']
+if os.path.exists(unmaskname) and not os.path.isdir(unmaskname):
+print ("unmaskdir '", unmaskname, "' exists and is no directory")
+sys.exit(1)
+elif not os.path.exists(unmaskname):
+os.mkdir(unmaskname, 0o755)
+unmaskname=unmaskname+"/tatt_"+myJob.name
+
 try:
-unmaskfile=open(config['unmaskfile'], 'r+')
+unmaskfile=open(unmaskname, 'r+')
 except IOError:
-print ("Your unmaskfile was not found, I will create it as")
-print (config['unmaskfile'])
 try:
-unmaskfile=open(config['unmaskfile'], 'w')
+unmaskfile=open(unmaskname, 'w')
 unmaskfile.write(" ")
 unmaskfile.close()
 except IOError:
 # If we can't write to the file, then it should be configured 
differently
-print (" ".join(["Can not write to ",config['unmaskfile']]))
+print (" ".join(["Can not write to ",unmaskname]))
 print ("Maybe you don't have permission or the location is 
invalid.")
-print (" ".join(["Is",os.path.split(config['unmaskfile'])[0],"a 
writeable directory?"]))
+print (" ".join(["Is",config['unmaskdir'],"a writeable 
directory?"]))
 print ("Probably you want to configure a different unmaskfile")
 print ("in your ~/.tatt.  Exiting")
 sys.exit(1)
-unmaskfile=open(config['unmaskfile'], 'r+')
+unmaskfile=open(unmaskname, 'r+')
 
 unmaskfileContent = unmaskfile.read()
 for p in myJob.packageList:
 # Test if unmaskfile already contains the atom
 if re.search(re.escape(p.packageString()), unmaskfileContent):
-print (p.packageString() + " already in "+config['unmaskfile'])
+print (p.packageString() + " already in "+unmaskname)
 else:
 unmaskfile.write(p.packageString())
 if myJob.type=="stable":
@@ -272,22 +278,22 @@ if myJob.packageList is not None and 
len(myJob.packageList) > 0:
 else:
 print ("Uh Oh, no job.type? Tell to...@gentoo.org to fix 
this!")
 unmaskfile.write("  # Job " + myJob.name + "\n")
-print ("Unmasked " + p.packageString()+ " in 
"+config['unmaskfile'])
+print ("Unmasked " + p.packageString()+ " in "+unmaskname)
 
 # now write the remaining packages for keywording
 for p in kwPackages:
 # Test if unmaskfile already contains the atom
 if re.search(re.escape(p.packageString()), unmaskfileContent):
-print (p.packageString() + " already in "+config['unmaskfile'])
+print (p.packageString() + " already in "+unmaskname)
 else:
 unmaskfile.write(p.packageString() + "  # Job " + myJob.name + 
"\n")
-print ("Unmasked " + p.packageString() + " in " + 
config['unmaskfile'])
+print ("Unmasked " + p.packageString() + " in " + unmaskname)
 
 unmaskfile.close()
 ## Write the scripts
 writeUSE(myJob, config)
 writeRdeps(myJob, config)
-writeCleanup (myJob, config)
+writeCleanup (myJob, config, unmaskname)
 ## Successscript can only be written if we have a bugnumber
 if myJob.bugnumber:
 writeSuccess(myJob, config)

diff --git a/tatt.5 b/tatt.5
index 59e0273..c40d34c 100644
--- a/tatt.5
+++ b/tatt.5
@@ 

[gentoo-commits] proj/tatt:master commit in: /, tatt/

2020-03-03 Thread Michael Palimaka
commit: a32cac46187088b46e0a7095aff504a62cbb871b
Author: Michael Palimaka  gentoo  org>
AuthorDate: Tue Mar  3 10:02:40 2020 +
Commit: Michael Palimaka  gentoo  org>
CommitDate: Tue Mar  3 10:03:09 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=a32cac46

Migrate from package.keywords to package.accept_keywords

Bug: https://bugs.gentoo.org/711204
Signed-off-by: Michael Palimaka  gentoo.org>

 README.md  | 2 +-
 tatt.5 | 2 +-
 tatt/dot-tatt-spec | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index aea16d3..6e6799a 100644
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@ The specification of the configuration file can be found in 
dot-tatt-spec which
 # template-dir="/usr/share/tatt/templates/"
 
 # Where do you want tatt to put unmasked packages.
-# unmaskfile="/etc/portage/package.keywords/archtest"
+# unmaskfile="/etc/portage/package.accept_keywords/archtest"
 
 # You can customize the maximal number of rdeps to be tested as follows:
 # rdeps=3

diff --git a/tatt.5 b/tatt.5
index 909f871..3a84ec0 100644
--- a/tatt.5
+++ b/tatt.5
@@ -33,7 +33,7 @@ which usually resides \fI 
/usr/lib/${python}/site-packages/tatt \fI
 .br
 # Where do you want tatt to put unmasked packages.
 .br
-#unmaskfile="/etc/portage/package.keywords/archtest"
+#unmaskfile="/etc/portage/package.accept_keywords/archtest"
 
 .br
 # You can customize the maximal number of rdeps to be tested as follows:

diff --git a/tatt/dot-tatt-spec b/tatt/dot-tatt-spec
index e7feb8c..76a7039 100644
--- a/tatt/dot-tatt-spec
+++ b/tatt/dot-tatt-spec
@@ -1,7 +1,7 @@
 successmessage=string(default="Archtested on @@ARCH@@: Everything fine")
 
ignoreprefix=string_list(default=list("elibc_","video_cards_","linguas_","python_targets_","python_single_target_","kdeenablefinal","test","debug"))
 template-dir=string(default="/usr/share/tatt/templates/")
-unmaskfile=string(default="/etc/portage/package.keywords/archtest")
+unmaskfile=string(default="/etc/portage/package.accept_keywords/archtest")
 arch=string(default="x86")
 defaultopts=string(default="")
 emergeopts=string(default="")



[gentoo-commits] proj/tatt:master commit in: tatt/

2020-02-04 Thread Rolf Eike Beer
commit: 25700e2a7bc4df107b42bd1ab78b0599178b5941
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Tue Feb  4 15:48:28 2020 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Tue Feb  4 15:48:28 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=25700e2a

also match ~arch in package list

This isn't uncommon for keywording bugs. It is also accepted for stabilization
bugs at the moment because it simplifies the code.

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 tatt/packageFinder.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index 5a8a099..a404d39 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -13,7 +13,8 @@ def findPackages (s, arch):
 if not line:
 continue
 atom, _, arches = line.replace('\t', ' ').partition(' ')
-if not arches or arch in arches.split(' '):
+archlist = arches.split(' ')
+if not arches or arch in archlist or ('~' + arch) in archlist:
 packages.append(gP(atom))
 
 return(packages)



[gentoo-commits] proj/tatt:master commit in: templates/

2020-01-02 Thread Rolf Eike Beer
commit: a6f188af2dd06082b26db38d9eeffa7cd6aba38b
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Thu Jan  2 20:59:10 2020 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Thu Jan  2 21:00:24 2020 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=a6f188af

collect more test logs

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 templates/tatt_functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index d2b5bc8..57d3d65 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -34,7 +34,7 @@ function tatt_pkg_error
 LOGNAME=$(mktemp -p "${TATT_BUILDLOGDIR}" 
"${CP/\//_}_${TATT_TEST_TYPE}_X")
 mv "${BUILDLOG}" "${LOGNAME}"
 echo "log has been saved as ${LOGNAME}" >> "${TATT_REPORTFILE}"
-TESTLOGS=($(find ${BUILDDIR}/work -name test-suite.log -o -name 
testsuite.log -o -name LastTest.log))
+TESTLOGS=($(find ${BUILDDIR}/work -iname '*test*log*'))
 if [ ${#TESTLOGS[@]} -gt 0 ]; then
   tar cf ${LOGNAME}.tar ${TESTLOGS[@]}
   echo "testsuite logs have been saved as ${LOGNAME}.tar" >> 
"${TATT_REPORTFILE}"



[gentoo-commits] proj/tatt:master commit in: tatt/, templates/

2019-12-20 Thread Rolf Eike Beer
commit: 41442dc25c6fe59858376c9c6964215341237bc4
Author: Rolf Eike Beer  sf-mail  de>
AuthorDate: Fri Dec 20 14:30:10 2019 +
Commit: Rolf Eike Beer  sf-mail  de>
CommitDate: Fri Dec 20 19:56:45 2019 +
URL:https://gitweb.gentoo.org/proj/tatt.git/commit/?id=41442dc2

add a return code to the use test script

Signed-off-by: Rolf Eike Beer  sf-mail.de>

 tatt/scriptwriter.py| 3 +++
 templates/tatt_functions.sh | 1 +
 templates/use-footer| 2 ++
 templates/use-header| 2 ++
 templates/use-snippet   | 2 +-
 templates/use-test-snippet  | 2 +-
 6 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py
index fa26608..b4bee69 100644
--- a/tatt/scriptwriter.py
+++ b/tatt/scriptwriter.py
@@ -84,6 +84,9 @@ def writeusecombiscript(job, config):
 loop = useloop.replace("@@LOOP_BODY@@", useCombiTestString(job, p, 
config, port))
 loop = loop.replace("@@CPV@@", p.packageString())
 outfile.write(loop)
+if os.path.exists(config['template-dir'] + "use-footer"):
+footer = scriptTemplate(job, config, "use-footer")
+outfile.write(footer)
 # Note: fchmod needs the filedescriptor which is an internal
 # integer retrieved by fileno().
 os.fchmod(outfile.fileno(), 0o744)  # rwxr--r--

diff --git a/templates/tatt_functions.sh b/templates/tatt_functions.sh
index 92db9ba..d2b5bc8 100644
--- a/templates/tatt_functions.sh
+++ b/templates/tatt_functions.sh
@@ -63,5 +63,6 @@ function tatt_test_pkg
 echo "USE='${USE}' succeeded for ${1:?}" >> "${TATT_REPORTFILE}"
   else
 FEATURES="${TFEATURES}" tatt_pkg_error "${1:?}" "${eout}"
+return 1
   fi
 }

diff --git a/templates/use-footer b/templates/use-footer
new file mode 100644
index 000..90349dc
--- /dev/null
+++ b/templates/use-footer
@@ -0,0 +1,2 @@
+
+exit ${test_ret}

diff --git a/templates/use-header b/templates/use-header
index d18e080..9ae0cdb 100644
--- a/templates/use-header
+++ b/templates/use-header
@@ -11,3 +11,5 @@ export TATT_EMERGEOPTS="@@EMERGEOPTS@@"
 source "@@TEMPLATEDIR@@tatt_functions.sh"
 
 echo -e "USE tests started on $(date)\n" >> @@REPORTFILE@@
+
+test_ret=0

diff --git a/templates/use-snippet b/templates/use-snippet
index 50427ba..7404452 100644
--- a/templates/use-snippet
+++ b/templates/use-snippet
@@ -1 +1 @@
-@@USE@@ tatt_test_pkg "@@CPV@@"
+@@USE@@ tatt_test_pkg "@@CPV@@" || test_ret=1

diff --git a/templates/use-test-snippet b/templates/use-test-snippet
index ca99034..7a5a8a9 100644
--- a/templates/use-test-snippet
+++ b/templates/use-test-snippet
@@ -1 +1 @@
-@@USE@@ tatt_test_pkg --test "@@CPV@@"
+@@USE@@ tatt_test_pkg --test "@@CPV@@" || test_ret=1