/[osn-commons]/dist/distupload
ViewVC logotype

Diff of /dist/distupload

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by rakinar2, Thu Aug 1 17:02:25 2024 UTC revision 5 by rakinar2, Fri Aug 2 18:29:14 2024 UTC
# Line 124  check_files() { Line 124  check_files() {
124      done      done
125  }  }
126    
127    generate_gpg_signature() {
128        local files="$@"
129    
130        if [ -z "$(command -v gpg)" ]; then
131            echo "$me: gpg could not be found in \$PATH, please make sure it is installed" >&2
132            exit 1
133        fi
134    
135        echo "$me: generating GPG signatures, please enter your passphrase when asked"
136    
137        for file in $files; do
138            if [ -f "$file.sig" ]; then
139                echo "$me: signature file $file.sig already exists, skipping" >&2
140                continue
141            fi
142    
143            echo "$me: generating GPG signature for $file"
144            gpg --detach-sign  --armor -o - -- "$file" > "$file.sig"
145    
146            if [ $? -ne 0 ]; then
147                echo "$me: failed to generate signature for $file" >&2
148                rm -f "$file.sig"
149                exit 1
150            fi
151        done
152    }
153    
154  check_requirements  check_requirements
155    
156  remote="ssh.onesoftnet.eu.org"  remote="localhost"
157  method="scp"  method="scp"
158  username=""  username=""
159  password=""  password=""
# Line 235  if [ ! -z "$username" ]; then Line 262  if [ ! -z "$username" ]; then
262      echo "$me: authenticating as $username"      echo "$me: authenticating as $username"
263  fi  fi
264    
265  echo "$me: files to upload: $files"  generate_gpg_signature "$files"
266    
267    echo "$me: files to upload: $files (with GPG signatures)"
268    
269    sigs=""
270    
271    for file in $files; do
272        sigs="$sigs $file.sig"
273    done
274    
275    files="$files $sigs"
276    
277  time_start=$(date +%s)  time_start=$(date +%s)
278    
# Line 321  esac Line 358  esac
358  time_end=$(date +%s)  time_end=$(date +%s)
359  time_diff=$((time_end - time_start))  time_diff=$((time_end - time_start))
360    
361    echo "$me: cleaning up signature files"
362    
363    for sigfile in $sigs; do
364        rm -f "$sigfile"
365    done
366    
367  echo "$me: upload complete in ${time_diff}s"  echo "$me: upload complete in ${time_diff}s"

Legend:
Removed from v.4  
changed lines
  Added in v.5

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26