From cf0f0d3aeb1118d9da1b3735b2d937f9fa64e54e Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 4 Jul 2024 13:38:46 +0200 Subject: [PATCH 1/3] gitlab ci: no failure --- .gitlab-ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c49f8f0c..7d0b193f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,7 +71,6 @@ variables: stable-24.04-build: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true only: - stable <<: *build_definition @@ -83,7 +82,6 @@ stable-22.04-build: <<: *build_definition stable-20.04-build: - allow_failure: true image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:20.04 only: - stable @@ -91,7 +89,6 @@ stable-20.04-build: devel-24.04-build: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true only: - devel <<: *build_definition @@ -104,14 +101,12 @@ devel-22.04-build: devel-20.04-build: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:20.04 - allow_failure: true only: - devel <<: *build_definition stable-24.04-test: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true dependencies: - stable-24.04-build only: @@ -128,7 +123,6 @@ stable-22.04-test: stable-20.04-test: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:20.04 - allow_failure: true dependencies: - stable-20.04-build only: @@ -137,7 +131,6 @@ stable-20.04-test: devel-24.04-test: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true dependencies: - devel-24.04-build only: @@ -154,7 +147,6 @@ devel-22.04-test: devel-20.04-test: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:20.04 - allow_failure: true dependencies: - devel-20.04-build only: @@ -163,7 +155,6 @@ devel-20.04-test: stable-24.04-doc: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true dependencies: - stable-24.04-build only: @@ -172,7 +163,6 @@ stable-24.04-doc: stable-22.04-doc: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:22.04 - allow_failure: true dependencies: - stable-22.04-build only: @@ -189,7 +179,6 @@ stable-20.04-doc: devel-24.04-doc: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:24.04 - allow_failure: true dependencies: - devel-24.04-build only: @@ -198,7 +187,6 @@ devel-24.04-doc: devel-22.04-doc: image: gitlab.laas.fr:4567/humanoid-path-planner/hpp-doc:22.04 - allow_failure: true dependencies: - devel-22.04-build only: From 70c929a61dad2db4dee6438ffb1149c6c2045d8b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 23 Jul 2024 16:26:09 +0200 Subject: [PATCH 2/3] packageDep: clean --- scripts/packageDep | 72 ++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/scripts/packageDep b/scripts/packageDep index 89e135af..973cae54 100755 --- a/scripts/packageDep +++ b/scripts/packageDep @@ -1,26 +1,28 @@ #!/usr/bin/python -from __future__ import print_function, with_statement - -from optparse import OptionParser +import os import re -import sys, os - -try: # python2 - from commands import getstatusoutput -except: # python3 - from subprocess import getstatusoutput +import sys +from optparse import OptionParser +from subprocess import getstatusoutput pkgConfigPath = os.environ.get("PKG_CONFIG_PATH") -pathList = re.split(':', pkgConfigPath) +pathList = re.split(":", pkgConfigPath) usage = "usage: %prog [options] package-1 ... package-n" parser = OptionParser(version="packageDep 0.1", usage=usage) -parser.add_option("-o", "--output", dest="filename", - help="write graph to FILE", metavar="FILE") -parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False, - help="Do not print messages to stdout") +parser.add_option( + "-o", "--output", dest="filename", help="write graph to FILE", metavar="FILE" +) +parser.add_option( + "-q", + "--quiet", + action="store_true", + dest="quiet", + default=False, + help="Do not print messages to stdout", +) (options, args) = parser.parse_args() @@ -28,17 +30,18 @@ if options.filename is None: parser.print_help() if options.quiet: - sys.stdout = open(os.devnull, 'w') + sys.stdout = open(os.devnull, "w") packageList = args filename = options.filename -requireExpr = re.compile('(\s*Requires:\s+)(.+)') -pkgStdName = re.compile('\w+[\w\d\._-]*'); +requireExpr = re.compile("(\s*Requires:\s+)(.+)") +pkgStdName = re.compile("\w+[\w\d\._-]*") packageSet = set() dependencySet = set() + def extractDep(inPkg): packageSet.add(inPkg) @@ -47,23 +50,22 @@ def extractDep(inPkg): """Loop over directories in PKG_CONFIG_PATH """ for path in pathList: - found = False - filePc = path+"/"+inPkg+".pc" + filePc = path + "/" + inPkg + ".pc" try: with open(filePc) as f: for line in f: matchLine = requireExpr.match(line) if matchLine: - requireList = re.split(':', matchLine.group(0)) + requireList = re.split(":", matchLine.group(0)) depLine = requireList[1] - depFullList = re.split(',', depLine) + depFullList = re.split(",", depLine) for depFull in depFullList: dep = pkgStdName.search(depFull) if dep: depName = dep.group(0) depSet.add(depName) - depString = "\"" + depName + "\" -> \"" + inPkg + "\"" + depString = '"' + depName + '" -> "' + inPkg + '"' dependencySet.add(depString) except IOError: @@ -76,22 +78,22 @@ def extractDep(inPkg): def getDocLink(package): cmd = "pkg-config --variable=doxygendocdir " + package - status,output = getstatusoutput(cmd) + status, output = getstatusoutput(cmd) if status != 0: - return '' + return "" - if output != '': + if output != "": return output cmd = "pkg-config --variable=docdir " + package - status,output = getstatusoutput(cmd) + status, output = getstatusoutput(cmd) if status != 0: - return '' + return "" - if output != '': - return output + '/html' + if output != "": + return output + "/html" return output @@ -103,24 +105,24 @@ for pkg in packageList: # try: - f = open(filename, 'w') + f = open(filename, "w") except IOError: print("cannot open ", filename) f.write("digraph CD {\n") -f.write("\tsize = \"12,15\"\n") +f.write('\tsize = "12,15"\n') f.write("\trankdir = BT\n") f.write("\tcompound=true\n") f.write("\n") for package in packageSet: docLink = getDocLink(package) - if docLink != '': - docLink = docLink + '/index.html' - f.write("\t\"" + package + "\" [shape = box, href = \"" + docLink + "\"]\n") + if docLink != "": + docLink = docLink + "/index.html" + f.write('\t"' + package + '" [shape = box, href = "' + docLink + '"]\n') for dependency in dependencySet: - f.write("\t" + dependency + "\n"); + f.write("\t" + dependency + "\n") f.write("}\n") From fbb5e83e90721a22a7466c7bd6cacb6e4a147b8f Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 23 Jul 2024 16:20:20 +0200 Subject: [PATCH 3/3] portability: use interpreters from /usr/bin/env --- default.nix | 9 +-------- scripts/auto-install-hpp.sh | 2 +- scripts/create-tags.sh | 2 +- scripts/generate-tar-doc | 2 +- scripts/install-tar-on-remote | 2 +- scripts/packageDep | 2 +- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/default.nix b/default.nix index 530794ea..832f117a 100644 --- a/default.nix +++ b/default.nix @@ -25,16 +25,9 @@ stdenv.mkDerivation { }; prePatch = '' - substituteInPlace scripts/auto-install-hpp.sh \ - --replace-fail /bin/bash ${stdenv.shell} - substituteInPlace scripts/install-tar-on-remote \ - --replace-fail /bin/bash ${stdenv.shell} - substituteInPlace scripts/generate-tar-doc \ - --replace-fail /bin/sh ${stdenv.shell} substituteInPlace scripts/packageDep \ - --replace-fail /usr/bin/python ${python3Packages.python.interpreter} + --replace-fail "/usr/bin/env python3" ${python3Packages.python.interpreter} ''; - strictDeps = true; nativeBuildInputs = [ diff --git a/scripts/auto-install-hpp.sh b/scripts/auto-install-hpp.sh index d24229ed..2b7db5d4 100755 --- a/scripts/auto-install-hpp.sh +++ b/scripts/auto-install-hpp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Exit on error set -e diff --git a/scripts/create-tags.sh b/scripts/create-tags.sh index 01e2299f..4e287db8 100755 --- a/scripts/create-tags.sh +++ b/scripts/create-tags.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/scripts/generate-tar-doc b/scripts/generate-tar-doc index 134d7f8b..8280f584 100755 --- a/scripts/generate-tar-doc +++ b/scripts/generate-tar-doc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # generate-tar-doc $DEVEL_HPP_DIR/install/share/doc http://gepettoweb.laas.fr/hpp # then copy /tmp/hpp.tar.gz on server and inflate archive. diff --git a/scripts/install-tar-on-remote b/scripts/install-tar-on-remote index 52d7b970..72e15bb8 100755 --- a/scripts/install-tar-on-remote +++ b/scripts/install-tar-on-remote @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash VERSION="v4.6.0" HOST=gepettoweb.laas.fr diff --git a/scripts/packageDep b/scripts/packageDep index 973cae54..488190cd 100755 --- a/scripts/packageDep +++ b/scripts/packageDep @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import os import re