summaryrefslogtreecommitdiff
path: root/templates/system/package/repository/node.def
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-07-07 17:00:51 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-07-07 17:00:51 -0700
commite5c331a28b6ac6e30925dfea8827bd5ce3f1c816 (patch)
tree8d8a0a4eb86fe5735798562279a47a2199c34bf6 /templates/system/package/repository/node.def
parent28b7618bf24ea745d5d7e5a287de1aa728111d08 (diff)
parent7899738d1262d760c86d1d79fcbeceb493d3c1b8 (diff)
downloadvyatta-cfg-quagga-e5c331a28b6ac6e30925dfea8827bd5ce3f1c816.tar.gz
vyatta-cfg-quagga-e5c331a28b6ac6e30925dfea8827bd5ce3f1c816.zip
Merge branch 'hollywood' of suva.vyatta.com:/git/vyatta-cfg-system into hollywood
Diffstat (limited to 'templates/system/package/repository/node.def')
-rw-r--r--templates/system/package/repository/node.def15
1 files changed, 11 insertions, 4 deletions
diff --git a/templates/system/package/repository/node.def b/templates/system/package/repository/node.def
index 8d753918..b2f0349f 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 "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"