Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package klee-uclibc for openSUSE:Factory 
checked in at 2022-05-12 22:59:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/klee-uclibc (Old)
 and      /work/SRC/openSUSE:Factory/.klee-uclibc.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "klee-uclibc"

Thu May 12 22:59:12 2022 rev:19 rq:976207 version:1.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/klee-uclibc/klee-uclibc.changes  2021-10-26 
20:14:43.994042753 +0200
+++ /work/SRC/openSUSE:Factory/.klee-uclibc.new.1538/klee-uclibc.changes        
2022-05-12 22:59:41.096742392 +0200
@@ -1,0 +2,12 @@
+Tue May 10 10:24:26 UTC 2022 - Jiri Slaby <jsl...@suse.cz>
+
+- update to 1.3
+  * configure: remove old code, make llvm-config lookup more flexible,
+    set to Python3, remove trailing whitespace
+  * switch to https; fallback to curl when wget not available
+  * Correcting use of 'lookForNew'
+  * Add a message when the bitcode compiler is specified via CC
+- add extra-locale-Makefile-don-t-always-require-curl-wget.patch to
+  fix build
+
+-------------------------------------------------------------------

Old:
----
  klee_uclibc_v1.2.tar.gz

New:
----
  extra-locale-Makefile-don-t-always-require-curl-wget.patch
  klee_uclibc_v1.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ klee-uclibc.spec ++++++
--- /var/tmp/diff_new_pack.Qiu8yk/_old  2022-05-12 22:59:41.804743343 +0200
+++ /var/tmp/diff_new_pack.Qiu8yk/_new  2022-05-12 22:59:41.808743348 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package klee-uclibc
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -22,12 +22,13 @@
 Summary:        Libc library for Klee
 License:        LGPL-2.1-or-later
 Group:          Development/Languages/Other
-Version:        1.2
+Version:        1.3
 Release:        0
 URL:            https://github.com/klee/klee-uclibc
 Source0:        
https://github.com/klee/klee-uclibc/archive/klee_uclibc_v%{version}.tar.gz
 Source1:        %{name}-rpmlintrc
 Source2:        uClibc-locale-030818.tgz
+Patch0:         extra-locale-Makefile-don-t-always-require-curl-wget.patch
 Patch1:         proper-compiler-flags-check.patch
 BuildRequires:  clang%{llvm_version}
 BuildRequires:  llvm%{llvm_version}-devel
@@ -55,8 +56,7 @@
 development symbolically.
 
 %prep
-%setup -q -n %{name}-klee_uclibc_v%{version}
-%patch1 -p1
+%autosetup -p1 -n %{name}-klee_uclibc_v%{version}
 cp %{SOURCE2} extra/locale/
 sed -i 's@UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y@@' 
klee-premade-configs/x86_64/config
 

++++++ _service ++++++
--- /var/tmp/diff_new_pack.Qiu8yk/_old  2022-05-12 22:59:41.844743397 +0200
+++ /var/tmp/diff_new_pack.Qiu8yk/_new  2022-05-12 22:59:41.848743402 +0200
@@ -1,6 +1,6 @@
 <services>
   <service name="tar_scm" mode="disabled">
-    <param name="url">git://github.com/klee/klee-uclibc.git</param>
+    <param name="url">https://github.com/klee/klee-uclibc</param>
     <param name="scm">git</param>
     <param name="changesgenerate">enable</param>
     <param name="revision">klee_0_9_29</param>

++++++ extra-locale-Makefile-don-t-always-require-curl-wget.patch ++++++
From: Jiri Slaby <jsl...@suse.cz>
Date: Tue, 10 May 2022 12:29:29 +0200
Subject: extra/locale/Makefile: don't always require curl/wget
Patch-mainline: no
References: build fix

Especially when UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is unset.

Signed-off-by: Jiri Slaby <jsl...@suse.cz>
---
 extra/locale/Makefile.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in
index 430c8065..947bdf62 100644
--- a/extra/locale/Makefile.in
+++ b/extra/locale/Makefile.in
@@ -6,6 +6,7 @@
 #
 
 # command used to download source code
