summaryrefslogtreecommitdiff
path: root/templates/system/package/repository/node.def
diff options
context:
space:
mode:
authorMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:43:32 -0700
committerMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:43:32 -0700
commitbcfbf5b462faa5e0e13c82c8a367e8df698b6c20 (patch)
treedbaf63ba4719590fa5016cc105f4f73eef3c722b /templates/system/package/repository/node.def
parentcceaba487befe7103ecb058c4dbf3e3a46102dc3 (diff)
parent4e213e1a8148d755bb3921cae3caee847901b54e (diff)
downloadvyatta-cfg-system-bcfbf5b462faa5e0e13c82c8a367e8df698b6c20.tar.gz
vyatta-cfg-system-bcfbf5b462faa5e0e13c82c8a367e8df698b6c20.zip
Merge branch 'hollywood' of git:/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"