aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-06-22 20:10:23 +0200
committerGuido Günther <agx@sigxcpu.org>2017-06-22 20:10:23 +0200
commit0b4a348a53fccf792f95619cc966dbf82924bb1a (patch)
tree15ad0bd63c58460c9d7d0037e098193121a6d4af
parent50e277d8795644748630829d9177670ed88cda27 (diff)
imort-dsc: Allow for shorter apt: pseudo URLs
instead of the apt:/// scheme.
-rw-r--r--docs/chapters/special.sgml2
-rw-r--r--docs/manpages/gbp-import-dsc.sgml4
-rw-r--r--gbp/scripts/import_dsc.py6
3 files changed, 8 insertions, 4 deletions
diff --git a/docs/chapters/special.sgml b/docs/chapters/special.sgml
index 5000c1a..fd79f68 100644
--- a/docs/chapters/special.sgml
+++ b/docs/chapters/special.sgml
@@ -142,7 +142,7 @@ EOF
Whenever you need to work on an arbitrary &debian; package, you can check it
right into &git; with one command:
<programlisting>
- &gbp-import-dsc apt:///<filename>package</filename>
+ &gbp-import-dsc apt:<filename>package</filename>
cd <filename>package</filename>
&gitcmd; branch debian
</programlisting>
diff --git a/docs/manpages/gbp-import-dsc.sgml b/docs/manpages/gbp-import-dsc.sgml
index 431d21e..4d9a8d4 100644
--- a/docs/manpages/gbp-import-dsc.sgml
+++ b/docs/manpages/gbp-import-dsc.sgml
@@ -70,6 +70,8 @@
scheme <replaceable>apt:///</replaceable> which uses &apt-get;
(and therefore needs <replaceable>deb-src</replaceable>
entries in your <filename>/etc/apt/sources.list</filename>).
+ The later can be abbreviated by using the pseudo URL
+ <replaceable>apt:</replaceable>.
</para>
</refsect1>
<refsect1>
@@ -259,7 +261,7 @@
source</command> from unstable:
</para>
<screen>
- &gbp-import-dsc; apt:///hello/sid
+ &gbp-import-dsc; apt:hello/sid
</screen>
<para>
Import a source package in the local file system:
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index add9560..4a4b658 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -310,6 +310,8 @@ def is_download(pkg):
(True, 'apackage/sid')
>>> is_download("apt://apackage/sid")
(True, 'apackage/sid')
+ >>> is_download("apt:apackage/sid")
+ (True, 'apackage/sid')
>>> is_download("apt_1.0_amd64.dsc")
(False, 'apt_1.0_amd64.dsc')
>>> is_download("file:///foo/apackage.dsc")
@@ -317,8 +319,8 @@ def is_download(pkg):
"""
if pkg.startswith('file://'):
return (False, pkg[len('file://'):])
- elif pkg.startswith('apt://'):
- return (True, pkg[len('apt://'):].lstrip('/'))
+ elif pkg.startswith('apt:'):
+ return (True, re.match(r'apt:([/]{2,3})?(?P<pkg>.*)', pkg).group('pkg'))
elif re.match("[a-z]{1,5}://", pkg):
return (True, pkg)
return (False, pkg)