+ifeq ($(UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA),y)
 GET  :=
 WGET := $(shell command -v wget 2> /dev/null)
 CURL := $(shell command -v curl 2> /dev/null)
@@ -19,6 +20,7 @@ else
 $(error "curl/wget not found")
 endif
 endif
+endif
 
 
 LOCALE_DATA_FILENAME := uClibc-locale-030818.tgz
-- 
2.34.1


++++++ klee_uclibc_v1.2.tar.gz -> klee_uclibc_v1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/klee-uclibc-klee_uclibc_v1.2/.github/workflows/build.yaml 
new/klee-uclibc-klee_uclibc_v1.3/.github/workflows/build.yaml
--- old/klee-uclibc-klee_uclibc_v1.2/.github/workflows/build.yaml       
1970-01-01 01:00:00.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.github/workflows/build.yaml       
2022-03-31 15:10:56.000000000 +0200
@@ -0,0 +1,60 @@
+name: CI
+
+on: [pull_request, push]
+
+# Defaults for building KLEE
+env:
+  COVERAGE: 0
+  DISABLE_ASSERTIONS: 1
+  ENABLE_DOXYGEN: 0
+  ENABLE_OPTIMIZED: 1
+  ENABLE_DEBUG: 0
+  GTEST_VERSION: 1.11.0
+  KLEE_RUNTIME_BUILD: "Debug+Asserts"
+  LLVM_VERSION: 11
+  MINISAT_VERSION: "master"
+  REQUIRES_RTTI: 1
+  SANITIZER_BUILD:
+  SOLVERS: STP
+  STP_VERSION: 2.3.3
+  USE_TCMALLOC: 0
+  USE_LIBCXX: 0
+  Z3_VERSION: 4.8.14
+  BASE: /home/runner/work/klee-uclibc/klee-uclibc/
+
+jobs:
+  Linux:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        name: [
+                "Latest klee-uclibc",
+            ]
+        include:
+          # Check we can build latest klee-uclibc branch
+          - name: "Latest klee-uclibc"
+            env:
+              UCLIBC_VERSION: ""
+    steps:
+      - name: Checkout KLEE UClibc source code
+        uses: actions/checkout@v2
+        with:
+          path: klee-uclibc-90
+
+      - name: Checkout KLEE source code
+        uses: actions/checkout@v2
+        with:
+          repository: klee/klee
+          path: klee
+
+      - name: Build UClibc
+        env: ${{ matrix.env }}
+        run: $GITHUB_WORKSPACE/klee/scripts/build/build.sh uclibc 
--install-system-deps --debug
+
+      - name: Build KLEE
+        env: ${{ matrix.env }}
+        run: $GITHUB_WORKSPACE/klee/scripts/build/build.sh klee 
--install-system-deps --debug
+
+      - name: Run tests
+        env: ${{ matrix.env }}
+        run: cd $GITHUB_WORKSPACE/klee_build110stp && make check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/klee-uclibc-klee_uclibc_v1.2/.travis/install-llvm-and-runtime-compiler.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/install-llvm-and-runtime-compiler.sh
--- 
old/klee-uclibc-klee_uclibc_v1.2/.travis/install-llvm-and-runtime-compiler.sh   
    2019-03-14 13:12:33.000000000 +0100
+++ 
new/klee-uclibc-klee_uclibc_v1.3/.travis/install-llvm-and-runtime-compiler.sh   
    1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-#!/bin/bash -x
