2020-05-31 14:42:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-04-22 16:20:41 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2020-05-31 14:42:04 +00:00
|
|
|
updater() {
|
|
|
|
export DOINO
|
|
|
|
export TAG
|
2021-04-22 16:20:41 +00:00
|
|
|
export SPCTAG
|
2020-05-31 14:42:04 +00:00
|
|
|
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`
|
2021-04-22 16:20:41 +00:00
|
|
|
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')"
|
2020-05-31 14:42:04 +00:00
|
|
|
|
|
|
|
if [ -z "$DOINO" ] ; then
|
|
|
|
echo '*** Set DOINO and try again ***'
|
|
|
|
echo 'https://zenodo.org/deposit/new (Reserve DOI)'
|
|
|
|
echo '[Save]'
|
2020-11-22 15:22:54 +00:00
|
|
|
cat .last-doitag.txt
|
|
|
|
echo . .last-doitag.txt
|
2020-05-31 14:42:04 +00:00
|
|
|
return
|
|
|
|
fi
|
2021-04-22 16:20:41 +00:00
|
|
|
if [ -z "$SPCTAG" ] ; then
|
|
|
|
echo '*** Set SPCTAG and try again ***'
|
2020-11-22 15:22:54 +00:00
|
|
|
cat .last-doitag.txt
|
|
|
|
echo . .last-doitag.txt
|
2020-05-31 14:42:04 +00:00
|
|
|
return
|
|
|
|
fi
|
2020-11-22 15:22:54 +00:00
|
|
|
echo "export DOINO=$DOINO" > .last-doitag.txt
|
2021-04-22 16:20:41 +00:00
|
|
|
echo "export TAG='$TAG'" >> .last-doitag.txt
|
|
|
|
echo "export SPCTAG='$SPCTAG'" >> .last-doitag.txt
|
2020-11-22 15:22:54 +00:00
|
|
|
echo "export YYYYMMDD=$YYYYMMDD" >> .last-doitag.txt
|
|
|
|
echo 'echo "$DOINO $YYYYMMDD ($TAG)"' >> .last-doitag.txt
|
|
|
|
|
2020-05-31 14:42:04 +00:00
|
|
|
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
|
2020-10-22 19:47:01 +00:00
|
|
|
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*
|
2020-05-31 14:42:04 +00:00
|
|
|
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
|