diff --git a/conf/packages/packages.server.qa.exec.example b/conf/packages/packages.server.qa.exec.example old mode 100644 new mode 100755 index 21079976f..ffb487f33 --- a/conf/packages/packages.server.qa.exec.example +++ b/conf/packages/packages.server.qa.exec.example @@ -7,8 +7,9 @@ # # It is used by Entropy Server QA routines to perform package metadata # validation. -# Metadata is export in environmental variables form, and include: +# Metadata is exported as environmental variables and stdin. # +# Metadata from environment: # REPOSITORY_ID = repository identifier # PKG_ID = package identifier # PKG_ATOM = package atom @@ -32,13 +33,17 @@ # PKG_SIZE = package size, in bytes # PKG_REVISION = package entropy revision # PKG_DEPS = list (\n separated) of package dependencies and conflicts -# PKG_NEEDED_LIBS = list (\n separated) of SONAMES required by package, -# including ELF class, so each item will look like this: -# | -# PKG_PROVIDED_LIBS = list (\n separated) of SONAMES provided by package, -# note: elf class and path are also provided, -# so each item will look like this: -# || + +# Metadata on stdin (more can be added in the future, so it's advisable +# to ignore entries well formed but with unknown prefix): +# PKG_NEEDED_LIB: +# SONAME required by package (one per line), including ELF class, +# so each line will look like this: +# PKG_NEEDED_LIB|| +# PKG_PROVIDED_LIB: +# SONAME provided by package (one per line), note: elf class +# and path are also provided, so each line will look like this: +# PKG_PROVIDED_LIB||| # # The executable must return 0 for success, 1 for warning, 2 for critical error @@ -67,8 +72,12 @@ echo "PKG_DATE = ${PKG_DATE}" echo "PKG_SIZE = ${PKG_SIZE}" echo "PKG_REVISION = ${PKG_REVISION}" echo "PKG_DEPS = ${PKG_DEPS}" -echo "PKG_NEEDED_LIBS = ${PKG_NEEDED_LIBS}" -echo "PKG_PROVIDED_LIBS = ${PKG_PROVIDED_LIBS}" + +stdin=$(cat) +echo "PKG_NEEDED_LIB = " +echo "${stdin}" | sed -n 's/^PKG_NEEDED_LIB|//p' +echo "PKG_PROVIDED_LIB = " +echo "${stdin}" | sed -n 's/^PKG_PROVIDED_LIB|//p' echo -exit 0 \ No newline at end of file +exit 0 diff --git a/lib/entropy/server/interfaces/main.py b/lib/entropy/server/interfaces/main.py index 8f43069a3..28fb49807 100644 --- a/lib/entropy/server/interfaces/main.py +++ b/lib/entropy/server/interfaces/main.py @@ -6664,18 +6664,22 @@ class Server(Client): env['PKG_SIZE'] = str(pkg_size) env['PKG_REVISION'] = str(pkg_rev) env['PKG_DEPS'] = str("\n".join(pkg_deps)) - env['PKG_NEEDED_LIBS'] = str("\n".join( - ["%s|%s|%s|%s|%s" % (a, b, x, y, c) for a, b, x, y, c in - pkg_needed])) - env['PKG_PROVIDED_LIBS'] = str("\n".join( - ["%s|%s|%s" % (x, y, z) for x, y, z in \ - pkg_provided_libs])) + + # These two are not exposed in environment because they can be large; + # avoid "Argument list too long." + stdin_lines = [] + stdin_lines += ["PKG_NEEDED_LIB|%s|%s|%s|%s|%s" % (a, b, x, y, c) \ + for a, b, x, y, c in pkg_needed] + stdin_lines += ["PKG_PROVIDED_LIB|%s|%s|%s" % (x, y, z) \ + for x, y, z in pkg_provided_libs] + stdin = const_convert_to_rawstring("\n".join(stdin_lines)) # now call the script try: proc = subprocess.Popen( [qa_exec], stdout = sys.stdout, stderr = sys.stderr, - stdin = sys.stdin, env = env) + stdin = subprocess.PIPE, env = env) + proc.communicate(input=stdin) rc = proc.wait() except OSError as err: self.output(