-set -ev
-
-# Install newer compiler to support C++11
-sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-sudo apt-get -qq update
-sudo apt-get -qq install g++-5
-sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50
-sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
-
-export CC=gcc-5
-export CXX=g++-5
-
-sudo apt-get install -y llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev
-
-if [ "${LLVM_VERSION}" == "3.4" ]; then
-    sudo apt-get install -y llvm-${LLVM_VERSION}-tools clang-${LLVM_VERSION}
-    sudo update-alternatives --install /usr/bin/clang clang 
/usr/bin/clang-${LLVM_VERSION} 20
-    sudo update-alternatives --install /usr/bin/clang++ clang++ 
/usr/bin/clang++-${LLVM_VERSION} 20
-else
-    echo "Unknown LLVM version ${LLVM_VERSION}"
-    exit 1
-fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/.travis/klee.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/klee.sh
--- old/klee-uclibc-klee_uclibc_v1.2/.travis/klee.sh    2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis/klee.sh    1970-01-01 
01:00:00.000000000 +0100
@@ -1,88 +0,0 @@
-#!/bin/bash -x
-# Make sure we exit if there is a failure
-set -e
-: ${SOLVERS?"Solvers must be specified"}
-
-source ${SRC_DIR}/.travis/llvm_compiler.sh
-
-###############################################################################
-# Clone KLEE source code
-###############################################################################
-git clone https://github.com/klee/klee.git ${SRC_DIR}/klee
-
-###############################################################################
-# Testing utils for KLEE
-###############################################################################
-source ${SRC_DIR}/.travis/testing-utils.sh
-
-cd ${BUILD_DIR}
-
-###############################################################################
-# Setting up solvers for KLEE
-###############################################################################
-source ${SRC_DIR}/.travis/solvers.sh
-
-KLEE_Z3_CONFIGURE_OPTION=""
-SOLVER_LIST=$(echo "${SOLVERS}" | sed 's/:/ /')
-
-# Set CMake configure options
-for solver in ${SOLVER_LIST}; do
-  echo "Setting CMake configuration option for ${solver}"
-  case ${solver} in
-  Z3)
-    echo "Z3"
-    KLEE_Z3_CONFIGURE_OPTION="-DENABLE_SOLVER_Z3=TRUE"
-    ;;
-  *)
-    echo "Unknown solver ${solver}"
-    exit 1
-  esac
-done
-
-###############################################################################
-# Compile KLEE and run tests
-###############################################################################
-mkdir klee-build
-cd klee-build
-
-KLEE_UCLIBC_CONFIGURE_OPTION="-DENABLE_KLEE_UCLIBC=TRUE 
-DKLEE_UCLIBC_PATH=${SRC_DIR} -DENABLE_POSIX_RUNTIME=TRUE"
-
-GTEST_SRC_DIR="${BUILD_DIR}/test-utils/googletest-release-1.7.0/"
-if [ "X${DISABLE_ASSERTIONS}" == "X1" ]; then
-  KLEE_ASSERTS_OPTION="-DENABLE_KLEE_ASSERTS=FALSE"
-else
-  KLEE_ASSERTS_OPTION="-DENABLE_KLEE_ASSERTS=TRUE"
-fi
-
-if [ "X${ENABLE_OPTIMIZED}" == "X1" ]; then
-  CMAKE_BUILD_TYPE="RelWithDebInfo"
-else
-  CMAKE_BUILD_TYPE="Debug"
-fi
-
-# Compute CMake build type
-cmake \
-  -DLLVM_CONFIG_BINARY="/usr/lib/llvm-${LLVM_VERSION}/bin/llvm-config" \
-  -DLLVMCC="${KLEE_CC}" \
-  -DLLVMCXX="${KLEE_CXX}" \
-  -DENABLE_TCMALLOC=OFF \
-  ${KLEE_Z3_CONFIGURE_OPTION} \
-  ${KLEE_UCLIBC_CONFIGURE_OPTION} \
-  -DGTEST_SRC_DIR=${GTEST_SRC_DIR} \
-  -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-  ${KLEE_ASSERTS_OPTION} \
-  -DENABLE_UNIT_TESTS=TRUE \
-  -DENABLE_SYSTEM_TESTS=TRUE \
-  -DLIT_ARGS="-v" \
-  ${SRC_DIR}/klee
-make
-
-###############################################################################
-# Unit tests
-###############################################################################
-make unittests
-
-###############################################################################
-# lit tests
-###############################################################################
-make systemtests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/klee-uclibc-klee_uclibc_v1.2/.travis/llvm_compiler.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/llvm_compiler.sh
--- old/klee-uclibc-klee_uclibc_v1.2/.travis/llvm_compiler.sh   2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis/llvm_compiler.sh   1970-01-01 
01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-# This file is meant to be included by shell scripts
-# to compute the correct version of the LLVM compiler to use.
-
-# Calculate LLVM branch name to retrieve missing files from
-SVN_BRANCH="release_$( echo ${LLVM_VERSION} | sed 's/\.//g')"
-
-###############################################################################
-# Select the compiler to use to generate LLVM bitcode
-###############################################################################
-if [ "${LLVM_VERSION}" != "2.9" ]; then
-    KLEE_CC=/usr/bin/clang-${LLVM_VERSION}
-    KLEE_CXX=/usr/bin/clang++-${LLVM_VERSION}
-else
-    echo "Unknown LLVM version ${LLVM_VERSION}"
-    exit 1
-fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/.travis/solvers.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/solvers.sh
--- old/klee-uclibc-klee_uclibc_v1.2/.travis/solvers.sh 2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis/solvers.sh 1970-01-01 
01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-#!/bin/bash -x
-# Make sure we exit if there is a failure
-set -e
-: ${SOLVERS?"Solvers must be specified"}
-
-SOLVER_LIST=$(echo "${SOLVERS}" | sed 's/:/ /')
-
-for solver in ${SOLVER_LIST}; do
-  echo "Getting solver ${solver}"
-  case ${solver} in
-  Z3)
-    echo "Z3"
-    # Should we install libz3-dbg too?
-    sudo apt-get -y install libz3 libz3-dev
-    ;;
-  *)
-    echo "Unknown solver ${solver}"
-    exit 1
-  esac
-done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/klee-uclibc-klee_uclibc_v1.2/.travis/testing-utils.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/testing-utils.sh
--- old/klee-uclibc-klee_uclibc_v1.2/.travis/testing-utils.sh   2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis/testing-utils.sh   1970-01-01 
01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-#!/bin/bash -x
-# Make sure we exit if there is a failure
-set -e
-
-mkdir ${BUILD_DIR}/test-utils/
-cd ${BUILD_DIR}/test-utils/
-
-# The New CMake build system just needs the GTest sources regardless
-# of LLVM version.
-wget https://github.com/google/googletest/archive/release-1.7.0.zip
-unzip release-1.7.0.zip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/.travis/uclibc.sh 
new/klee-uclibc-klee_uclibc_v1.3/.travis/uclibc.sh
--- old/klee-uclibc-klee_uclibc_v1.2/.travis/uclibc.sh  2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis/uclibc.sh  1970-01-01 
01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-#!/bin/bash -x
-# Make sure we exit if there is a failure
-set -e
-
-source ${SRC_DIR}/.travis/llvm_compiler.sh
-
-cd ${SRC_DIR}
-./configure --make-llvm-lib --with-cc "${KLEE_CC}" --with-llvm-config 
/usr/bin/llvm-config-${LLVM_VERSION}
-make
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/.travis.yml 
new/klee-uclibc-klee_uclibc_v1.3/.travis.yml
--- old/klee-uclibc-klee_uclibc_v1.2/.travis.yml        2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/.travis.yml        1970-01-01 
01:00:00.000000000 +0100
@@ -1,72 +0,0 @@
-sudo: required
-dist: trusty
-language: cpp
-compiler:
-    # FIXME: For now, building with Clang is disabled because the STP built 
with
-    # it hits an assertion failure during some tests. We should sort this out
-    # eventually and file the bug against STP or Clang whichever is 
appropriate,
-    # but for now it is easier to just reduce the number of configs we test
-    # anyway.
-    # - clang
-
-    - gcc
-env:
-    ###########################################################################
-    # Configurations
-    #
-    # Each line in the "env" section represents a set of environment variables
-    # passed to a build. Thus each line represents a different build
-    # configuration.
-    ###########################################################################
-
-    # Check a subset of the matrix of:
-    #   LLVM  : {3.4}
-    #   SOLVERS : {Z3}
-    #   DISABLE_ASSERTIONS: {0}
-    #   ENABLE_OPTIMIZED: {1}
-
-    # Check KLEE CMake build
-    - LLVM_VERSION=3.4 SOLVERS=Z3 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-
-addons:
-  apt:
-    sources:
-    - sourceline: 'ppa:ubuntu-toolchain-r/test'
-    - sourceline: 'ppa:h-rayflood/llvm'
-    - sourceline: 'deb 
http://download.opensuse.org/repositories/home:/delcypher:/z3/xUbuntu_14.04/ /'
-      key_url: 
'http://download.opensuse.org/repositories/home:delcypher:z3/xUbuntu_14.04/Release.key'
-    packages:
-    - gcc-4.8
-    - g++-4.8
-    - libcap-dev
-    - libselinux1-dev
-    - cmake
-
-cache: apt
-before_install:
-    ###########################################################################
-    # Set up the locations to get various packages from
-    # We assume the Travis image uses Ubuntu 14.04 LTS
-    ###########################################################################
-    # Update package information
-    - sudo apt-get update
-    ###########################################################################
-    # Set up out of source build directory
-    ###########################################################################
-    - export SRC_DIR=`pwd`
-    - cd ../
-    - mkdir build
-    - cd build/
-    - export BUILD_DIR=`pwd`
-    ###########################################################################
-    # Install stuff
-    ###########################################################################
-    # Install LLVM and the LLVM bitcode compiler we require to build KLEE
-    - ${SRC_DIR}/.travis/install-llvm-and-runtime-compiler.sh
-    # Install lit (llvm-lit is not available)
-    - sudo pip install lit==0.6.0
-script:
-    # Build uclibc
-    - ${SRC_DIR}/.travis/uclibc.sh
-    # Test uclibc integration with KLEE
-    - ${SRC_DIR}/.travis/klee.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/README.md 
new/klee-uclibc-klee_uclibc_v1.3/README.md
--- old/klee-uclibc-klee_uclibc_v1.2/README.md  2019-03-14 13:12:33.000000000 
+0100
+++ new/klee-uclibc-klee_uclibc_v1.3/README.md  2022-03-31 15:10:56.000000000 
+0200
@@ -1,9 +1,9 @@
 KLEE-uClibc
 ===========
 
