mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 22:17:54 +00:00
71 lines
2.5 KiB
Bash
Executable file
71 lines
2.5 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
updater() {
|
|
export DOINO
|
|
export TAG
|
|
export SPCTAG
|
|
export YYYYMMDD=`yyyymmdd`
|
|
export DOI=10.5281/zenodo.$DOINO
|
|
export YYYY=${YYYYMMDD:0:4}
|
|
export YYYYMM=${YYYYMMDD:0:6}
|
|
export YYYYMMDD=${YYYYMM}22
|
|
export MON=`date +%b`
|
|
export MONTH=`date +%B`
|
|
TAG=$(echo $SPCTAG | perl -pe 's/ //g')
|
|
echo Tag=$TAG=\"$SPCTAG\" Date:$YYYYMMDD Year:$YYYY Mon:$MON Month:$MONTH DOI:$DOI
|
|
export TITLE="GNU Parallel $YYYYMMDD ('$SPCTAG')"
|
|
|
|
if [ -z "$DOINO" ] ; then
|
|
echo '*** Set DOINO and try again ***'
|
|
echo 'https://zenodo.org/deposit/new (Reserve DOI)'
|
|
echo '[Save]'
|
|
cat .last-doitag.txt
|
|
echo . .last-doitag.txt
|
|
return
|
|
fi
|
|
if [ -z "$SPCTAG" ] ; then
|
|
echo '*** Set SPCTAG and try again ***'
|
|
cat .last-doitag.txt
|
|
echo . .last-doitag.txt
|
|
return
|
|
fi
|
|
echo "export DOINO=$DOINO" > .last-doitag.txt
|
|
echo "export TAG='$TAG'" >> .last-doitag.txt
|
|
echo "export SPCTAG='$SPCTAG'" >> .last-doitag.txt
|
|
echo "export YYYYMMDD=$YYYYMMDD" >> .last-doitag.txt
|
|
echo 'echo "$DOINO $YYYYMMDD ($TAG)"' >> .last-doitag.txt
|
|
|
|
perl -i -pe "s/20\d\d\d\d\d\d/$YYYYMMDD/" configure.ac
|
|
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/sql
|
|
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/parsort
|
|
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/env_parallel*
|
|
perl -i -pe "/version/ and s/20\d\d\d\d\d\d/$YYYYMMDD/" src/niceload
|
|
perl -i -pe "s/parallel-20\d\d\d\d\d\d/parallel-$YYYYMMDD/" README
|
|
perl -i -pe '
|
|
# Update version 20209999
|
|
/version/ and s/20\d\d\d\d\d\d/$ENV{YYYYMMDD}/;
|
|
# Update: 10.5281/zenodo.1146014
|
|
s:10.5281/zenodo.\d+:$ENV{DOI}:;
|
|
# Update "@software{tange_2015_16303,"
|
|
s:tange_\d+_\d+:tange_$ENV{YYYY}_$ENV{DOINO}:;
|
|
# Update month = mar,
|
|
s/(month\s+=\s+)\S+,",/$1$ENV{MON},",/;
|
|
# Update title = {GNU Parallel 20200522 ('Kraftwerk')},",
|
|
/ title\s+= / and s/\{.*\}/{$ENV{TITLE}}/;
|
|
# Tange, O. (2020, May 22). GNU Parallel 20200522 ('Kraftwerk').
|
|
s/(Tange, O. .).*(.. )(GNU.*[)])/$1$ENV{YYYY}, $ENV{MONTH} 22$2$ENV{TITLE}/;
|
|
' src/parallel README
|
|
(
|
|
ppar --help
|
|
ppar --citation
|
|
grep -i 'zenodo|tange' README
|
|
) 2>&1 | grep -E '^ |^}|tange'
|
|
mv ~/.parallel/will-cite ~/.parallel/will-cite.
|
|
ppar ::: true
|
|
mv ~/.parallel/will-cite. ~/.parallel/will-cite
|
|
}
|
|
updater
|