initial
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 85
|
||||
/dav/ikwadmin/!svn/ver/2973/linux/puppetmaster/etc_puppet/modules/puppet/files/darwin
|
||||
END
|
||||
mac_inst_pkg.sh
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 101
|
||||
/dav/ikwadmin/!svn/ver/1786/linux/puppetmaster/etc_puppet/modules/puppet/files/darwin/mac_inst_pkg.sh
|
||||
END
|
||||
chplist.rb
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 96
|
||||
/dav/ikwadmin/!svn/ver/1786/linux/puppetmaster/etc_puppet/modules/puppet/files/darwin/chplist.rb
|
||||
END
|
||||
@@ -1,96 +0,0 @@
|
||||
10
|
||||
|
||||
dir
|
||||
4547
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin/linux/puppetmaster/etc_puppet/modules/puppet/files/darwin
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin
|
||||
|
||||
|
||||
|
||||
2009-11-17T13:03:47.348980Z
|
||||
2973
|
||||
uwaechte
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0e4a7186-e024-0410-a49b-aced43e0d94e
|
||||
|
||||
mac_inst_pkg.sh
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2011-07-25T16:18:40.000000Z
|
||||
044606cd03adeddf802414d297e88313
|
||||
2008-05-12T14:55:08.810767Z
|
||||
1299
|
||||
admin
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2082
|
||||
|
||||
chplist.rb
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2011-07-25T16:18:40.000000Z
|
||||
acee173df6f801ba44cd2c8b54d8421a
|
||||
2008-05-12T14:55:08.810767Z
|
||||
1299
|
||||
admin
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3419
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 12
|
||||
svn:keywords
|
||||
V 2
|
||||
Id
|
||||
END
|
||||
@@ -1,5 +0,0 @@
|
||||
K 12
|
||||
svn:keywords
|
||||
V 2
|
||||
Id
|
||||
END
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/usr/bin/env ruby -w
|
||||
# $Id$
|
||||
|
||||
|
||||
require 'rubygems'
|
||||
require 'plist'
|
||||
|
||||
class Plwrap
|
||||
attr_accessor :pl
|
||||
attr_accessor :filename
|
||||
attr_accessor :binary
|
||||
attr_accessor :do_conversion
|
||||
|
||||
def initialize(fn)
|
||||
do_conversion = true
|
||||
@filename = fn
|
||||
if ! File.exists?(fn)
|
||||
@pl = Plist::parse_xml(Hash.new.to_plist)
|
||||
return
|
||||
end
|
||||
|
||||
@binary = false
|
||||
ret = %x{file #{fn}}
|
||||
if ret =~ /binary|data/
|
||||
if do_conversion
|
||||
@binary = true
|
||||
%x{plutil -convert xml1 #{fn}}
|
||||
else
|
||||
raise "I'm not allowed to convert binary plist"
|
||||
end
|
||||
end
|
||||
@pl = Plist::parse_xml(@filename)
|
||||
end
|
||||
def get(key,path=nil)
|
||||
if(!path and get_without_path_ok?(key))
|
||||
path = guesspath(key)
|
||||
end
|
||||
mpath = modpath(path)
|
||||
return eval("@pl" + mpath)
|
||||
end
|
||||
def typeof(key,path=nil)
|
||||
return self.get(key,path).class
|
||||
end
|
||||
def set(key, val, klass=nil, path=nil)
|
||||
begin
|
||||
if(!path and get_without_path_ok?(key))
|
||||
path = guesspath(key)
|
||||
end
|
||||
rescue Exception => e
|
||||
if e.message =~ /oo many/
|
||||
raise e
|
||||
end
|
||||
path = key
|
||||
end
|
||||
mpath = modpath(path)
|
||||
mpath = "[\"#{key}\"]" if !mpath
|
||||
return eval("@pl" + mpath + "= convert(val,key,klass,path)")
|
||||
end
|
||||
def modpath(p)
|
||||
return p.split("::").map{|a| '["' + a + '"]'}.join("") if p
|
||||
end
|
||||
def guesspath(key,base=@pl)
|
||||
raise "base is not set in guesspath" if !base
|
||||
base.each do |a,b|
|
||||
if key == a
|
||||
return a
|
||||
end
|
||||
if b.methods.include?("each")
|
||||
if x = guesspath(key,b)
|
||||
x = a + "::" + x
|
||||
return x
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
def set_without_path_ok?(key)
|
||||
num = num_of_keys_with_this_name(@pl,key)
|
||||
if num > 1
|
||||
raise "Too many occurences of #{key} in tree (#{num} times)"
|
||||
end
|
||||
return true
|
||||
end
|
||||
def get_without_path_ok?(key)
|
||||
num = num_of_keys_with_this_name(@pl,key)
|
||||
if num == 0
|
||||
raise "Key #{key} does not exist"
|
||||
elsif num > 1
|
||||
raise "Too many occurences of #{key} in tree (#{num} times)"
|
||||
end
|
||||
return true
|
||||
end
|
||||
def num_of_keys_with_this_name(base, key)
|
||||
sum = 0
|
||||
raise "base is not set in num_of_keys_with_this_name" if !base
|
||||
base.each do |a,b|
|
||||
sum += 1 if key == a
|
||||
if b.methods.include?("each")
|
||||
sum += num_of_keys_with_this_name(b,key)
|
||||
end
|
||||
end
|
||||
return sum
|
||||
end
|
||||
def write(fn = @filename)
|
||||
Plist::Emit::save_plist(@pl, fn)
|
||||
%x{plutil -convert binary1 #{fn}} if do_conversion and @binary
|
||||
end
|
||||
def convert(val,key=nil,klass=nil,path=nil)
|
||||
if !klass
|
||||
raise ArgumentError, "Key needed if klass not given" if !key
|
||||
if get_without_path_ok?(key)
|
||||
klass = typeof(key,path)
|
||||
end
|
||||
end
|
||||
case klass.to_s
|
||||
when "Boolean"; return ["true","1"].include?(val)
|
||||
when "TrueClass"; return ["true","1"].include?(val)
|
||||
when "FalseClass"; return ["true","1"].include?(val)
|
||||
when "Array"; return val.split("::")
|
||||
when "Hash"; raise "Conversion of hashes not yet implemented"
|
||||
when "String"; return val.to_s
|
||||
when "Integer"; return val.to_i
|
||||
when "Fixnum"; return val.to_i
|
||||
when "Float"; return val.to_f
|
||||
else raise "Unknown class #{klass}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.size < 4
|
||||
puts "Usage: $0 file key path val klass\n"
|
||||
exit 1
|
||||
end
|
||||
|
||||
file,key,path,val,klass = ARGV
|
||||
|
||||
|
||||
klass = nil if ["","nil"].include?(klass)
|
||||
path = nil if ["","nil"].include?(path)
|
||||
|
||||
pw = Plwrap.new file
|
||||
begin
|
||||
pw.set(key,val,klass,path)
|
||||
rescue Exception => e
|
||||
puts e.message
|
||||
exit 0
|
||||
end
|
||||
pw.write(file)
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/bash
|
||||
# $Id$
|
||||
|
||||
|
||||
BASEURL=$1
|
||||
VERSION=$2
|
||||
PKGNAME=$3
|
||||
CHKSUM=$4
|
||||
EXTENSION=$5
|
||||
REMOVE=$6
|
||||
CHECKONLY=$7
|
||||
|
||||
# this is the naming scheme of the packages:
|
||||
PKGNS="${PKGNAME}_${VERSION}.${EXTENSION}"
|
||||
|
||||
# ZIPFILE
|
||||
ZIPFILE="${PKGNS}.zip"
|
||||
|
||||
# ------------------------------ Functions ----------------------------
|
||||
|
||||
function is_installed_with_any_version {
|
||||
if [ "`ls \"/Library/Receipts/${PGKNS}\"* 2>/dev/null`" != "" ] ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function is_installed_with_req_version {
|
||||
## echo "Testing whether /Library/Receipts/${PKGNS} exists"
|
||||
if [ -e "/Library/Receipts/${PKGNS}" ] ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function remove_old {
|
||||
echo "Removing old not yet implemented!"
|
||||
}
|
||||
|
||||
# ------------------------------ Installed? ---------------------------
|
||||
|
||||
is_installed_with_req_version
|
||||
if [ $? -eq 1 ] ; then
|
||||
echo "Required Version of ${PKGNAME} (${PKGNS}) already installed --> Done."
|
||||
exit 1;
|
||||
fi
|
||||
if [ "$CHECKONLY" != "" ] ; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
is_installed_with_any_version
|
||||
if [ $? -eq 1 ] ; then
|
||||
echo "Other Version of ${PKGNAME} already installed --> Updating."
|
||||
if [ "$REMOVE" == "true" ] ; then
|
||||
remove_old
|
||||
fi
|
||||
else
|
||||
echo "No Version of ${PKGNAME} already installed --> Installing."
|
||||
fi
|
||||
|
||||
# ------------------------------ Download ----------------------------
|
||||
cd /tmp
|
||||
ZIPFILE=`echo $ZIPFILE | perl -npe 's/ /%20/g'`
|
||||
curl "${BASEURL}/$ZIPFILE" -o "/tmp/$ZIPFILE"
|
||||
|
||||
# ------------------------------ Checksum ----------------------------
|
||||
if [ -e "/sw/bin/md5sum" ] ; then
|
||||
DLMD5=`/sw/bin/md5sum "$ZIPFILE" | cut -f1 -d' '`
|
||||
else
|
||||
DLMD5=`md5 "$ZIPFILE" | cut -f4 -d' '`
|
||||
fi
|
||||
|
||||
if [ "0" != "$CHKSUM" ] ; then
|
||||
if [ "$DLMD5" != "$CHKSUM" ] ; then
|
||||
echo "Could not verify checksum: Mismatch!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "WARNING: Ignoring checksum check"
|
||||
fi
|
||||
|
||||
# ------------------------------ Install ----------------------------
|
||||
# -o: force overwrite
|
||||
unzip -o "$ZIPFILE"
|
||||
if installer -pkg "${PKGNS}" -target / ; then
|
||||
touch "/Library/Receipts/${PKGNS}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Installer failed."
|
||||
exit 1
|
||||
Reference in New Issue
Block a user