diff options
author | Erich Eckner <git@eckner.net> | 2019-07-18 10:07:27 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-07-18 10:07:27 +0200 |
commit | 739d629862af50b41957960aa4e66c1b462bd53d (patch) | |
tree | 299db55fdeaec92103e1df611b66df893b49ad40 /archPackagesUpdate | |
parent | 18631bb161aaf43eec0c1be3a20cbd6409ae87da (diff) | |
download | archlinuxewe-739d629862af50b41957960aa4e66c1b462bd53d.tar.xz |
archPackagesUpdate: cleanup
Diffstat (limited to 'archPackagesUpdate')
-rwxr-xr-x | archPackagesUpdate | 51 |
1 files changed, 24 insertions, 27 deletions
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 |