Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • q-e q-e
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 80
    • Issues 80
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • QEF - Quantum ESPRESSO Foundation
  • q-eq-e
  • Issues
  • #435
Closed
Open
Created Dec 25, 2021 by hongyi-zhao@hongyi-zhaoContributor

Enhance the robustness of `install/install_utils` script.

Based on the gzip option of test compressed file integrity:

$ gzip --help | grep integrity
  -t, --test        test compressed file integrity

I tried to modify the install/install_utils script to the following:

# Copyright (C) 2001-2016 Quantum ESPRESSO group
#
# This program 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 2
# of the License. See the file `License' in the root directory
# of the present distribution.
#
# Utilities

###########################################################
# Template function
# $(1) = package name
# $(2) = package URL
# $(3) = directory name
# $(4) = plugin/code name
###########################################################

define download_and_unpack
  @(if ! gzip -t ../archive/`echo "$(2)" | sed 's/.*\///;s/.*=//'` > /dev/null 2>&1 ; then \
  rm -fr ../archive/`echo "$(2)" | sed 's/.*\///;s/.*=//'`; \
  rm -fr ../$(3); \
  wget -O ../archive/`echo "$(2)" | sed 's/.*\///;s/.*=//'` $(2) > /dev/null 2>&1; \
  if test "`echo $$?`" -ne "0" ; then \
  curl -o ../archive/`echo "$(2)" | sed 's/.*\///;s/.*=//'` $(2) > /dev/null 2>&1; \
  if test "`echo $$?`" -ne "0" ; then \
  echo "*** Unable to download $(4). Test whether curl or wget is installed and working," ; \
  echo "*** if you have direct access to internet. If not, copy into archive/ the file" ; \
  echo "*** located here $(2)" ; \
  exit 1 ; fi ; fi ; fi) ; \
  if test $$? -eq 0 -a ! -e ../$(3); then \
  (gzip -dc ../archive/`echo "$(2)" | sed 's/.*\///;s/.*=//'` | \
    (cd ../ ; tar -xvf - ) ) ; \
  if test "`echo $$?`" -ne "0" ; then \
  echo "*** Unable to download $(2)." ; \
  echo "*** Verify that the url is correct." ; \
  exit 1 ; \
  else \
  (cd ../ ; ln -s $(1) $(3)) ; fi ; fi
endef

I want to ask for comments and improvement suggestions here first. If there are no objections, I can consider submitting a PR on GitLab.

Regards, HZ

Edited Jan 20, 2022 by hongyi-zhao
Assignee
Assign to
Time tracking