-[![Build 
Status](https://api.travis-ci.org/klee/klee-uclibc.svg?branch=klee_0_9_29)](https://travis-ci.org/klee/klee-uclibc)
+[![Build 
Status](https://github.com/klee/klee-uclibc/workflows/CI/badge.svg)](https://github.com/klee/klee-uclibc/actions)
 
-This is a modified version version of uClibc for KLEE.  Please see README for 
information about uClibc. 
+This is a modified version version of uClibc for KLEE.  Please see README for 
information about uClibc.
 
 To build uClibc for KLEE:
 
@@ -23,7 +23,7 @@
   environment variable or by using `--with-cc` with the configure
   script.
 
-3. Run the configure script. 
+3. Run the configure script.
 
    ```$ ./configure --make-llvm-lib```
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/configure 
new/klee-uclibc-klee_uclibc_v1.3/configure
--- old/klee-uclibc-klee_uclibc_v1.2/configure  2019-03-14 13:12:33.000000000 
+0100
+++ new/klee-uclibc-klee_uclibc_v1.3/configure  2022-03-31 15:10:56.000000000 
+0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 Configure the build of klee-uclibc. It can be built
 as a native library or as an LLVM bitcode archive.
@@ -7,13 +7,13 @@
 more verbose information is writen to a log file (usually
 config.log)
 
-You can use the CC environment variable (or flag --with-cc) 
+You can use the CC environment variable (or flag --with-cc)
 to force a particular C compiler. e.g.
 
 $ CC=/usr/bin/clang ./configure
 
 If the forced compiler is a tool name (e.g. CC=clang) then
-the PATH is searched. Otherwise it is assumed to be a 
+the PATH is searched. Otherwise it is assumed to be a
 relative or absolute path.
 
 If building an LLVM bitcode archive and CC is not set
@@ -26,20 +26,15 @@
 
 """
 
-import sys
-try:
-    import argparse
-except ImportError:
-    print("Failed to import argparse. Your python version is probably too old")
-    sys.exit(1)
-
-import os
+import argparse
+import fileinput
 import logging
-import subprocess
-import pprint
+import os
 import platform
+import pprint
 import shutil
-import fileinput
+import subprocess
+import sys
 
 uclibcRoot=os.path.dirname( os.path.abspath(__file__) )
 templateTarget= os.path.join( uclibcRoot, 'Makefile.klee')
@@ -102,8 +97,8 @@
             cc = os.path.abspath(cc)
         else:
             # Search for tool in PATH
-            ccAbs = getAbsPathForToolInPathEnv(cc) 
-            if ccAbs == None:
+            ccAbs = shutil.which(cc)
+            if ccAbs is None:
                 logging.error('"{0}" is not in your path.'.format(cc))
                 sys.exit(1)
             else:
@@ -133,12 +128,11 @@
             os.remove(uclibcConfigFile)
         installPrebuiltConfig()
 
-
 def installPrebuiltConfig():
     """ This function installs pre-made .config files
         and any necessary patches for a particular architecture.
 
-        FIXME: Remove this for upstream klee-uclibc. People should 
+        FIXME: Remove this for upstream klee-uclibc. People should
                just run `make menuconfig` themselves. It's not hard!
     """
     p = platform.machine()
@@ -175,7 +169,6 @@
             logging.debug('Patching KERNEL_HEADERS with path 
"{}"'.format(path))
         sys.stdout.write(line)
 
-
 def findKernelIncludePath():
     """ This function searches for Kernel include files
         which are needed to build uclibc
@@ -197,22 +190,10 @@
     if not os.path.exists( test_path ):
         msg = ("Kernel header files not found at '%s': '%s' is absent."
                "Export the UCLIBC_KERNEL_HEADERS environment variable to 
change the"
-               "default path ('/usr/include')") 
+               "default path ('/usr/include')")
         logging.error(msg % (std_include, test_path))
     return std_include
 
-def getAbsPathForToolInPathEnv(tool):
-    # Use which program to get the path
-    r = runTool(['which', tool])
-
-    if r[0] == 0:
-        # decode needed for Python 3.x as we get bytes not str
-        return r[1].replace('\n','').lstrip().rstrip()
-    else:
-        return None
-
-    
-
 def runTool(cmd):
     """
     return (returnCode, output) from tool
@@ -272,32 +253,32 @@
     if cc.endswith('llvm-gcc'):
         logging.warning('Not using llvm-gcc to build host code.')
         return 'cc' # This probably user's native compiler
-    else:
-        # Other compilers are probably okay
-        return cc
+
+    # Other compilers are probably okay
+    return cc
 
 def handleNativeConfig(pargs, cc=None):
     logging.info('Configuring for native archive')
 
     subs = { 'EMIT_LLVM':'', # Building natively so we don't want LLVM Bitcode
              'TOOLDIR':'' # Native compiler tools should be in PATH
-           } 
+           }
     handleCommonOptions(pargs, subs)
 
 
     def searchPath(cc, lookFor):
         if not cc:
             logging.info('Looking for...{}'.format(lookFor))
-            ccNew = getAbsPathForToolInPathEnv(lookFor)
+            ccNew = shutil.which(lookFor)
 
             if ccNew:
                 logging.info('Found...{}'.format(ccNew))
             else:
-                logging.info('Could not find {}'.format(lookForNew))
+                logging.info('Could not find {}'.format(lookFor))
 
             return ccNew
-        else:
-            return cc
+
+        return cc
 
 
     # Detect compiler if not forced
@@ -308,7 +289,7 @@
 
     # Test compiler
     #FIXME
-    if cc == None:
+    if cc is None:
         logging.error('Could not find a C compiler')
         sys.exit(1)
 
@@ -326,7 +307,7 @@
               'OBJDUMP':'objdump'
             }
     for (name, executable) in tools.items():
-        if not getAbsPathForToolInPathEnv(executable):
+        if not shutil.which(executable):
             logging.error('Could not find {} in PATH'.format(executable))
             sys.exit(1)
 
@@ -340,8 +321,6 @@
 
     doTemplate(subs, templateFile, templateTarget)
 
-    
-
 def handleLLVMConfig(pargs, cc=None):
     # Substitutions
     subs = { 'EMIT_LLVM':'-emit-llvm'}
@@ -351,16 +330,19 @@
 
     llvmConfigTool = pargs.with_llvm_config
     if not llvmConfigTool:
-        llvmConfigTool = getAbsPathForToolInPathEnv('llvm-config')
+        llvmConfigTool = shutil.which('llvm-config')
     else:
-        llvmConfigTool = os.path.abspath(llvmConfigTool)
-        if not os.path.exists(llvmConfigTool):
-            logging.error('"{}" does not exist. Cannot use as llvm-config 
tool'.format(llvmConfigTool))
-            sys.exit(1)
+        if os.sep not in llvmConfigTool:
+            llvmConfigTool = shutil.which(llvmConfigTool)
+        else:
+            llvmConfigTool = os.path.abspath(llvmConfigTool)
+            if not os.path.exists(llvmConfigTool):
+                logging.error('"{}" does not exist. Cannot use as llvm-config 
tool'.format(llvmConfigTool))
+                sys.exit(1)
 
     logging.info('Using llvm-config at...{}'.format(llvmConfigTool))
 
-    if llvmConfigTool == None:
+    if llvmConfigTool is None:
         logging.error('llvm-config cannot be found')
         sys.exit(1)
 
@@ -405,13 +387,14 @@
         if not cc:
             logging.error('Failed to find a working LLVM bitcode compiler')
             sys.exit(1)
+        logging.info('Using LLVM Bitcode Compiler...{}'.format(cc))
     else:
+        logging.info('Using LLVM Bitcode Compiler specified by CC 
...{}'.format(cc))
         if not testBitCodeCompiler(cc, llvmToolDir):
             logging.error('LLVM Bitcode compiler does not work')
             sys.exit(1)
 
     # Add compiler to substitutions
-    logging.info('Using LLVM Bitcode Compiler...{}'.format(cc))
     subs['CC'] = cc
     subs['HOSTCC'] = determineHostCompiler(cc)
 
@@ -426,7 +409,6 @@
     doTemplate(subs, templateFile, templateTarget)
 
 def doTemplate(subs, src, dest):
-    import re
     """
         Do a Template substitution using @KEY@ syntax.
 
@@ -451,14 +433,12 @@
         # Do replacements
         for (oldString, replacement) in subs.items():
             srcString = srcString.replace('@' + oldString + '@', replacement)
-            
+
     # Write templated string to file
     logging.info('Writing templated file to "{}"'.format(dest))
     with open(dest,'w') as f:
         f.write(srcString)
 
-
-
 def findBitCodeCompiler(llvmToolDir):
     """
         Search for LLVM Bitcode compiler.
@@ -477,25 +457,24 @@
             ccPath=None
     else:
         ccPath=None
-    
+
     # If that failed try llvm-gcc in PATH
     if not ccPath:
-        llvmgcc = getAbsPathForToolInPathEnv('llvm-gcc')
+        llvmgcc = shutil.which('llvm-gcc')
         if llvmgcc:
             logging.info('Found llvm-gcc in PATH...{}'.format(llvmgcc))
             if testBitCodeCompiler(llvmgcc, llvmToolDir):
                 ccPath = llvmgcc
-                
+
     # If that failed try clang in PATH
     if not ccPath:
-        clang = getAbsPathForToolInPathEnv('clang')
+        clang = shutil.which('clang')
         if clang:
             logging.info('Found clang in PATH...{}'.format(llvmgcc))
             if testBitCodeCompiler(clang, llvmToolDir):
                 ccPath = clang
 
     return ccPath
-        
 
 def testBitCodeCompiler(cc, llvmToolDir):
     """
@@ -521,7 +500,6 @@
         if bitCodeFileName and os.path.exists(bitCodeFileName): 
os.remove(bitCodeFileName)
         if cProgramFileName and os.path.exists(cProgramFileName): 
os.remove(cProgramFileName)
         if llvmAsFileName and os.path.exists(llvmAsFileName): 
os.remove(llvmAsFileName)
-        pass
 
     try:
         with tempfile.NamedTemporaryFile(suffix='.bc', delete=False) as f:
@@ -541,11 +519,11 @@
             logging.error(msg)
             raise Exception(msg)
 
-        (retCode, ccOutput) = runTool([cc, 
+        (retCode, ccOutput) = runTool([cc,
                                        '-c',
-                                       '-g', 
-                                       '-emit-llvm', 
-                                       cProgramFileName, 
+                                       '-g',
+                                       '-emit-llvm',
+                                       cProgramFileName,
                                        '-o', bitCodeFileName]
                                       )
 
@@ -578,10 +556,10 @@
             cleanUp()
             return False
 
-    except Exception as e:
+    except Exception:
         cleanUp()
         raise
-    
+
     cleanUp()
     logging.info('Compiler {} works'.format(cc))
     return True
@@ -591,7 +569,7 @@
         uClibc needs ncurses for make menuconfig
         This function returns true if it is available.
         Other wise it returns false.
-        
+
         cc is the compiler to use
     """
     import tempfile
@@ -622,5 +600,6 @@
         logging.error('You should install the ncurses library and development 
headers.')
         return False
 
+
 if __name__ == '__main__':
     main(sys.argv[1:])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/klee-uclibc-klee_uclibc_v1.2/extra/Configs/Config.in 
new/klee-uclibc-klee_uclibc_v1.3/extra/Configs/Config.in
--- old/klee-uclibc-klee_uclibc_v1.2/extra/Configs/Config.in    2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/extra/Configs/Config.in    2022-03-31 
15:10:56.000000000 +0200
@@ -806,7 +806,7 @@
        depends on UCLIBC_PREGENERATED_LOCALE_DATA
        default n
        help
-         If you would like the build process to use 'wget' to automatically
+         If you would like the build process to use 'wget'/'curl' to 
automatically
          download the pregenerated locale data, enable this option.  Otherwise
          you will need to obtain the locale data yourself from:
                http://www.uclibc.org/downloads/uClibc-locale-030818.tgz
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/klee-uclibc-klee_uclibc_v1.2/extra/locale/Makefile.in 
new/klee-uclibc-klee_uclibc_v1.3/extra/locale/Makefile.in
--- old/klee-uclibc-klee_uclibc_v1.2/extra/locale/Makefile.in   2019-03-14 
13:12:33.000000000 +0100
+++ new/klee-uclibc-klee_uclibc_v1.3/extra/locale/Makefile.in   2022-03-31 
15:10:56.000000000 +0200
@@ -6,7 +6,20 @@
 #
 
 # command used to download source code
-WGET := wget --passive-ftp
+GET  :=
+WGET := $(shell command -v wget 2> /dev/null)
+CURL := $(shell command -v curl 2> /dev/null)
+
+ifneq (, $(WGET))
+GET += $(WGET) --passive-ftp
+else
+ifneq (, $(CURL))
+GET += $(CURL) -OL
+else
+$(error "curl/wget not found")
+endif
+endif
+
 
 LOCALE_DATA_FILENAME := uClibc-locale-030818.tgz
 
@@ -141,7 +154,7 @@
 
 $(locale_OUT)/$(LOCALE_DATA_FILENAME):
 ifeq ($(UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA),y)
-       ( cd $(dir $@); $(WGET) http://www.uclibc.org/downloads/$(notdir $@) )
+       ( cd $(dir $@); $(GET) https://www.uclibc.org/downloads/$(notdir $@) )
 endif
 
 ifeq ($(UCLIBC_PREGENERATED_LOCALE_DATA),y)

Reply via email to