From 739d629862af50b41957960aa4e66c1b462bd53d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 18 Jul 2019 10:07:27 +0200 Subject: archPackagesUpdate: cleanup --- archPackagesUpdate | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'archPackagesUpdate') diff --git a/archPackagesUpdate b/archPackagesUpdate index 2501db395..2b369b1bc 100755 --- a/archPackagesUpdate +++ b/archPackagesUpdate @@ -71,11 +71,11 @@ cleanUp () { [ "a${logFile}" == 'a-' ] && logFile="/tmp/$(date '+%F-%H-%M-%S')" [[ "${logFile}" == *".tar.gz" ]] || logFile="${logFile}.tar.gz" cd "${tmpDir}" - logFiles="$( + logFiles=$( for s in */*.log; do [ -r "${s}" ] && echo "${s}" done - )" + ) if [ -n "${logFiles}" ]; then tar -czf "${logFile}" ${logFiles} echo 'Logfiles saved to "'"${logFile}"'".' @@ -202,39 +202,17 @@ fi echo '... done' ${aufRechenknecht} && pkgSrcDir="${pkgSrcDir}/archPackages" -cd "${pkgSrcDir}" # extract git ${branch} -git archive --format tar "${branch}" | \ +git -C "${pkgSrcDir}" archive --format tar "${branch}" | \ tar -x -C "${tmpDir}" -f - cd "${tmpDir}" -if [ -f '.gitmodules' ]; then - sed -n ' - /^\s*path = /{ - N - s/^\s*path = // - s/\n\s*url = / / - s,ssh://aur@aur.archlinux.org/,https://aur.archlinux.org/, - p - } - ' '.gitmodules' | \ - while read -r path url; do - if [ -n "$(ls -A "${path}")" ]; then - git submodule update -- "${path}" - continue - fi - mkdir -p "${path}" - git clone "${url}" "${path}" - done -fi # update $0 if ${updateMe} && ${aufRechenknecht} && [ -e "$(basename "$0")" ] && ! diff -q "$(basename "$0")" "$0" &> /dev/null; then cp "$(basename "$0")" "$0" - "$0" "${args[@]}" - err=$? - exit ${err} + exec "$0" "${args[@]}" fi # clean unsigned packages @@ -275,6 +253,26 @@ unset archs unset verss unset repos +if [ -f '.gitmodules' ]; then + sed -n ' + /^\s*path = /{ + N + s/^\s*path = // + s/\n\s*url = / / + s,ssh://aur@aur.archlinux.org/,https://aur.archlinux.org/, + p + } + ' '.gitmodules' | \ + while read -r path url; do + if [ -n "$(ls -A "${path}")" ]; then + git submodule update -- "${path}" + continue + fi + mkdir -p "${path}" + git clone "${url}" "${path}" + done +fi + if ${aufRechenknecht}; then # collect packages @@ -418,7 +416,6 @@ if ${aufRechenknecht}; then maxErr=0 # generate current makepkg.conf, makepkg-i686.conf and makepkg-pentium4.conf - cd "${tmpDir}" cp /etc/makepkg.conf . if ! patch -p0 -i makepkgSystem.patch; then cleanUp -- cgit v1.2.3-70-g09d2