From be8481f3218b736efa8bdaa12a3a407984c2c62b Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 20 Apr 2020 01:07:49 +0100 Subject: Maneage instead of Template in README-hacking.md and copyright notices Until now, throughout Maneage we were using the old name of "Reproducible Paper Template". But we have finally decided to use Maneage, so to avoid confusion, the name has been corrected in `README-hacking.md' and also in the copyright notices. Note also that in `README-hacking.md', the main Maneage branch is now called `maneage', and the main Git remote has been changed to `https://gitlab.com/maneage/project' (this is a new GitLab Group that I have setup for all Maneage-related projects). In this repository there is only one `maneage' branch to avoid complications with the `master' branch of the projects using Maneage later. --- reproduce/software/shell/bashrc.sh | 21 +++++++++------------ reproduce/software/shell/configure.sh | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 23 deletions(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/bashrc.sh b/reproduce/software/shell/bashrc.sh index b2a151f..69bbba6 100755 --- a/reproduce/software/shell/bashrc.sh +++ b/reproduce/software/shell/bashrc.sh @@ -31,15 +31,12 @@ # # Copyright (C) 2019-2020 Mohammad Akhlaghi # -# This script is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This script is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# A copy of the GNU General Public License is available at -# . +# This script is part of Maneage. Maneage is free software: you can +# redistribute it and/or modify it under the terms of the GNU General +# Public License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. +# +# Maneage is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. See . diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 9f6f3e6..7f837a5 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -4,18 +4,18 @@ # # Copyright (C) 2018-2020 Mohammad Akhlaghi # -# This script is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. +# This script is part of Maneage. Maneage is free software: you can +# redistribute it and/or modify it under the terms of the GNU General +# Public License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. # -# This script is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# A copy of the GNU General Public License is available at -# . +# Maneage is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. See . + + + # Script settings -- cgit v1.2.1 From ad84e266987a46d88336a23a14ea27100e4cd160 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 20 Apr 2020 20:33:39 +0100 Subject: Configuration: current directory printed properly in stdout Until now, the message that we printed just before starting to build software didn't actually print the current directory, but only `pwd'. With this commit, this is fixed (it uses the `currentdir' variable that is already found before). --- reproduce/software/shell/configure.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 7f837a5..b4cf43b 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -610,6 +610,7 @@ fi # Build directory # --------------- +currentdir=$(pwd) if [ $rewritepconfig = yes ]; then cat < Date: Thu, 23 Apr 2020 17:34:33 +0430 Subject: Configure.sh: build directory checked for ability to modify permissions Until now we only checked for the existance and write-ability of the build directory. But we recently discovered that if the specified build-directory is in a non-POSIX compatible partition (for example NTFS), permissions can't be modified and this can cause crashs in some programs (in particular, while building Perl, see [1]). The thing that makes this problem hard to identify is that on such partitions, `chmod' will still return 0 (so it was hard to find). With this commit, a check has been added after the user specifies the build-directory. If the proposed build directory is not able to handle permissions as expected, the configure script will not continue and will let the user know and will ask them for another directory. Also, the two printed characters at the start of error messages were changed to `**' (instead of `--'). When everything is good, we'll use `--' to tell the user that their given directory will be used as the build directory. And since there are multiple checks now, the final message to specify a new build directory is now moved to the end and not repeated in every check. [1] https://savannah.nongnu.org/support/?110220 --- reproduce/software/shell/configure.sh | 92 ++++++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 11 deletions(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index b4cf43b..dd3b9bc 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -93,6 +93,64 @@ absolute_dir () +# Check file permission handling (POSIX-compatibility) +# ---------------------------------------------------- +# +# Check if a `given' directory handles permissions as expected. +# +# This is to prevent a known bug in the NTFS filesystem that prevents +# proper installation of Perl, and probably some other packages. This +# function receives the directory as an argument and then, creates a dummy +# file, and examines whether the given directory handles the file +# permissions as expected. +# +# Returns `0' if everything is fine, and `255' otherwise. Choosing `0' is +# to mimic the `$ echo $?' behavior, while choosing `255' is to prevent +# misunderstanding 0 and 1 as true and false. +# +# ===== CAUTION! ===== # +# +# Since there is a `set -e' before running this function, the whole script +# stops and exits IF the `check_permission' (or any other function) returns +# anything OTHER than `0'! So, only use this function as a test. Here's a +# minimal example: +# +# if $(check_permission $some_directory) ; then +# echo "yay"; else "nay"; +# fi ; +check_permission () +{ + # Make a `junk' file, activate its executable flag and record its + # permissions generally. + local junkfile=$1/check_permission_tmp_file + rm -f $junkfile + echo "Don't let my short life go to waste" > $junkfile + chmod +x $junkfile + local perm_before=$(ls -l $junkfile | awk '{print $1}') + + # Now, remove the executable flag and record the permissions. + chmod -x $junkfile + local perm_after=$(ls -l $junkfile | awk '{print $1}') + + # Clean up before leaving the function + rm -f $junkfile + + # If the permissions are equal, the filesystem doesn't allow + # permissions. + if [ $perm_before = $perm_after ]; then + # Setting permission FAILED + return 1 + else + # Setting permission SUCCESSFUL + return 0 + fi +} + + + + + + # Check for C/C++ compilers # ------------------------- # @@ -653,21 +711,20 @@ EOF bdir=$(absolute_dir $build_dir) rm -rf $build_dir/$junkname else - echo " -- Can't write in '$build_dir'"; echo + echo " ** Can't write in '$build_dir'"; echo fi else if mkdir $build_dir 2> /dev/null; then instring="the newly created" bdir=$(absolute_dir $build_dir) else - echo " -- Can't create '$build_dir'"; echo + echo " ** Can't create '$build_dir'"; echo fi fi # If its given, make sure it isn't a subdirectory of the source # directory. if ! [ x"$bdir" = x ]; then - echo "Given build directory: $bdir" if echo "$bdir/" \ | grep '^'$currentdir 2> /dev/null > /dev/null; then @@ -676,17 +733,30 @@ EOF # Inform the user that this is not acceptable and reset `bdir'. bdir= - echo " -- The build-directory cannot be under the source-directory." - echo " Please specify another build-directory that is outside of the source." - echo "" - else - echo " -- Build directory set to ($instring): '$bdir'" + echo " ** The build-directory cannot be under the source-directory." + fi + fi + + # If everything is fine until now, see if we're able to manipulate + # file permissions. + if ! [ x"$bdir" = x ]; then + if ! $(check_permission $bdir); then + bdir= + echo " ** File permissions can't be modified in this directory" fi fi - # Reset `build_dir' to blank, so it continues asking when the - # previous value wasn't usable. - build_dir= + # If the build directory was good, the loop will stop, if not, + # reset `build_dir' to blank, so it continues asking for another + # directory and let the user know that they must select a new + # directory. + if [ x$bdir = x ]; then + build_dir= + echo " ** Please select another directory." + echo "" + else + echo " -- Build directory set to ($instring): '$bdir'" + fi done fi -- cgit v1.2.1 From d474d4c8e1f67743b84a6ad852d5d80a31a9103d Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 27 Apr 2020 02:55:01 +0100 Subject: Aborting with informative error when GNU gettext not found Until now, we wouldn't explicity check for GNU gettext. If it was present on the system, we would just add a link to it in Maneage's installation directory. However, in bug #58248, Boud noticed that Git (a basic software) actually needs it to complete its installation. Unfortunately we haven't had the tiem to include a build of Gettext in Maneage. Because it is mostly available on many systems, it hasn't been reported too commonly, it also has many dependencies which make it a little time consuming to install. So with this commit, we actually check for GNU gettext right after checking the compiler and if its not available an informative error message is written to inform the user of the problem, along with suggestions on fixing it (how to install GNU gettext from their package manager). --- reproduce/software/shell/configure.sh | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index dd3b9bc..6f3ed7f 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -299,7 +299,7 @@ rm -f $testprog $testsource # See if the C compiler can build static libraries # ------------------------------------------------ - +# # We are manually only working with shared libraries: because some # high-level programs like Wget and cURL need dynamic linking and if we # build the libraries statically, our own builds will be ignored and these @@ -316,6 +316,44 @@ static_build=no +# Check for GNU gettext +# --------------------- +# +# Some of the basic sofware need GNU gettext which we don't yet install. +has_gettext=0 +if type msgfmt > /dev/null 2>/dev/null; then has_gettext=1; fi +if [ $has_gettext = 0 ]; then + cat < Date: Tue, 28 Apr 2020 03:18:52 +0100 Subject: Better explanation at the end of the configuration Until now, at the end of the configuration step, we would tell the user this: "To change the configuration later, please re-run './project configure', DO NOT manually edit the relevant files". However, as Boud suggested in Bug #58243, this is against our principle to encourage users to modify Maneage. With this commit, that explanation has been expanded by a few sentences to tell the users what to change and warn them in case they decide to change the build-directory. --- reproduce/software/shell/configure.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 6f3ed7f..5837642 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -1514,12 +1514,16 @@ cat < Date: Wed, 29 Apr 2020 03:45:21 +0100 Subject: Reactivated --host-cc config option to use host C compiler Until now, if GCC couldn't be built for any reason, Maneage would crash and the user had no way forward. Since GCC is complicated, it may happen and is frustrating to wait until the bug is fixed. Also, while debugging Maneage, when we know GCC has no problem, because it takes so long, it discourages testing. With this commit, we have re-activated the `--host-cc' option. It was already defined in the options of `./project', but its affect was nullified by hard-coding it to zero in the configure script on GNU/Linux systems. So with this commit that has been removed and the user can use their own C compiler on a GNU/Linux operating system also. Furthermore, to inform the user about this option and its usefulness, when GCC fails to build, a clear warning message is printed, instructing the user to post the problem as a bug and telling them how to continue building the project with the `--host-cc' option. --- reproduce/software/shell/configure.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 5837642..cce6e62 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -383,7 +383,6 @@ ______________________________________________________ EOF sleep 5 else - host_cc=0 on_mac_os=no fi -- cgit v1.2.1