[Pkg-haskell-commits] darcs: tools: Officialize downloading via http in pkg-haskell-checkout.

Louis Bettens louis at bettens.info
Sat Jul 27 08:52:41 UTC 2013


Sat Jul 27 08:51:56 UTC 2013  Louis Bettens <louis at bettens.info>
  * Officialize downloading via http in pkg-haskell-checkout.
  This is based on my experience as someone who is not part of the team but wants
  to try out debianizations.

    M ./pkg-haskell-checkout -2 +37

Sat Jul 27 08:51:56 UTC 2013  Louis Bettens <louis at bettens.info>
  * Officialize downloading via http in pkg-haskell-checkout.
  This is based on my experience as someone who is not part of the team but wants
  to try out debianizations.
diff -rN -u old-tools/pkg-haskell-checkout new-tools/pkg-haskell-checkout
--- old-tools/pkg-haskell-checkout	2013-07-27 08:52:20.834043572 +0000
+++ new-tools/pkg-haskell-checkout	2013-07-27 08:52:20.930042286 +0000
@@ -1,6 +1,7 @@
 #!/bin/sh
 # Copyright (c) 2009 Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
 #               2009 Joachim Breitner <nomeata at debian.org>
+#               2013 Louis Bettens <louis at bettens.info>
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +26,43 @@
 
 set -e
 
+usage () {
+    cat << END
+Usage: $0 [--http] PACKAGE ...
+
+This script downloads the given packages and their debianization in the
+current directory.
+
+if --http is present, downloads the <package>/debian directory over http
+instead of ssh. This works if you don't have ssh access to the Alioth server,
+but http gives only a read-only access.
+
+See http://wiki.debian.org/Alioth/SSH for information on ssh access.
+
+If you want to reconfigure a debian directory already downloaded via http to
+permit pushing via ssh, you can use:
+darcs push --set-default darcs.debian.org:/darcs/pkg-haskell/<package>
+END
+}
+
+darcs_get () {
+    if $USE_HTTP
+    then darcs get http://darcs.debian.org/$1 $2
+    else darcs get darcs.debian.org:/darcs/$1 $2
+    fi
+}
+
+USE_HTTP=false
 until [ -z "$1" ]
 do
     case "$1" in
+        --help)
+            usage
+            exit 0
+            ;;
+        --http)
+            USE_HTTP=true
+            ;;
         *)
             PACKAGES="$PACKAGES $1"
             ;;
@@ -37,7 +72,7 @@
 
 if [ -z "$PACKAGES" ]
 then 
-   echo "Usage: $0 [PACKAGE ...]"
+   usage
    exit 1
 fi
 
@@ -49,7 +84,7 @@
       exit 1
     fi
 
-    darcs get darcs.debian.org:/darcs/pkg-haskell/$PACKAGE $PACKAGE-debian
+    darcs_get pkg-haskell/$PACKAGE $PACKAGE-debian
 
     if [ ! -e $PACKAGE-debian/control -o ! -e $PACKAGE-debian/changelog ]
     then




More information about the Pkg-haskell-commits mailing list