Skip to content

Instantly share code, notes, and snippets.

@somian
Last active September 10, 2015 10:55
Show Gist options
  • Save somian/521e20d86092eb061beb to your computer and use it in GitHub Desktop.
Save somian/521e20d86092eb061beb to your computer and use it in GitHub Desktop.
Seeking source pks for Perl mods
**SAMPLE DATA**
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31-1.dsc' libio-pager-perl_0.31-1.dsc 2172 MD5Sum:cc0a1cf20db9392ee2aff6b1906a022e
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31.orig.tar.gz' libio-pager-perl_0.31.orig.tar.gz 15406 MD5Sum:727579dccdda96cfcadbba9def8af59f
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31-1.debian.tar.xz' libio-pager-perl_0.31-1.debian.tar.xz 1556 MD5Sum:b493791b1c60db8d1715be81baaf8484
**Update**
apt-cache -n search 'lib(io|path)-?.*-perl' |
perl -anF'\s-\s' -e 's/^perl($|\S+)//g for @F; printf qq{$F[0]\n} if $F[0]=~/\S/' \
| sudo xargs apt-get --target-release unstable --download-only --print-uris source \
| perl -MText::ParseWords -ne '
if (/\.orig\.tar.[[:alnum:]]{2,}/) {printf qq(\n %s),$_ for (quotewords(q/\s+/,0,$_))}' \
| grep '[fh]tt*p://' |xargs --max-args 1 wget
# **WORKS**
#!/bin/sh
apt-cache -n search 'lib(io|path|file)-.*-perl' |
perl -anF'\s-\s' -e 's/^perl($|\S+)//g for @F; printf qq{$F[0]\n}' |
xargs apt-get --target-release unstable --download-only --print-uris source
# output shown (in separate gist file)
@somian
Copy link
Author

somian commented Sep 10, 2015

Update
This works and is kind of cool (in a nearly lukewarm way of course)

apt-cache -n search 'lib(io|path)-?.*-perl' |
perl -anF'\s-\s' -e 's/^perl($|\S+)//g for @F; printf qq{$F[0]\n} if $F[0]=~/\S/' \
| sudo xargs apt-get --target-release unstable --download-only --print-uris source \
| perl -MText::ParseWords -ne '
if (/\.orig\.tar.[[:alnum:]]{2,}/) {printf qq(\n %s),$_ for (quotewords(q/\s+/,0,$_))}' \
| grep '[fh]tt*p://' |xargs --max-args 1 wget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment