[augeas-devel] [PATCH] Lens for Debian's dput files
David Lutterkort
dlutter at redhat.com
Thu Jul 17 21:59:03 UTC 2008
3 files changed, 182 insertions(+)
AUTHORS | 1
lenses/dput.aug | 63 +++++++++++++++++++++++
lenses/tests/test_dput.aug | 118 ++++++++++++++++++++++++++++++++++++++++++++
# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1216331929 25200
# Node ID 4a4b523f6c478192d6371dacf3e8f0e555dadae3
# Parent 8dba2bfc0afa71c06b4ca84fb3ee9a7de8a9cc70
Lens for Debian's dput files
Contributed by Raphael Pinson
diff -r 8dba2bfc0afa -r 4a4b523f6c47 AUTHORS
--- a/AUTHORS Thu Jul 17 11:11:28 2008 -0700
+++ b/AUTHORS Thu Jul 17 14:58:49 2008 -0700
@@ -7,4 +7,5 @@
Harald Hoyer <harald at redhat.com>
Jim Meyering <meyering at redhat.com>
Alan Pevec <apevec at redhat.com>
+ Raphael Pinson <raphink at gmail.com>
Dean Wilson <dwilson at blueowl.it>
diff -r 8dba2bfc0afa -r 4a4b523f6c47 lenses/dput.aug
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lenses/dput.aug Thu Jul 17 14:58:49 2008 -0700
@@ -0,0 +1,63 @@
+(* Dput module for Augeas *)
+(* Author: Raphael Pinson <raphink at gmail.com> *)
+(* *)
+(* Status: most settings supported *)
+
+
+module Dput =
+ autoload xfm
+
+
+ (* Define useful shortcuts *)
+
+ let eol = Util.del_str "\n"
+ let del_to_eol = del /[^\n]*/ ""
+ let value_sep = del /[ \t]*=[ \t]*/ "="
+ let value_to_eol = store /([^ \t\n][^\n]*)?/
+
+
+ (* Define kw_arg function *)
+
+ let kw_arg (kw:string) = [ key kw . value_sep . value_to_eol . eol ]
+
+
+ (* Define comment and empty strings *)
+
+ let comment = [ label "comment" . del /#[ \t]*/ "#" . store /([^ \t\n][^\n]*)?/ . eol ]
+ let empty = [ del /[ \t]*/ "" . eol ]
+
+
+ (* Define record *)
+
+ let target = Util.del_str "[" . store /[^]= ]+/ . Util.del_str "]". eol
+
+ let settings = kw_arg "allow_non-us_software"
+ | kw_arg "allow_unsigned_uploads"
+ | kw_arg "check_version"
+ | kw_arg "default_host_main"
+ | kw_arg "default_host_non-us"
+ | kw_arg "fqdn"
+ | kw_arg "hash"
+ | kw_arg "incoming"
+ | kw_arg "login"
+ | kw_arg "method"
+ | kw_arg "passive_ftp"
+ | kw_arg "post_upload_command"
+ | kw_arg "pre_upload_command"
+ | kw_arg "run_dinstall"
+ | kw_arg "run_lintian"
+ | kw_arg "scp_compress"
+
+
+ let record = [ label "target" . target . settings* ]
+
+
+ (* Define lens *)
+
+ let lns = ( comment | record | empty )*
+
+ let filter = (incl "/etc/dput.cf")
+ . (incl "~/.dput.cf")
+ . Util.stdexcl
+
+ let xfm = transform lns filter
diff -r 8dba2bfc0afa -r 4a4b523f6c47 lenses/tests/test_dput.aug
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lenses/tests/test_dput.aug Thu Jul 17 14:58:49 2008 -0700
@@ -0,0 +1,118 @@
+module Test_dput =
+
+ let conf = "# Example dput.cf that defines the host that can be used
+# with dput for uploading.
+
+[DEFAULT]
+login = username
+method = ftp
+hash = md5
+allow_unsigned_uploads = 0
+run_lintian = 0
+run_dinstall = 0
+check_version = 0
+scp_compress = 0
+post_upload_command =
+pre_upload_command =
+passive_ftp = 1
+default_host_non-us =
+default_host_main = hebex
+
+[hebex]
+fqdn = condor.infra.s1.p.fti.net
+login = anonymous
+method = ftp
+incoming = /incoming/hebex
+passive_ftp = 0
+
+[dop/desktop]
+fqdn = condor.infra.s1.p.fti.net
+login = anonymous
+method = ftp
+incoming = /incoming/dop/desktop
+passive_ftp = 0
+
+[jp-non-us]
+fqdn = hp.debian.or.jp
+incoming = /pub/Incoming/upload-non-US
+login = anonymous
+
+# DISABLED due to being repaired currently
+#[erlangen]
+#fqdn = ftp.uni-erlangen.de
+#incoming = /public/pub/Linux/debian/UploadQueue/
+#login = anonymous
+
+[ftp-master]
+fqdn = ftp-master.debian.org
+incoming = /pub/UploadQueue/
+login = anonymous
+post_upload_command = /usr/bin/mini-dinstall --batch
+# And if you want to override one of the defaults, add it here.
+# # For example, comment out the next line
+# # login = another_username
+# # post_upload_command = /path/to/some/script
+# # pre_upload_command = /path/to/some/script
+#
+"
+
+ test Dput.lns get conf =
+ { "comment" = "Example dput.cf that defines the host that can be used" }
+ { "comment" = "with dput for uploading." }
+ {}
+ { "target" = "DEFAULT"
+ { "login" = "username" }
+ { "method" = "ftp" }
+ { "hash" = "md5" }
+ { "allow_unsigned_uploads" = "0" }
+ { "run_lintian" = "0" }
+ { "run_dinstall" = "0" }
+ { "check_version" = "0" }
+ { "scp_compress" = "0" }
+ { "post_upload_command" = "" }
+ { "pre_upload_command" = "" }
+ { "passive_ftp" = "1" }
+ { "default_host_non-us" = "" }
+ { "default_host_main" = "hebex" }
+ }
+ {}
+ { "target" = "hebex"
+ { "fqdn" = "condor.infra.s1.p.fti.net" }
+ { "login" = "anonymous" }
+ { "method" = "ftp" }
+ { "incoming" = "/incoming/hebex" }
+ { "passive_ftp" = "0" }
+ }
+ {}
+ { "target" = "dop/desktop"
+ { "fqdn" = "condor.infra.s1.p.fti.net" }
+ { "login" = "anonymous" }
+ { "method" = "ftp" }
+ { "incoming" = "/incoming/dop/desktop" }
+ { "passive_ftp" = "0" }
+ }
+ {}
+ { "target" = "jp-non-us"
+ { "fqdn" = "hp.debian.or.jp" }
+ { "incoming" = "/pub/Incoming/upload-non-US" }
+ { "login" = "anonymous" }
+ }
+ {}
+ { "comment" = "DISABLED due to being repaired currently" }
+ { "comment" = "[erlangen]" }
+ { "comment" = "fqdn = ftp.uni-erlangen.de" }
+ { "comment" = "incoming = /public/pub/Linux/debian/UploadQueue/" }
+ { "comment" = "login = anonymous" }
+ {}
+ { "target" = "ftp-master"
+ { "fqdn" = "ftp-master.debian.org" }
+ { "incoming" = "/pub/UploadQueue/" }
+ { "login" = "anonymous" }
+ { "post_upload_command" = "/usr/bin/mini-dinstall --batch" }
+ }
+ { "comment" = "And if you want to override one of the defaults, add it here." }
+ { "comment" = "# For example, comment out the next line" }
+ { "comment" = "# login = another_username" }
+ { "comment" = "# post_upload_command = /path/to/some/script" }
+ { "comment" = "# pre_upload_command = /path/to/some/script" }
+ { "comment" = "" }
More information about the augeas-devel
mailing list