diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-07-07 14:43:15 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-07-07 14:43:15 -0700 |
commit | aa42717ba0a6ee114b79fd8a62c00c974072c024 (patch) | |
tree | 198612f760af285908e3e5e0e16fd6569d106618 /templates/system | |
parent | 9e1fe74bdcd68ce3f39afcacde91ef5bc14470f9 (diff) | |
download | vyatta-cfg-system-aa42717ba0a6ee114b79fd8a62c00c974072c024.tar.gz vyatta-cfg-system-aa42717ba0a6ee114b79fd8a62c00c974072c024.zip |
Fix for bug http://bugzilla.vyatta.com/show_bug.cgi?id=2807
Diffstat (limited to 'templates/system')
4 files changed, 29 insertions, 6 deletions
diff --git a/templates/system/package/repository/node.def b/templates/system/package/repository/node.def index 8d753918..9c7697f8 100644 --- a/templates/system/package/repository/node.def +++ b/templates/system/package/repository/node.def @@ -2,15 +2,22 @@ tag: type: txt -help: Set name of a debian archive +help: Set the name of a debian archive commit:expression: $VAR(./url/) != ""; "Must configure the repository URL" commit:expression: $VAR(./distribution/) != ""; "Must configure the repository distribution" commit:expression: $VAR(./components/) != ""; "Must configure the repository components" -update: sudo sh -c "touch /etc/apt/sources.list && \ -sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list && \ -echo \"deb $VAR(url/@)/ $VAR(distribution/@) $VAR(components/@) # $VAR(@) #\" >> /etc/apt/sources.list" +update: sudo bash -c "set -x; touch /etc/apt/sources.list && \ + sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list && \ + echo \"deb $VAR(url/@) $VAR(distribution/@) $VAR(components/@) # $VAR(@) #\" >> /tmp/$$-sources.list && \ + if [ $VAR(password/@) ] || [ $VAR(username/@) ]; \ + then \ + sed -i "s!://.*@!://!" /tmp/$$-sources.list; \ + sed -i "s!://!://$VAR(username/@):$VAR(password/@)@!" /tmp/$$-sources.list; \ + fi && \ + cat /tmp/$$-sources.list>>/etc/apt/sources.list ; \ + rm -f /tmp/$$-sources.list" delete: sudo sh -c "touch /etc/apt/sources.list && \ sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list" diff --git a/templates/system/package/repository/node.tag/password/node.def b/templates/system/package/repository/node.tag/password/node.def new file mode 100644 index 00000000..34ccff27 --- /dev/null +++ b/templates/system/package/repository/node.tag/password/node.def @@ -0,0 +1,8 @@ +type: txt + +help: Repository password + +default: "" + +# need to prohibit '!' in url (sed delimiter) +syntax:expression: pattern $VAR(@) "^[^!]*$" ; "Do not use '!' in url" diff --git a/templates/system/package/repository/node.tag/url/node.def b/templates/system/package/repository/node.tag/url/node.def index 9cb3a472..07021671 100644 --- a/templates/system/package/repository/node.tag/url/node.def +++ b/templates/system/package/repository/node.tag/url/node.def @@ -1,4 +1,4 @@ type: txt -help: Set repository URL +help: Repository URL # need to prohibit '!' in url (sed delimiter) -syntax:expression: pattern $VAR(@) "^[^!]+$" ; "Do not use '!' in url" +syntax:expression: pattern $VAR(@) "^[^!]+$" ; "URL must not be null and must not contain '!'" diff --git a/templates/system/package/repository/node.tag/username/node.def b/templates/system/package/repository/node.tag/username/node.def new file mode 100644 index 00000000..d22dd7cb --- /dev/null +++ b/templates/system/package/repository/node.tag/username/node.def @@ -0,0 +1,8 @@ +type: txt + +help: Repository username + +default: "" + +# need to prohibit '!' in url (sed delimiter) +syntax:expression: pattern $VAR(@) "^[^!]*$" ; "Do not use '!' in url" |