Created
March 22, 2012 18:46
-
-
Save dex4er/2161618 to your computer and use it in GitHub Desktop.
cpan-import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpan-import-all.sh http://cpan.metacpan.org/authors/id/D/DE/DEXTER/Symbol-Util-0.0203.tar.gz --sign-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
url="$1" | |
shift | |
dir="${url%/*}" | |
pkg="${url##*/}" | |
pkg="${pkg%%-[0-9]*}" | |
GET $dir | \ | |
grep $pkg-.*tar.gz | \ | |
sed 's/.*">//; s/<.*//' | \ | |
while read f; do | |
cpan-import.sh $dir/$f "$@" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
url="$1" | |
shift | |
f="${url##*/}" | |
p="${f%%-[0-9]*}" | |
v="${f%%.tar.gz}" | |
v="${v##*-}" | |
wget -O ../$f $url | |
date=`HEAD $url | grep ^Last-Modified: | sed 's/.*: //'` | |
export GIT_AUTHOR_DATE="$date" | |
export GIT_COMMITER_DATE="$date" | |
if ! git show-ref refs/heads/cpan; then | |
git checkout --orphan cpan | |
git rm -rf . | |
git commit --allow-empty -m 'Initial cpan branch.' | |
git checkout -f master | |
fi | |
git-import-cpan \ | |
--upstream-version=$v \ | |
--no-merge \ | |
--upstream-branch=cpan \ | |
--upstream-tag='cpan/%(version)s' \ | |
--import-msg='Imported CPAN version %(version)s' \ | |
--pristine-tar ../$f \ | |
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- git-import-orig 2011-08-11 00:03:10.000000000 +0200 | |
+++ git-import-cpan 2012-03-22 22:43:28.000000000 +0100 | |
@@ -96,7 +96,7 @@ | |
if os.path.isdir(archive): | |
return None | |
ext = os.path.splitext(archive)[1] | |
- link = "../%s_%s.orig.tar%s" % (pkg, version, ext) | |
+ link = "../%s-%s.tar%s" % (pkg, version, ext) | |
if os.path.basename(archive) != os.path.basename(link): | |
try: | |
if not is_link_target(archive, link): | |
@@ -130,7 +130,7 @@ | |
sourcepackage = cp['Source'] | |
except NoChangelogError: | |
if options.interactive: | |
- sourcepackage = ask_package_name(guessed_package) | |
+ sourcepackage = guessed_package | |
else: | |
if guessed_package: | |
sourcepackage = guessed_package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment