Further improvements
This commit is contained in:
parent
b8cfc113ad
commit
0a1b5f1727
14
debian/createSeries.sh
vendored
14
debian/createSeries.sh
vendored
|
@ -10,10 +10,10 @@ seriesFolder="$(pwd)/$1~series"
|
|||
seriesNames=("focal" "groovy" "hirsute" "impish")
|
||||
gitFolder="/home/nuno/Documents/core/software/fresh/bash/sid/longnowformd_package/longnow-git/"
|
||||
|
||||
rm -r "$stemFolder"
|
||||
rm -rf "$stemFolder"
|
||||
mkdir "$stemFolder"
|
||||
|
||||
rm -r "$seriesFolder"
|
||||
rm -rf "$seriesFolder"
|
||||
mkdir "$seriesFolder"
|
||||
|
||||
cp "$gitFolder/longnow" "$stemFolder/longnow"
|
||||
|
@ -40,7 +40,7 @@ for seriesName in "${seriesNames[@]}"; do
|
|||
sed -i "s|unstable|$seriesName|g" changelog
|
||||
|
||||
# Meaningful update message
|
||||
sed -i 's|Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>|Small improvement; numeric comparison and deleting the old links file to allow for manual user intervention|g' changelog
|
||||
sed -i 's|Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>|Minor tweak.|g' changelog
|
||||
|
||||
# Edit the control file; change "unknown" section to "utils" (or some other section)
|
||||
sed -i 's|Section: unknown|Section: utils|g' control
|
||||
|
@ -57,11 +57,15 @@ for seriesName in "${seriesNames[@]}"; do
|
|||
wait
|
||||
cd ..
|
||||
|
||||
dput ppa:nunosempere/longnowformd longnow_0.8~$seriesName-1_source.changes
|
||||
dput ppa:nunosempere/longnowformd longnow_1.1~$seriesName-1_source.changes
|
||||
wait
|
||||
done
|
||||
|
||||
## How to use: ./createSeries.sh longnow-0.8
|
||||
## How to use: ./createSeries.sh longnow-1.1
|
||||
|
||||
cp -r "$stemFolder" "$gitFolder/debian/$stemFolderName"
|
||||
cp -r "$seriesFolder" "$gitFolder/debian/$stemFolderName~series"
|
||||
cp "/home/nuno/Documents/core/software/fresh/bash/sid/longnowformd_package/createSeries.sh" "$gitFolder/debian/createSeries.sh"
|
||||
|
||||
sudo cp "$gitFolder/longnow" "/usr/bin/longnow"
|
||||
sudo chmod 555 "/usr/bin/longnow"
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
longnow (0.9~focal-1) focal; urgency=medium
|
||||
|
||||
* Minor usability improvements
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Tue, 29 Jun 2021 18:32:55 +0200
|
|
@ -1 +0,0 @@
|
|||
longnow_0.9~focal-1_source.buildinfo utils optional
|
|
@ -1,5 +0,0 @@
|
|||
longnow (0.9~groovy-1) groovy; urgency=medium
|
||||
|
||||
* Minor usability improvements
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Tue, 29 Jun 2021 18:33:04 +0200
|
|
@ -1 +0,0 @@
|
|||
longnow_0.9~groovy-1_source.buildinfo utils optional
|
|
@ -1,5 +0,0 @@
|
|||
longnow (0.9~hirsute-1) hirsute; urgency=medium
|
||||
|
||||
* Minor usability improvements
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Tue, 29 Jun 2021 18:33:09 +0200
|
|
@ -1 +0,0 @@
|
|||
longnow_0.9~hirsute-1_source.buildinfo utils optional
|
|
@ -1,5 +0,0 @@
|
|||
longnow (0.9~impish-1) impish; urgency=medium
|
||||
|
||||
* Minor usability improvements
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Tue, 29 Jun 2021 18:33:15 +0200
|
|
@ -1 +0,0 @@
|
|||
longnow_0.9~impish-1_source.buildinfo utils optional
|
132
debian/longnow-0.9~series/longnow-0.9~impish/longnow
vendored
132
debian/longnow-0.9~series/longnow-0.9~impish/longnow
vendored
|
@ -1,132 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
function getMdLinks(){ # Use: Takes a markdown file file.md, extracts all links, finds the unique ones and saves them to file.md.links
|
||||
linksFile="$1.links"
|
||||
linksFile2="$1.links2"
|
||||
echo ""
|
||||
echo "Extracting links..."
|
||||
rm "$1.links" -f
|
||||
grep -Eoi '\]\((.*)\)' $1 | grep -Eo '(http|https)://[^)]+' >> "$1.links"
|
||||
## sed -i 's/www.wikiwand.com\/en/en.wikipedia.org\/wiki/g' $1
|
||||
awk '!seen[$0]++' "$linksFile" > "$linksFile2" && mv "$linksFile2" "$linksFile"
|
||||
echo "Done."
|
||||
numLinesLinkFile=$(wc -l "$linksFile" | awk '{ print $1 }')
|
||||
totalTimeInMinutes=$(echo "scale=0; ($numLinesLinkFile*7.5 + 60*$numLinesLinkFile/15)/60" | bc)
|
||||
echo "Expected to take $totalTimeInMinutes mins."
|
||||
}
|
||||
|
||||
function pushToArchive(){
|
||||
# Use: Takes a txt file with one link on each line and pushes all the links to the internet archive. Saves those links to a textfile
|
||||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsfile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
## How to deal with errors that arise
|
||||
echo "If this file contains errors, you can deal with them as follows:" >> "$errorsFile"
|
||||
echo "- Do another pass with \$ longnow yourfile.md. If you don't delete yourfile.md.links.archived, past archive links are remembered, and only the links which are not there are sent again" >> "$errorsFile"
|
||||
echo "- Input the offending links manually to https://archive.org/, add the results to the yourfile.md.links.archived file manually, and then do another pass with \$ longnow yourfile.md" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function addArchiveLinksToFile(){
|
||||
|
||||
originalFile="$1"
|
||||
originalFileTemp="$originalFile.temp"
|
||||
linksFile="$1.links"
|
||||
archivedLinksFile="$1.links.archived"
|
||||
errorsFile="$1.links.errors"
|
||||
longNowFile="$1.longnow"
|
||||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
||||
function longnow(){
|
||||
doesArchiveNowExist=$(whereis "archivenow")
|
||||
if [ "$doesArchiveNowExist" == "archivenow:" ]
|
||||
then
|
||||
echo "Required archivenow utility not found in path."
|
||||
echo "Install with \$ pip install archivenow"
|
||||
echo "(resp. \$ pip3 install archivenow)"
|
||||
echo "Or follow instructions on https://github.com/oduwsdl/archivenow"
|
||||
else
|
||||
getMdLinks $1
|
||||
pushToArchive $1.links
|
||||
addArchiveLinksToFile $1
|
||||
numLinesErrorFile=$(wc -l "$1.links.errors" | awk '{ print $1 }')
|
||||
if [ "$numLinesErrorFile" -gt 4 ] ;then
|
||||
echo "It seems that there are errors. To view and deal with them, see the $1.links.errors file"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
longnow "$1" ## don't copy this line into your .bashrc file
|
Binary file not shown.
|
@ -1,38 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 3.0 (quilt)
|
||||
Source: longnow
|
||||
Binary: longnow
|
||||
Architecture: all
|
||||
Version: 0.9~focal-1
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Homepage: https://github.com/NunoSempere/longNowForMd
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
longnow deb utils optional arch=all
|
||||
Checksums-Sha1:
|
||||
200c0e401440ee6a0ad112a99bde8a72ef03a7c5 2024 longnow_0.9~focal.orig.tar.xz
|
||||
eea14dc3320524cf4d85428d73e07164a71b3c58 2052 longnow_0.9~focal-1.debian.tar.xz
|
||||
Checksums-Sha256:
|
||||
3ae730632ae5eedf81c7d9af5354373bed2fb76cc28bd7d500fd846ea5199fd6 2024 longnow_0.9~focal.orig.tar.xz
|
||||
dd7a320329cb357eb24ca29c1fed3572847dc952772edd9c724b94a85e8694cb 2052 longnow_0.9~focal-1.debian.tar.xz
|
||||
Files:
|
||||
c8ef19ec02f5f27b3d975b61400f54a8 2024 longnow_0.9~focal.orig.tar.xz
|
||||
92c5fd919322fedafe6bdd58ae16f51a 2052 longnow_0.9~focal-1.debian.tar.xz
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbSzoZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV8OaC/9iRXo24iB+Xv2pj6ZX7dPg
|
||||
g2ExN6SkgVBFQ68RqipWf/v5XU/+DOcnSCMPfeYf+9SOGyJP1Kg74hQ5jj19Vjyt
|
||||
PxogvPlq79MFATiXbfA/giiYxRTReAwgC5UxaA5Ql74uVvwHnjMgnQ4Qx5mW7bq/
|
||||
ktjGeLwon2sh0KbSlXwvx4VW5u/nvbYu1BNIMVAtgdf3QFCkSxad9EQHMKXzIK9L
|
||||
/sJZ0dDd6XgTJhFx03en1gMkCXkIxKzzBsvyzacEQQnV6SrVyIQLsc1wy1z4hUom
|
||||
WIXlWkvr4qJhvflRBotVZV9KeQ1uATROHFCw2vbmAoDgkMFsjBTTsWSLv+5wUW/u
|
||||
ZkvPF5/Y4209It2l2mANDZg4zqUZBDhwzZyLPrc7QoHoNjD+XQ2YYWawddqudbEH
|
||||
hI/YEFhQMLMn7t1tsgFLeCZ6YMoGzMlIulq/SCatIfNlD+C299k/8BpLJcRKIkHJ
|
||||
C3Bbm/fL12Zwle010CrC6QOeYFne6TKE5TIMO675JP8=
|
||||
=BayX
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,46 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 1.8
|
||||
Date: Tue, 29 Jun 2021 18:32:55 +0200
|
||||
Source: longnow
|
||||
Architecture: source
|
||||
Version: 0.9~focal-1
|
||||
Distribution: focal
|
||||
Urgency: medium
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changed-By: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changes:
|
||||
longnow (0.9~focal-1) focal; urgency=medium
|
||||
.
|
||||
* Minor usability improvements
|
||||
Checksums-Sha1:
|
||||
08ec1cf6064335a4242828cdd9ecf94fa8a041d3 1604 longnow_0.9~focal-1.dsc
|
||||
200c0e401440ee6a0ad112a99bde8a72ef03a7c5 2024 longnow_0.9~focal.orig.tar.xz
|
||||
eea14dc3320524cf4d85428d73e07164a71b3c58 2052 longnow_0.9~focal-1.debian.tar.xz
|
||||
e3bff68dc4f41553f1b41099c7b9f035d0cef3f4 6156 longnow_0.9~focal-1_source.buildinfo
|
||||
Checksums-Sha256:
|
||||
8cbac37a7c9304a79be035bbcff82e0085bd0ad04b61726c582423e6be9197a0 1604 longnow_0.9~focal-1.dsc
|
||||
3ae730632ae5eedf81c7d9af5354373bed2fb76cc28bd7d500fd846ea5199fd6 2024 longnow_0.9~focal.orig.tar.xz
|
||||
dd7a320329cb357eb24ca29c1fed3572847dc952772edd9c724b94a85e8694cb 2052 longnow_0.9~focal-1.debian.tar.xz
|
||||
ba898312c50ae7aa918b4e9b7528b391d79aa80f7fd8f9706dc4333e15d44ec8 6156 longnow_0.9~focal-1_source.buildinfo
|
||||
Files:
|
||||
b86b492acfdd55fd2c9ec08f576cc39d 1604 utils optional longnow_0.9~focal-1.dsc
|
||||
c8ef19ec02f5f27b3d975b61400f54a8 2024 utils optional longnow_0.9~focal.orig.tar.xz
|
||||
92c5fd919322fedafe6bdd58ae16f51a 2052 utils optional longnow_0.9~focal-1.debian.tar.xz
|
||||
fc2b323bc729035e169afc0a6996a6cd 6156 utils optional longnow_0.9~focal-1_source.buildinfo
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbSz4ZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV3rcC/9agXXVgXimqFmJLeEIiMz2
|
||||
l8zo2gZjjwAQvaObjVEKBHsCLLhcZm/TOauVn9gikMwKl4kANcrfReZ+nCepVu0B
|
||||
u8MduvmyQt/ZTUi6CRQJ2erEQ8KkaHCUryLS2XqMcWEF2/gUnyry+xgJqIh1swvL
|
||||
xQ6pUhhzAHgp29RvH80gLM/13YWeb7+YLBfPaZ+GcC7ii24+SItYk9h/w7Yfb2ZL
|
||||
m6Mpbag4k8CRLb3JIkRHduwEB7ZGYlAl4grtl5KDGp/0Wst2wZCGcdBIjZ4hKpAp
|
||||
fmnmenZxAE5Rz9QbMWXcvab18ARPd3EeuygVgP1NVBSF7UV6cft9eRvbQFAACfQc
|
||||
E/dvh7vrbJ3wcLy3P1T0Gk1Wb0LUkoKfVqPwW5ZKaGmJNi/fYZFLOAMaWuKyxLD0
|
||||
cI0lmoK3nSayQBDGv39Arp8bTruCxQAiY5WxtYQWklVeK3LAOKmW4mRfp8l+qjhX
|
||||
5p0g969sWzGdwqFlCKn0XzekPEnnNi9E7LN5ghaHzXg=
|
||||
=HFm3
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,5 +0,0 @@
|
|||
Successfully uploaded longnow_0.9~focal-1.dsc to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~focal.orig.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~focal-1.debian.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~focal-1_source.buildinfo to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~focal-1_source.changes to ppa.launchpad.net for ppa.
|
Binary file not shown.
Binary file not shown.
|
@ -1,38 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 3.0 (quilt)
|
||||
Source: longnow
|
||||
Binary: longnow
|
||||
Architecture: all
|
||||
Version: 0.9~groovy-1
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Homepage: https://github.com/NunoSempere/longNowForMd
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
longnow deb utils optional arch=all
|
||||
Checksums-Sha1:
|
||||
b9304cb63a205a367dbe606cfd3832b1bfd4c679 2024 longnow_0.9~groovy.orig.tar.xz
|
||||
4c3449fd7965e234a6ca51ebebf81da1faa9d82b 2052 longnow_0.9~groovy-1.debian.tar.xz
|
||||
Checksums-Sha256:
|
||||
cd95955dd8d633318506a1b3bb0e7d6de8aa382749626283419d1bca1496cb7f 2024 longnow_0.9~groovy.orig.tar.xz
|
||||
21c3b3787f7741c9ce2e8b3a0bdcb4898d5e5df73a185f739fdb09b5266aac0e 2052 longnow_0.9~groovy-1.debian.tar.xz
|
||||
Files:
|
||||
552b819e55f7580bcfc3972651af6731 2024 longnow_0.9~groovy.orig.tar.xz
|
||||
0fb0db0596cc269166a6aebdc5164509 2052 longnow_0.9~groovy-1.debian.tar.xz
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS0MZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV8bTC/9dHVsqYX/gaDdeaPYVZX6r
|
||||
DXPaYCERVYnPKV5vQtfSNvnoISIS5UsfgVs0n9EltsslCDFbzOsCjTirIarfIqLI
|
||||
pMWQ7cmG4/JltELCf8QOOz2Zn4KSgSFeeB4clu+plvlMvUFsGMsky76dEJtZybsW
|
||||
2OzUKtNjcI8/lkl0ONvOJZvEpVuOwqZAlo8ida1zfUBtHH3t2hv1ynTSq3VPU9d/
|
||||
z/m584fkEsR8nz/MSaJ76BoTvYKl6J5+mU7kZrGhusbSrZB8J41kN5kZeeKPexOn
|
||||
8XbxOK8I0JQUNcFc+jdxvUON+HVyHqlwNeqc0hVS8/Bq7rn9nCzIiHR70aj0uWRf
|
||||
XaWz4YQUbv2Kdn2bAkphQl2b7/VMX0qLVza+ZIj25GJIUrHv6a+gT97OwAfDOQxK
|
||||
5KEKq9iP+U6UrdhxQNOaN4V9kbO8wvgd7gih0VQSJdxGugh6wMO8w0QU5Bk4jzsK
|
||||
qjXD3T0FDYrUp47X/hODo/JThVsTIOvBS8bIL6JhWow=
|
||||
=QiAk
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,46 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 1.8
|
||||
Date: Tue, 29 Jun 2021 18:33:04 +0200
|
||||
Source: longnow
|
||||
Architecture: source
|
||||
Version: 0.9~groovy-1
|
||||
Distribution: groovy
|
||||
Urgency: medium
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changed-By: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changes:
|
||||
longnow (0.9~groovy-1) groovy; urgency=medium
|
||||
.
|
||||
* Minor usability improvements
|
||||
Checksums-Sha1:
|
||||
f0e4b4dd3895e3581ed03207c750262918e20c71 1611 longnow_0.9~groovy-1.dsc
|
||||
b9304cb63a205a367dbe606cfd3832b1bfd4c679 2024 longnow_0.9~groovy.orig.tar.xz
|
||||
4c3449fd7965e234a6ca51ebebf81da1faa9d82b 2052 longnow_0.9~groovy-1.debian.tar.xz
|
||||
3ebce866e1c31113f412547d2b003001bf7fe1af 6160 longnow_0.9~groovy-1_source.buildinfo
|
||||
Checksums-Sha256:
|
||||
87cb8dcb363fbd0571c9ca592450bad139bafd354ede7db5cfc56ca2d537ca09 1611 longnow_0.9~groovy-1.dsc
|
||||
cd95955dd8d633318506a1b3bb0e7d6de8aa382749626283419d1bca1496cb7f 2024 longnow_0.9~groovy.orig.tar.xz
|
||||
21c3b3787f7741c9ce2e8b3a0bdcb4898d5e5df73a185f739fdb09b5266aac0e 2052 longnow_0.9~groovy-1.debian.tar.xz
|
||||
05183f953c51b9aab5cb74cad45b8a01717104e78c86276d7e2a14abd0ed3b95 6160 longnow_0.9~groovy-1_source.buildinfo
|
||||
Files:
|
||||
314419d5192df14e1417faf85fc28d68 1611 utils optional longnow_0.9~groovy-1.dsc
|
||||
552b819e55f7580bcfc3972651af6731 2024 utils optional longnow_0.9~groovy.orig.tar.xz
|
||||
0fb0db0596cc269166a6aebdc5164509 2052 utils optional longnow_0.9~groovy-1.debian.tar.xz
|
||||
3dad477ac1e762334e06056aa070d887 6160 utils optional longnow_0.9~groovy-1_source.buildinfo
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS0MZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV+7DC/4mqYQyREuQwS1s2uTJXD40
|
||||
gWpyPJMrw42aFm6lw7BVdhKyrJe4UnfXRt4jM7+sm8xRU3APwd/MihJyYKh0RPJZ
|
||||
SGoc7OVexNC+ZNl7z5UOqeeuxZW+p/pTwS3Jji8REbKefcIj+yjzznb8JWvUXSM4
|
||||
RcNj7epWqiDR1IiTcfLeQ7rAHrAf6MWnWtIIMW8Ae02hERDQPddZGfuB9XEmbID9
|
||||
8dkGQXafpvD54tnINQJjGLnCW5QsGrYpqNhXZtGUWIi47k8Z2AZQjHbsDah1giv6
|
||||
mM9Gi3/QmEpeN6a/jXd/P4XyiiEVaS8XODuVjXqnbE0CBpgZ00dpPa2BloAvdeWA
|
||||
NCkMztu6T+HI3uOWWZSkAqscD1Xo7uOghkOZAF8Bg1mCM0D/N5+S24MXMzfle0le
|
||||
DjYyJsI8087hmVEz+/GsJBifD+qJa97t+wbIZxGq+A6qRfHXCu81lTgaE1T340rD
|
||||
T55NnjuIzO5sVU30jZ0EaqeijyiA5UE65lEtT/45Ve8=
|
||||
=XpI7
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,5 +0,0 @@
|
|||
Successfully uploaded longnow_0.9~groovy-1.dsc to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~groovy.orig.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~groovy-1.debian.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~groovy-1_source.buildinfo to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~groovy-1_source.changes to ppa.launchpad.net for ppa.
|
Binary file not shown.
Binary file not shown.
|
@ -1,38 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 3.0 (quilt)
|
||||
Source: longnow
|
||||
Binary: longnow
|
||||
Architecture: all
|
||||
Version: 0.9~hirsute-1
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Homepage: https://github.com/NunoSempere/longNowForMd
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
longnow deb utils optional arch=all
|
||||
Checksums-Sha1:
|
||||
73c843257e155f651e481bbb724767fb38e4bd6d 2024 longnow_0.9~hirsute.orig.tar.xz
|
||||
fe75a3ca3f34afe4421c142c26d37ba11a413588 2056 longnow_0.9~hirsute-1.debian.tar.xz
|
||||
Checksums-Sha256:
|
||||
b9197464deb295e6a15245e1ebbf0a272290524f1e61aff1512f4ea28f3b332d 2024 longnow_0.9~hirsute.orig.tar.xz
|
||||
b488f39ee3626e5fee4a3fe91f65df2cef3dd6a2433bb9fda843cacab53a680e 2056 longnow_0.9~hirsute-1.debian.tar.xz
|
||||
Files:
|
||||
bd8cba7d0e134af04988b3d4adf825ae 2024 longnow_0.9~hirsute.orig.tar.xz
|
||||
ce4cdc35b2c17ba49da426c746347059 2056 longnow_0.9~hirsute-1.debian.tar.xz
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS0gZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kVx28DACe6WHYlqGAKdBdaGFzsp4B
|
||||
88KA+BhtpAEAD+c4AExYSjcCLUeRV711DEH6cEhzaBi92c4slO2M2fYMHWB3ELAQ
|
||||
4OUWLZotl5BGmyP6h1O11uBp9173gnYFZ+dKrEzMjHRXK4AfvO6HLnXmrvCig6cd
|
||||
HsOR4JQC+dTq/Mns8nI5gJKgB1+mRXFVZx2Rk5z2bqB/lH1bk/6F6MNTJ615Egse
|
||||
pd1hkmCmlgGtDhsFG2hMdPgBkTMzLaBf3cois44QDf2uCbK5crMsZQwjYpxMNzuN
|
||||
pUkw/5EjcwzTci8DD3glumDre5Us5jdE1lNRP4+cNejIjOpBz4Mmm6liCjLYEtPk
|
||||
OqzgE7xYjKc6JUVay4tNqKLBFd+ypAJ1INcOhDdzahaziL0NUu1vlOrtBZdUWhMa
|
||||
Mm3wkw018fFgx6rU47GueP03Hrsar0hFfxXMkJOjXEBPStiDttMyN8yYHn0AC22S
|
||||
v11cpTrhF9OXnYf6Cl2T+fUMGMikve9i7gzygHluyBY=
|
||||
=MGOa
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,46 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 1.8
|
||||
Date: Tue, 29 Jun 2021 18:33:09 +0200
|
||||
Source: longnow
|
||||
Architecture: source
|
||||
Version: 0.9~hirsute-1
|
||||
Distribution: hirsute
|
||||
Urgency: medium
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changed-By: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changes:
|
||||
longnow (0.9~hirsute-1) hirsute; urgency=medium
|
||||
.
|
||||
* Minor usability improvements
|
||||
Checksums-Sha1:
|
||||
345dae6747943c1eacaf667bfcc4be0abc8ba4e4 1618 longnow_0.9~hirsute-1.dsc
|
||||
73c843257e155f651e481bbb724767fb38e4bd6d 2024 longnow_0.9~hirsute.orig.tar.xz
|
||||
fe75a3ca3f34afe4421c142c26d37ba11a413588 2056 longnow_0.9~hirsute-1.debian.tar.xz
|
||||
d439d2fa4d04b92735e280a560eda26bb81df47b 6164 longnow_0.9~hirsute-1_source.buildinfo
|
||||
Checksums-Sha256:
|
||||
74db777fd63426f54b9282e54c9467357a040a3d61448b0f2562330f322ad161 1618 longnow_0.9~hirsute-1.dsc
|
||||
b9197464deb295e6a15245e1ebbf0a272290524f1e61aff1512f4ea28f3b332d 2024 longnow_0.9~hirsute.orig.tar.xz
|
||||
b488f39ee3626e5fee4a3fe91f65df2cef3dd6a2433bb9fda843cacab53a680e 2056 longnow_0.9~hirsute-1.debian.tar.xz
|
||||
5dd4cec98d906fb10f208aae61fb1c1d6da13efa739e07b30cbf0028063dfa6c 6164 longnow_0.9~hirsute-1_source.buildinfo
|
||||
Files:
|
||||
f0ecb7e11ea36969603b45dd61fb3a39 1618 utils optional longnow_0.9~hirsute-1.dsc
|
||||
bd8cba7d0e134af04988b3d4adf825ae 2024 utils optional longnow_0.9~hirsute.orig.tar.xz
|
||||
ce4cdc35b2c17ba49da426c746347059 2056 utils optional longnow_0.9~hirsute-1.debian.tar.xz
|
||||
fc701321a30529c5eef4c6b7c5901f82 6164 utils optional longnow_0.9~hirsute-1_source.buildinfo
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS0kZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kVyfWDACVpoovytpOMCa5zynSP2pN
|
||||
d16wVOn/dqeNRqVkHbQoNuznw8H2qtzk/1q2ib7VzP9FqHkCzgz+lZRPZn+7iBIo
|
||||
ekXUO5PHb5fXmYB4KZML1QHTd+I5k7985uNDaeOQ7Q/7XJc+NC/d0pL7Wk9PD6tH
|
||||
1KUXoYDxiIsasFN07e2knO4NHncc68p7IVADN82gu0CzwFyCWGuD+UR0kw9U67ga
|
||||
8pSMKuUC23TGP0QVMqe79vDt/dPc5O2tBYGR/LbyQ3XZon9CXgPVF+CYY2pq3GB7
|
||||
BxdNWYVmjLmxcQwE8MHFoTInmGpfuRWfG+qaUIQwb3dbCxBYmgA0M2DbiJ1qA5Vc
|
||||
5T5nWGWyY+DioaVwvMikk7gWuViPix5gs2ph7Yz3K7XO9iMhalw2y0Q4fGXwUaFr
|
||||
X9IGT4lSQxCcrfl3qwRCBm2JgUGVryylBHLrNuViAxwkKOYPyESlLu5RVKff9cPa
|
||||
LVbXCzGoSLjf9PoOAY1hufSZR3k1IQPq8fwiAXMHqVE=
|
||||
=HYU8
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,5 +0,0 @@
|
|||
Successfully uploaded longnow_0.9~hirsute-1.dsc to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~hirsute.orig.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~hirsute-1.debian.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~hirsute-1_source.buildinfo to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~hirsute-1_source.changes to ppa.launchpad.net for ppa.
|
Binary file not shown.
Binary file not shown.
|
@ -1,38 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 3.0 (quilt)
|
||||
Source: longnow
|
||||
Binary: longnow
|
||||
Architecture: all
|
||||
Version: 0.9~impish-1
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Homepage: https://github.com/NunoSempere/longNowForMd
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
longnow deb utils optional arch=all
|
||||
Checksums-Sha1:
|
||||
9cf617b20dc146b4426d217c92f577cda61770e2 2028 longnow_0.9~impish.orig.tar.xz
|
||||
629c4b4fdeaf52a6d579e5b665b22debd5d7b14c 2056 longnow_0.9~impish-1.debian.tar.xz
|
||||
Checksums-Sha256:
|
||||
cfd47cc6c889c94bb3ad8cbb0fab90aae262d27ba08f45b68be984f39958d0c2 2028 longnow_0.9~impish.orig.tar.xz
|
||||
390ab065222fbf974bbd4ad2a8f6a52dbabdaaeba5a5bc816caf3fe83286285d 2056 longnow_0.9~impish-1.debian.tar.xz
|
||||
Files:
|
||||
3e600455acd7d4022beb4707648e1432 2028 longnow_0.9~impish.orig.tar.xz
|
||||
90f4a1b205c730851b8a19ae2036f537 2056 longnow_0.9~impish-1.debian.tar.xz
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS00ZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV5tNC/0Woo11UP5o+XIeayW+MOg/
|
||||
UKZ6h8v6GYjbMkSQ1KR/rmlojjDmtNoW4JcQPegcGgTrFsFvu4w5LHXcNzNdypbc
|
||||
EtYRhnpX0urF2UJ1neg0UccwOKQiblD+jvD6xSg3QXhqDV4KFRnTCNiUZC0tf2da
|
||||
RWxzLOsZiff/k5+MUzxOCVKNYcyoPhiqdLw+wc6vcZAWkAqVwpuCWSp2/wtlCwZt
|
||||
J/sHRDw5nj++h3Jpir8IewNnSoPaR0n+9Dn12UrAp3MyobJR7oyGp4VtY+mlKqDD
|
||||
atlwhJAzb+N+9BqPZSoQ7FMhc6Zblcdt7GNsEmjxzKz+5INCiFAQ9rjJqFzBwFnX
|
||||
zRbDQdTNeGfYTRLZrD3eUW4d6e8YFgb1Fs941JbOjHa2DQhnZ+lXTnoETKtC+Eje
|
||||
SmyxDIfeFbLcaB8A+d7Eo7BQrpL4MsVIDIn5p5rs9HjxjLT8F4yFJYWf5kQN0+l+
|
||||
dH2NbkU4ul56y/dVbUoVugwp0IMtY0rx9dpKMrtjy7s=
|
||||
=Jk53
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,46 +0,0 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 1.8
|
||||
Date: Tue, 29 Jun 2021 18:33:15 +0200
|
||||
Source: longnow
|
||||
Architecture: source
|
||||
Version: 0.9~impish-1
|
||||
Distribution: impish
|
||||
Urgency: medium
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changed-By: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Changes:
|
||||
longnow (0.9~impish-1) impish; urgency=medium
|
||||
.
|
||||
* Minor usability improvements
|
||||
Checksums-Sha1:
|
||||
ec43b005d8bf7df1438ac645a73bfd3b44d87f5d 1611 longnow_0.9~impish-1.dsc
|
||||
9cf617b20dc146b4426d217c92f577cda61770e2 2028 longnow_0.9~impish.orig.tar.xz
|
||||
629c4b4fdeaf52a6d579e5b665b22debd5d7b14c 2056 longnow_0.9~impish-1.debian.tar.xz
|
||||
1946924a9a24a229df24a70a307a429c8d0a1539 6160 longnow_0.9~impish-1_source.buildinfo
|
||||
Checksums-Sha256:
|
||||
c12813f1edfa5398b3e32aa9a2f9f03563812fe02d9c06381609a0b0c98876f9 1611 longnow_0.9~impish-1.dsc
|
||||
cfd47cc6c889c94bb3ad8cbb0fab90aae262d27ba08f45b68be984f39958d0c2 2028 longnow_0.9~impish.orig.tar.xz
|
||||
390ab065222fbf974bbd4ad2a8f6a52dbabdaaeba5a5bc816caf3fe83286285d 2056 longnow_0.9~impish-1.debian.tar.xz
|
||||
418ae216cb9c88308811ad0c5be9f98b857b7caa04d75bf064183dcdf5f54ce5 6160 longnow_0.9~impish-1_source.buildinfo
|
||||
Files:
|
||||
3db24f97e95fe6995c02c36b7a017bcd 1611 utils optional longnow_0.9~impish-1.dsc
|
||||
3e600455acd7d4022beb4707648e1432 2028 utils optional longnow_0.9~impish.orig.tar.xz
|
||||
90f4a1b205c730851b8a19ae2036f537 2056 utils optional longnow_0.9~impish-1.debian.tar.xz
|
||||
64848591c0c41b26a0d07a22e3ba3168 6160 utils optional longnow_0.9~impish-1_source.buildinfo
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDbS04ZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV3INC/9z0pajPAq3N2+UKCxU5l9l
|
||||
x5355pNlJQvivH+LF0WALyXCoVSXrkrALpszBrwNFuFc/N6XLam+/azFlITB7krb
|
||||
ODVtHZ+tuXW4ukx87AmOVC96omnAH3R1NRNE1RMoWEvmIi5JFaycd0hcpC6nAN4t
|
||||
dBCjn41xnY63DxHv3kewPmjh8Xezi3BC9fJp6mQ5fQ4XWQTBKYTuUMjBIg65xb6/
|
||||
WoQEaCIJoKHPohUF7IyUpk4Wl9RUwn32lQs35Jr7lsxehnDyBdnlg92/xNRZS/Gf
|
||||
qJYkhv2XpWQ0dNLUNEX6XBI6d4qoYMaJb/6K98n1qPx2YRWzda5uFx+dguPm2vAK
|
||||
baSdTSPFzaS7VFIcPc445qBkutVnpllkSaDoX1szsunlo4kVx+A7nftILoJFUtFV
|
||||
09gZGv2BceVKMnel0PycettK2MDxNW8/pZoFEzg/6eNtrKf8W6eRYwjInD5HC408
|
||||
A/BdXRbdOall0KRYE6/G7o3mqSSXA/noP+qz+mHoeJM=
|
||||
=6pDc
|
||||
-----END PGP SIGNATURE-----
|
|
@ -1,5 +0,0 @@
|
|||
Successfully uploaded longnow_0.9~impish-1.dsc to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~impish.orig.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~impish-1.debian.tar.xz to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~impish-1_source.buildinfo to ppa.launchpad.net for ppa.
|
||||
Successfully uploaded longnow_0.9~impish-1_source.changes to ppa.launchpad.net for ppa.
|
Binary file not shown.
|
@ -20,15 +20,17 @@ function pushToArchive(){
|
|||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
input="$1"
|
||||
counter=1
|
||||
echo ""
|
||||
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsfile"
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsFile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
|
@ -39,38 +41,38 @@ function pushToArchive(){
|
|||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
@ -85,28 +87,28 @@ function addArchiveLinksToFile(){
|
|||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
5
debian/longnow-1.1~series/longnow-1.1~focal/debian/changelog
vendored
Normal file
5
debian/longnow-1.1~series/longnow-1.1~focal/debian/changelog
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
longnow (1.1~focal-1) focal; urgency=medium
|
||||
|
||||
* Minor tweak.
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Wed, 30 Jun 2021 22:52:33 +0200
|
1
debian/longnow-1.1~series/longnow-1.1~focal/debian/files
vendored
Normal file
1
debian/longnow-1.1~series/longnow-1.1~focal/debian/files
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
longnow_1.1~focal-1_source.buildinfo utils optional
|
|
@ -20,15 +20,17 @@ function pushToArchive(){
|
|||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
input="$1"
|
||||
counter=1
|
||||
echo ""
|
||||
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsfile"
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsFile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
|
@ -39,38 +41,38 @@ function pushToArchive(){
|
|||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
@ -85,28 +87,28 @@ function addArchiveLinksToFile(){
|
|||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
5
debian/longnow-1.1~series/longnow-1.1~groovy/debian/changelog
vendored
Normal file
5
debian/longnow-1.1~series/longnow-1.1~groovy/debian/changelog
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
longnow (1.1~groovy-1) groovy; urgency=medium
|
||||
|
||||
* Minor tweak.
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Wed, 30 Jun 2021 22:52:46 +0200
|
1
debian/longnow-1.1~series/longnow-1.1~groovy/debian/files
vendored
Normal file
1
debian/longnow-1.1~series/longnow-1.1~groovy/debian/files
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
longnow_1.1~groovy-1_source.buildinfo utils optional
|
|
@ -20,15 +20,17 @@ function pushToArchive(){
|
|||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
input="$1"
|
||||
counter=1
|
||||
echo ""
|
||||
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsfile"
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsFile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
|
@ -39,38 +41,38 @@ function pushToArchive(){
|
|||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
@ -85,28 +87,28 @@ function addArchiveLinksToFile(){
|
|||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
5
debian/longnow-1.1~series/longnow-1.1~hirsute/debian/changelog
vendored
Normal file
5
debian/longnow-1.1~series/longnow-1.1~hirsute/debian/changelog
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
longnow (1.1~hirsute-1) hirsute; urgency=medium
|
||||
|
||||
* Minor tweak.
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Wed, 30 Jun 2021 22:52:52 +0200
|
1
debian/longnow-1.1~series/longnow-1.1~hirsute/debian/files
vendored
Normal file
1
debian/longnow-1.1~series/longnow-1.1~hirsute/debian/files
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
longnow_1.1~hirsute-1_source.buildinfo utils optional
|
|
@ -20,15 +20,17 @@ function pushToArchive(){
|
|||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
input="$1"
|
||||
counter=1
|
||||
echo ""
|
||||
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsfile"
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsFile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
|
@ -39,38 +41,38 @@ function pushToArchive(){
|
|||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
@ -85,28 +87,28 @@ function addArchiveLinksToFile(){
|
|||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
5
debian/longnow-1.1~series/longnow-1.1~impish/debian/changelog
vendored
Normal file
5
debian/longnow-1.1~series/longnow-1.1~impish/debian/changelog
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
longnow (1.1~impish-1) impish; urgency=medium
|
||||
|
||||
* Minor tweak.
|
||||
|
||||
-- Nuno Sempere <nuno.semperelh@gmail.com> Wed, 30 Jun 2021 22:52:57 +0200
|
1
debian/longnow-1.1~series/longnow-1.1~impish/debian/files
vendored
Normal file
1
debian/longnow-1.1~series/longnow-1.1~impish/debian/files
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
longnow_1.1~impish-1_source.buildinfo utils optional
|
134
debian/longnow-1.1~series/longnow-1.1~impish/longnow
vendored
Executable file
134
debian/longnow-1.1~series/longnow-1.1~impish/longnow
vendored
Executable file
|
@ -0,0 +1,134 @@
|
|||
#!/bin/bash
|
||||
|
||||
function getMdLinks(){ # Use: Takes a markdown file file.md, extracts all links, finds the unique ones and saves them to file.md.links
|
||||
linksFile="$1.links"
|
||||
linksFile2="$1.links2"
|
||||
echo ""
|
||||
echo "Extracting links..."
|
||||
rm "$1.links" -f
|
||||
grep -Eoi '\]\((.*)\)' $1 | grep -Eo '(http|https)://[^)]+' >> "$1.links"
|
||||
## sed -i 's/www.wikiwand.com\/en/en.wikipedia.org\/wiki/g' $1
|
||||
awk '!seen[$0]++' "$linksFile" > "$linksFile2" && mv "$linksFile2" "$linksFile"
|
||||
echo "Done."
|
||||
numLinesLinkFile=$(wc -l "$linksFile" | awk '{ print $1 }')
|
||||
totalTimeInMinutes=$(echo "scale=0; ($numLinesLinkFile*7.5 + 60*$numLinesLinkFile/15)/60" | bc)
|
||||
echo "Expected to take $totalTimeInMinutes mins."
|
||||
}
|
||||
|
||||
function pushToArchive(){
|
||||
# Use: Takes a txt file with one link on each line and pushes all the links to the internet archive. Saves those links to a textfile
|
||||
# References:
|
||||
# https://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
|
||||
# https://github.com/oduwsdl/archivenow
|
||||
# For the double underscore, see: https://stackoverflow.com/questions/13797087/bash-why-double-underline-for-private-functions-why-for-bash-complet/15181999
|
||||
echo "Pushing to archive.org..."
|
||||
echo ""
|
||||
|
||||
input="$1"
|
||||
counter=1
|
||||
archivedLinksFile="$1.archived"
|
||||
errorsFile="$1.errors"
|
||||
|
||||
## rm -f "$archivedLinksFile"
|
||||
rm -f "$errorsFile"
|
||||
touch "$archivedLinksFile"
|
||||
touch "$errorsFile"
|
||||
|
||||
## How to deal with errors that arise
|
||||
echo "If this file contains errors, you can deal with them as follows:" >> "$errorsFile"
|
||||
echo "- Do another pass with \$ longnow yourfile.md. If you don't delete yourfile.md.links.archived, past archive links are remembered, and only the links which are not there are sent again" >> "$errorsFile"
|
||||
echo "- Input the offending links manually to https://archive.org/, add the results to the yourfile.md.links.archived file manually, and then do another pass with \$ longnow yourfile.md" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
|
||||
## Main body
|
||||
while IFS= read -r line
|
||||
do
|
||||
wait
|
||||
if [ $(($counter % 15)) -eq 0 ]; then
|
||||
printf "Archive.org doesn't accept more than 15 links per min; sleeping for 1min...\n\n"
|
||||
sleep 1m
|
||||
fi
|
||||
echo "Url: $line"
|
||||
urlAlreadyContained=$( ( grep "$line$" "$archivedLinksFile"; grep "$line/$" "$archivedLinksFile" ) | tail -1 )
|
||||
if [ "$urlAlreadyContained" == "" ]; then
|
||||
archiveURL=$(archivenow --ia $line)
|
||||
if [[ "$archiveURL" == "Error"* ]]; then
|
||||
echo "$line" >> "$errorsFile"
|
||||
echo "$archiveURL" >> "$errorsFile"
|
||||
echo "" >> "$errorsFile"
|
||||
echo "There was an error. See $errorsFile for how to deal with it."
|
||||
else
|
||||
echo "$archiveURL" >> "$archivedLinksFile"
|
||||
fi
|
||||
counter=$((counter+1))
|
||||
numSecondsSleep=$((5+ ($RANDOM%15)))
|
||||
else
|
||||
archiveURL="$urlAlreadyContained"
|
||||
numSecondsSleep=0
|
||||
fi
|
||||
echo $archiveURL
|
||||
echo "Sleeping for $numSecondsSleep seconds..."
|
||||
sleep $numSecondsSleep
|
||||
echo ""
|
||||
done < "$input"
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function addArchiveLinksToFile(){
|
||||
|
||||
originalFile="$1"
|
||||
originalFileTemp="$originalFile.temp"
|
||||
linksFile="$1.links"
|
||||
archivedLinksFile="$1.links.archived"
|
||||
errorsFile="$1.links.errors"
|
||||
longNowFile="$1.longnow"
|
||||
|
||||
echo "Creating longnow file @ $longNowFile..."
|
||||
|
||||
rm -f "$longNowFile"
|
||||
touch "$longNowFile"
|
||||
cp "$originalFile" "$originalFileTemp"
|
||||
|
||||
while IFS= read -r url
|
||||
do
|
||||
wait
|
||||
archivedUrl=$( ( grep "$url$" "$archivedLinksFile"; grep "$url/$" "$archivedLinksFile") | tail -1)
|
||||
if [ "$archivedUrl" != "" ]; then
|
||||
## echo "Url: $url"
|
||||
## echo "ArchivedUrl: $archivedUrl"
|
||||
urlForSed="${url//\//\\/}"
|
||||
archiveUrlForSed="${archivedUrl//\//\\/}"
|
||||
sed -i "s/$urlForSed)/$urlForSed) ([a]($archiveUrlForSed))/g" "$1"
|
||||
##else
|
||||
##echo "There was an error for $url; see the $errorsFile"
|
||||
fi
|
||||
done < "$linksFile"
|
||||
mv "$originalFile" "$longNowFile"
|
||||
mv "$originalFileTemp" "$originalFile"
|
||||
|
||||
echo "Done."
|
||||
|
||||
}
|
||||
|
||||
function longnow(){
|
||||
doesArchiveNowExist=$(whereis "archivenow")
|
||||
if [ "$doesArchiveNowExist" == "archivenow:" ]
|
||||
then
|
||||
echo "Required archivenow utility not found in path."
|
||||
echo "Install with \$ pip install archivenow"
|
||||
echo "(resp. \$ pip3 install archivenow)"
|
||||
echo "Or follow instructions on https://github.com/oduwsdl/archivenow"
|
||||
else
|
||||
getMdLinks $1
|
||||
pushToArchive $1.links
|
||||
addArchiveLinksToFile $1
|
||||
numLinesErrorFile=$(wc -l "$1.links.errors" | awk '{ print $1 }')
|
||||
if [ "$numLinesErrorFile" -gt 4 ] ;then
|
||||
echo "It seems that there are errors. To view and deal with them, see the $1.links.errors file"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
longnow "$1" ## don't copy this line into your .bashrc file
|
BIN
debian/longnow-1.1~series/longnow_1.1~focal-1.debian.tar.xz
vendored
Normal file
BIN
debian/longnow-1.1~series/longnow_1.1~focal-1.debian.tar.xz
vendored
Normal file
Binary file not shown.
38
debian/longnow-1.1~series/longnow_1.1~focal-1.dsc
vendored
Normal file
38
debian/longnow-1.1~series/longnow_1.1~focal-1.dsc
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
Format: 3.0 (quilt)
|
||||
Source: longnow
|
||||
Binary: longnow
|
||||
Architecture: all
|
||||
Version: 1.1~focal-1
|
||||
Maintainer: Nuno Sempere <nuno.semperelh@gmail.com>
|
||||
Homepage: https://github.com/NunoSempere/longNowForMd
|
||||
Standards-Version: 4.4.1
|
||||
Build-Depends: debhelper-compat (= 12)
|
||||
Package-List:
|
||||
longnow deb utils optional arch=all
|
||||
Checksums-Sha1:
|
||||
16a657ebffd6ccdbacd199da80606c8699490d52 2000 longnow_1.1~focal.orig.tar.xz
|
||||
50984668250cf384936d45666b4c6a7808006ce7 2044 longnow_1.1~focal-1.debian.tar.xz
|
||||
Checksums-Sha256:
|
||||
7fe91dd5fabdb63e30da0c0737aa342cb04bdf3db64fb83413870f5084ce16d8 2000 longnow_1.1~focal.orig.tar.xz
|
||||
a57b2d62da9a8337335c913d9ae3091bc78ef03d65bdf0a41382ecf73cf8779a 2044 longnow_1.1~focal-1.debian.tar.xz
|
||||
Files:
|
||||
f3b26c6a89f5153bca2c072a95b9fa67 2000 longnow_1.1~focal.orig.tar.xz
|
||||
c1eee003a112dcd1c47f780f269849dd 2044 longnow_1.1~focal-1.debian.tar.xz
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQHNBAEBCgA3FiEEJgMJ0m3ydsnStpbJvUQaV89PZFcFAmDc2ZQZHG51bm8uc2Vt
|
||||
cGVyZWxoQGdtYWlsLmNvbQAKCRC9RBpXz09kV3PzC/9ZHGu6WjELZTPoaUGGHPoq
|
||||
JMIRG584EgzLAsRPrPaONzjQufABFzEeyoYje5IcjHSjp5SEq0KbtInAqpvYA2Td
|
||||
JvyFL3PT76GrKads1TWGSH6YOivZfKUAQfyR8U8FujsCEX9uq48RwLVUYY0XQZ+1
|
||||
IW/mGvrUS9kF7rqTKeHfu98+g0Z5QS4SXoHOqCQ92I84woSyx3f8cLZ4V08qwChY
|
||||
TrA7c0SWNONG0OFXGT9z4jH1iC3m9sBU80wHH72TE15pFCl1OP+6VlvAcX7rNV4S
|
||||
9I6IjHkSg7hkNA1GKgFEBPKm3Ws3R571S9g8wsWxz//0KnVCUhhQRsjyNs3aXa4R
|
||||
3pyPU3P/yDfet9XI9NU4BmUzzoOqhE5I+OTSXQA6S7798sjke1aSW2LzMZ8BCBLD
|
||||