urm 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +20 -0
- data/LICENSE +20 -0
- data/README.md +90 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/bin/urm +5 -0
- data/lib/urm.rb +1 -0
- data/scripts/urm +326 -0
- data/urm.gemspec +61 -0
- metadata +113 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.2"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
git (1.2.5)
|
5
|
+
jeweler (1.5.2)
|
6
|
+
bundler (~> 1.0.0)
|
7
|
+
git (>= 1.2.5)
|
8
|
+
rake
|
9
|
+
rake (0.8.7)
|
10
|
+
rcov (0.9.9)
|
11
|
+
shoulda (2.11.3)
|
12
|
+
|
13
|
+
PLATFORMS
|
14
|
+
ruby
|
15
|
+
|
16
|
+
DEPENDENCIES
|
17
|
+
bundler (~> 1.0.0)
|
18
|
+
jeweler (~> 1.5.2)
|
19
|
+
rcov
|
20
|
+
shoulda
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010-2011 Joseph Ku (Chieh-Fang Ku)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
URM
|
2
|
+
===
|
3
|
+
|
4
|
+
**URM** is **Ubuntu Release Manager (urm)**. It manages Ubuntu releases
|
5
|
+
and switch between them without rebooting PC or using virtual machine.
|
6
|
+
|
7
|
+
Requirements
|
8
|
+
------------
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
Installation
|
13
|
+
------------
|
14
|
+
|
15
|
+
Use RubyGems to install **urm**:
|
16
|
+
|
17
|
+
$ gem install urm
|
18
|
+
|
19
|
+
|
20
|
+
To install, initialize, and configure **urm** manually, follow these steps:
|
21
|
+
|
22
|
+
Make sure you have a bin/ directory in your home directory, and that it is included in your path:
|
23
|
+
|
24
|
+
$ mkdir ~/bin
|
25
|
+
$ PATH=~/bin:$PATH
|
26
|
+
|
27
|
+
Download the **urm** and ensure it is executable:
|
28
|
+
|
29
|
+
$ curl https://github.com/JosephKu/urm/raw/master/src/urm > ~/bin/urm
|
30
|
+
$ chmod a+x ~/bin/urm
|
31
|
+
|
32
|
+
|
33
|
+
Usage
|
34
|
+
-----
|
35
|
+
|
36
|
+
Install a new release of Ubuntu by specific version:
|
37
|
+
|
38
|
+
$ urm install hardy i386
|
39
|
+
|
40
|
+
List all installed releases of Ubuntu:
|
41
|
+
|
42
|
+
$ urm list
|
43
|
+
|
44
|
+
List all supported releases of Ubuntu:
|
45
|
+
|
46
|
+
$ urm list --remote
|
47
|
+
|
48
|
+
Switch to a installed release of Ubuntu:
|
49
|
+
|
50
|
+
$ urm start hardy-i386
|
51
|
+
|
52
|
+
Uninstall a installed release of Ubuntu:
|
53
|
+
|
54
|
+
$ urm uninstall hardy-i386
|
55
|
+
|
56
|
+
Show the information of a installed release of Ubuntu:
|
57
|
+
|
58
|
+
$ urm info hardy-i386
|
59
|
+
|
60
|
+
|
61
|
+
Contributing
|
62
|
+
------------
|
63
|
+
|
64
|
+
1. Fork it.
|
65
|
+
2. Create a branch (`git checkout -b my_urm`)
|
66
|
+
3. Commit your changes (`git commit -am "Add Ubuntu 99.04 support"`)
|
67
|
+
4. Push to the branch (`git push origin my_urm`)
|
68
|
+
5. Create an [Issue][1] with a link to your branch
|
69
|
+
6. Enjoy a refreshing Diet Coke and wait
|
70
|
+
|
71
|
+
|
72
|
+
Submitting an Issue
|
73
|
+
-------------------
|
74
|
+
I use the [GitHub issue tracker](https://github.com/JosephKu/urm/issues) to track bugs and
|
75
|
+
features. Before submitting a bug report or feature request, check to make sure it hasn't already
|
76
|
+
been submitted. You can indicate support for an existing issuse by voting it up. When submitting a
|
77
|
+
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
|
78
|
+
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
79
|
+
operating system. Ideally, a bug report should include a pull request with failing specs.
|
80
|
+
|
81
|
+
|
82
|
+
Copyright
|
83
|
+
---------
|
84
|
+
Copyright (c) 2010-2011 Joseph Ku.
|
85
|
+
See [LICENSE](https://github.com/JosephKu/urm/blob/master/LICENSE) for details.
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
[1]: https://github.com/JosephKu/urm/issues
|
90
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "urm"
|
16
|
+
gem.homepage = "http://github.com/JosephKu/urm"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{Ubuntu Release Manager (urm)}
|
19
|
+
gem.description = %Q{URM is Ubuntu Release Manager (urm). It manages Ubuntu releases and switch between them without rebooting PC or using virtual machine.}
|
20
|
+
gem.email = "chiehfang.ku@gmail.com"
|
21
|
+
gem.authors = ["Joseph Ku"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
Rake::TestTask.new(:test) do |test|
|
31
|
+
test.libs << 'lib' << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
require 'rcov/rcovtask'
|
37
|
+
Rcov::RcovTask.new do |test|
|
38
|
+
test.libs << 'test'
|
39
|
+
test.pattern = 'test/**/test_*.rb'
|
40
|
+
test.verbose = true
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "urm #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.5
|
data/bin/urm
ADDED
data/lib/urm.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
data/scripts/urm
ADDED
@@ -0,0 +1,326 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# Include bashcolor
|
4
|
+
cat > /tmp/bashcolor << EOF
|
5
|
+
#!/bin/sh
|
6
|
+
|
7
|
+
# Reset
|
8
|
+
Color_off='\e[0m'
|
9
|
+
|
10
|
+
# Regular Colors
|
11
|
+
Black='\e[0;30m' # Black
|
12
|
+
Red='\e[0;31m' # Red
|
13
|
+
Green="\e[0;32m" # Green
|
14
|
+
Yellow='\e[0;33m' # Yellow
|
15
|
+
Blue='\e[0;34m' # Blue
|
16
|
+
Purple='\e[0;35m' # Purple
|
17
|
+
Cyan='\e[0;36m' # Cyan
|
18
|
+
White='\e[0;37m' # White
|
19
|
+
|
20
|
+
# Bold
|
21
|
+
BBlack='\e[1;30m' # Black
|
22
|
+
BRed='\e[1;31m' # Red
|
23
|
+
BGreen='\e[1;32m' # Green
|
24
|
+
BYellow='\e[1;33m' # Yellow
|
25
|
+
BBlue='\e[1;34m' # Blue
|
26
|
+
BPurple='\e[1;35m' # Purple
|
27
|
+
BCyan='\e[1;36m' # Cyan
|
28
|
+
BWhite='\e[1;37m' # White
|
29
|
+
|
30
|
+
# Underline
|
31
|
+
UBlack='\e[4;30m' # Black
|
32
|
+
URed='\e[4;31m' # Red
|
33
|
+
UGreen='\e[4;32m' # Green
|
34
|
+
UYellow='\e[4;33m' # Yellow
|
35
|
+
UBlue='\e[4;34m' # Blue
|
36
|
+
UPurple='\e[4;35m' # Purple
|
37
|
+
UCyan='\e[4;36m' # Cyan
|
38
|
+
UWhite='\e[4;37m' # White
|
39
|
+
|
40
|
+
# Background
|
41
|
+
On_Black='\e[40m' # Black
|
42
|
+
On_Red='\e[41m' # Red
|
43
|
+
On_Green='\e[42m' # Green
|
44
|
+
On_Yellow='\e[43m' # Yellow
|
45
|
+
On_Blue='\e[44m' # Blue
|
46
|
+
On_Purple='\e[45m' # Purple
|
47
|
+
On_Cyan='\e[46m' # Cyan
|
48
|
+
On_White='\e[47m' # White
|
49
|
+
|
50
|
+
# High Intensty
|
51
|
+
IBlack='\e[0;90m' # Black
|
52
|
+
IRed='\e[0;91m' # Red
|
53
|
+
IGreen='\e[0;92m' # Green
|
54
|
+
IYellow='\e[0;93m' # Yellow
|
55
|
+
IBlue='\e[0;94m' # Blue
|
56
|
+
IPurple='\e[0;95m' # Purple
|
57
|
+
ICyan='\e[0;96m' # Cyan
|
58
|
+
IWhite='\e[0;97m' # White
|
59
|
+
|
60
|
+
# Bold High Intensty
|
61
|
+
BIBlack='\e[1;90m' # Black
|
62
|
+
BIRed='\e[1;91m' # Red
|
63
|
+
BIGreen='\e[1;92m' # Green
|
64
|
+
BIYellow='\e[1;93m' # Yellow
|
65
|
+
BIBlue='\e[1;94m' # Blue
|
66
|
+
BIPurple='\e[1;95m' # Purple
|
67
|
+
BICyan='\e[1;96m' # Cyan
|
68
|
+
BIWhite='\e[1;97m' # White
|
69
|
+
|
70
|
+
# High Intensty backgrounds
|
71
|
+
On_IBlack='\e[0;100m' # Black
|
72
|
+
On_IRed='\e[0;101m' # Red
|
73
|
+
On_IGreen='\e[0;102m' # Green
|
74
|
+
On_IYellow='\e[0;103m' # Yellow
|
75
|
+
On_IBlue='\e[0;104m' # Blue
|
76
|
+
On_IPurple='\e[10;95m' # Purple
|
77
|
+
On_ICyan='\e[0;106m' # Cyan
|
78
|
+
On_IWhite='\e[0;107m' # White
|
79
|
+
|
80
|
+
test_suite ()
|
81
|
+
{
|
82
|
+
echo
|
83
|
+
echo "Test reset function"
|
84
|
+
echo "=="
|
85
|
+
|
86
|
+
echo -e ${BRed}"Set to Bold Red"${Color_off}
|
87
|
+
echo -e "Reset to normal"
|
88
|
+
|
89
|
+
echo
|
90
|
+
echo "Test effects of all kinds of properties"
|
91
|
+
echo "=="
|
92
|
+
|
93
|
+
echo -e ${Green}"Regular Green"${Color_off}
|
94
|
+
echo -e ${BGreen}"Bold Green"${Color_off}
|
95
|
+
echo -e ${UGreen}"Underline Green"${Color_off}
|
96
|
+
echo -e ${On_Green}"Green Background"${Color_off}
|
97
|
+
echo -e ${IGreen}"High Intensty Green"${Color_off}
|
98
|
+
echo -e ${BIGreen}"Bold High Intensty Green"${Color_off}
|
99
|
+
echo -e ${On_IGreen}"Green High Intensty Background"${Color_off}
|
100
|
+
}
|
101
|
+
EOF
|
102
|
+
. /tmp/bashcolor
|
103
|
+
|
104
|
+
|
105
|
+
echo_info ()
|
106
|
+
{
|
107
|
+
echo -e ${IGreen}$*${Color_off}
|
108
|
+
}
|
109
|
+
|
110
|
+
echo_err ()
|
111
|
+
{
|
112
|
+
echo -e ${IRed}$*${Color_off}
|
113
|
+
}
|
114
|
+
|
115
|
+
echo_debug ()
|
116
|
+
{
|
117
|
+
echo -e ${IYellow}$*${Color_off}
|
118
|
+
}
|
119
|
+
|
120
|
+
usage_msg ()
|
121
|
+
{
|
122
|
+
cat <<EOF
|
123
|
+
usage: urm COMMAND [ARGS]
|
124
|
+
|
125
|
+
The most commonly used urm commands are:
|
126
|
+
list List all installed releases of Ubuntu
|
127
|
+
info Show the information of a installed release of Ubuntu
|
128
|
+
install Install specific release of Ubuntu
|
129
|
+
start Switch to a installed release of Ubuntu
|
130
|
+
uninstall Uninstall specific release of Ubuntu
|
131
|
+
|
132
|
+
See 'urm help COMMAND' for more information on a specific command.
|
133
|
+
EOF
|
134
|
+
}
|
135
|
+
|
136
|
+
list_command ()
|
137
|
+
{
|
138
|
+
echo "Installed releases of Ubuntu:"
|
139
|
+
echo
|
140
|
+
echo " "$(ls /etc/schroot/chroot.d/ | sed 's/ /\n/g')
|
141
|
+
echo
|
142
|
+
}
|
143
|
+
|
144
|
+
# Release info
|
145
|
+
VERSION=0.2.4
|
146
|
+
AUTHOR="Joseph Ku"
|
147
|
+
EMAIL="chiehfang.ku@gmail.com"
|
148
|
+
|
149
|
+
if [[ "root" = "$(whoami)" ]] ; then
|
150
|
+
sudo=""
|
151
|
+
src_path=/usr/local/src
|
152
|
+
else
|
153
|
+
sudo="sudo"
|
154
|
+
src_path=$HOME/.src
|
155
|
+
fi
|
156
|
+
|
157
|
+
CODENAME="hardy"
|
158
|
+
ARCH="i386"
|
159
|
+
|
160
|
+
|
161
|
+
# Check whether Ubuntu system or not
|
162
|
+
if [ -r "/usr/bin/lsb_release" ] && [ $(lsb_release -is) != "Ubuntu" ]; then
|
163
|
+
echo_err "urm only supports Ubuntu system!"
|
164
|
+
echo
|
165
|
+
exit 1
|
166
|
+
fi
|
167
|
+
|
168
|
+
# Check whether urm is running on urm
|
169
|
+
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
170
|
+
echo_err "Do NOT run urm on urm!"
|
171
|
+
fi
|
172
|
+
|
173
|
+
if [ ! -n "$1" ]; then
|
174
|
+
usage_msg
|
175
|
+
exit 0
|
176
|
+
fi
|
177
|
+
|
178
|
+
case $1 in
|
179
|
+
"list")
|
180
|
+
list_command
|
181
|
+
exit 0
|
182
|
+
;;
|
183
|
+
"info")
|
184
|
+
echo_err "Sorry...this command is not available. Coming soon!"
|
185
|
+
exit 1
|
186
|
+
;;
|
187
|
+
"install")
|
188
|
+
command="install"
|
189
|
+
if [ -n "$2" ]; then
|
190
|
+
CODENAME=$2
|
191
|
+
fi
|
192
|
+
if [ -n "$3" ]; then
|
193
|
+
ARCH=$3
|
194
|
+
fi
|
195
|
+
;;
|
196
|
+
"start")
|
197
|
+
if [ ! -n "$2" ]; then
|
198
|
+
echo "usage: urm start [installed_release]"
|
199
|
+
echo
|
200
|
+
echo_err "Please assign a installed release of Ubuntu!"
|
201
|
+
echo
|
202
|
+
exit 1
|
203
|
+
fi
|
204
|
+
schroot -c $2
|
205
|
+
exit 0
|
206
|
+
;;
|
207
|
+
"uninstall")
|
208
|
+
echo_err "Sorry...this command is not available. Coming soon!"
|
209
|
+
exit 1
|
210
|
+
;;
|
211
|
+
"help")
|
212
|
+
echo_err "Sorry...this command is not available. Coming soon!"
|
213
|
+
exit 1
|
214
|
+
;;
|
215
|
+
esac
|
216
|
+
|
217
|
+
CHROOT=$CODENAME-$ARCH
|
218
|
+
CHROOT_PATH="/srv/chroot/$CHROOT"
|
219
|
+
|
220
|
+
echo "Start to establish chroot environment:"
|
221
|
+
echo ""
|
222
|
+
|
223
|
+
if [ $USER = "root" ]; then
|
224
|
+
echo_err "Please don't use root user or sudo command to run this program!"
|
225
|
+
exit 1
|
226
|
+
fi
|
227
|
+
|
228
|
+
|
229
|
+
echo_info "Install required software packages..."
|
230
|
+
$sudo apt-get -y install debootstrap schroot
|
231
|
+
|
232
|
+
echo_info "Establish configuration file for schroot..."
|
233
|
+
if [ $(uname -m) = "x86_64" ]; then
|
234
|
+
PERSONALITY="personality=linux32"
|
235
|
+
else
|
236
|
+
PERSONALITY="#personality=linux32"
|
237
|
+
fi
|
238
|
+
|
239
|
+
cat > $CHROOT << EOF
|
240
|
+
[$CHROOT]
|
241
|
+
description=$CODENAME for $ARCH
|
242
|
+
directory=$CHROOT_PATH
|
243
|
+
|
244
|
+
# Enable this line if the host system is 64-bit
|
245
|
+
# running on an amd64/x64 computer and the chroot
|
246
|
+
# is 32-bit for i386. Otherwise, leave it disabled.
|
247
|
+
$PERSONALITY
|
248
|
+
|
249
|
+
root-users=$USER
|
250
|
+
type=directory
|
251
|
+
users=$USER
|
252
|
+
EOF
|
253
|
+
|
254
|
+
$sudo chown root.root $CHROOT
|
255
|
+
$sudo mv $CHROOT /etc/schroot/chroot.d/.
|
256
|
+
|
257
|
+
# Create base root filesystem
|
258
|
+
echo_info "Create base root filesystem..."
|
259
|
+
$sudo mkdir -p $CHROOT_PATH
|
260
|
+
$sudo debootstrap --variant=buildd --arch $ARCH $CODENAME $CHROOT_PATH http://archive.ubuntu.com/ubuntu/
|
261
|
+
|
262
|
+
# Comment mounting /home folder for using chroot safely
|
263
|
+
if [ -e /etc/schroot/default/fstab ]; then
|
264
|
+
$sudo sed -i 's@^/home@#/home@g' /etc/schroot/default/fstab # schroot 1.4.7
|
265
|
+
else
|
266
|
+
$sudo sed -i 's@^/home@#/home@g' /etc/schroot/mount-defaults
|
267
|
+
fi
|
268
|
+
|
269
|
+
# Copy sudoers file
|
270
|
+
if [ -e /etc/schroot/default/copyfiles ]; then
|
271
|
+
$sudo sed -i '$a\/etc/sudoers' /etc/schroot/default/copyfiles # schroot 1.4.7
|
272
|
+
else
|
273
|
+
$sudo sed -i '$a\/etc/sudoers' /etc/schroot/copyfiles-defaults
|
274
|
+
fi
|
275
|
+
|
276
|
+
# Copy default locale file
|
277
|
+
if [ -e /etc/schroot/default/copyfiles ]; then
|
278
|
+
$sudo sed -i '$a\/etc/default/locale' /etc/schroot/default/copyfiles # schroot 1.4.7
|
279
|
+
else
|
280
|
+
$sudo sed -i '$a\/etc/default/locale' /etc/schroot/copyfiles-defaults
|
281
|
+
fi
|
282
|
+
|
283
|
+
|
284
|
+
# Copy initial script
|
285
|
+
cat > /tmp/init.sh << EOF
|
286
|
+
#!/bin/sh
|
287
|
+
|
288
|
+
apt-get -y --force-yes install ubuntu-minimal
|
289
|
+
apt-get -y --force-yes install language-pack-en
|
290
|
+
dpkg-reconfigure locales
|
291
|
+
dpkg-reconfigure dash
|
292
|
+
|
293
|
+
echo "export $(cat /etc/default/locale)" >> /etc/bash.bashrc
|
294
|
+
echo ". /home/$USER/.bashrc" >> /etc/bash.bashrc
|
295
|
+
EOF
|
296
|
+
$sudo cp /tmp/init.sh $CHROOT_PATH/root/.
|
297
|
+
|
298
|
+
# Initialize environment
|
299
|
+
echo_info "Initialize environment..."
|
300
|
+
|
301
|
+
|
302
|
+
cd /home # Change to an existed folder in chroot
|
303
|
+
|
304
|
+
schroot -c $CHROOT -u root mkdir /home/$USER
|
305
|
+
schroot -c $CHROOT -u root chown $USER.$USER /home/$USER
|
306
|
+
|
307
|
+
$sudo cp $HOME/.bash* $CHROOT_PATH/home/$USER/.
|
308
|
+
|
309
|
+
schroot -c $CHROOT -u root -- sed -i '$a\deb http://archive.ubuntu.com/ubuntu hardy universe' /etc/apt/sources.list
|
310
|
+
schroot -c $CHROOT -u root -- sed -i '$a\deb http://archive.ubuntu.com/ubuntu hardy multiverse' /etc/apt/sources.list
|
311
|
+
schroot -c $CHROOT -u root apt-get update
|
312
|
+
|
313
|
+
# Run customized script
|
314
|
+
schroot -c $CHROOT -u root sh /root/init.sh
|
315
|
+
$sudo rm -f $CHROOT_PATH/root/init.sh
|
316
|
+
|
317
|
+
cd -
|
318
|
+
|
319
|
+
echo_info "Done."
|
320
|
+
echo ""
|
321
|
+
|
322
|
+
echo "Use 'urm start $CHROOT' to switch to the release"
|
323
|
+
echo "Or 'urm start $CHROOT <command in chroot>' to launch a command in the release."
|
324
|
+
|
325
|
+
exit 0
|
326
|
+
|
data/urm.gemspec
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{urm}
|
8
|
+
s.version = "0.2.5"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Joseph Ku"]
|
12
|
+
s.date = %q{2011-04-02}
|
13
|
+
s.default_executable = %q{urm}
|
14
|
+
s.description = %q{URM is Ubuntu Release Manager (urm). It manages Ubuntu releases and switch between them without rebooting PC or using virtual machine.}
|
15
|
+
s.email = %q{chiehfang.ku@gmail.com}
|
16
|
+
s.executables = ["urm"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE",
|
26
|
+
"README.md",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"bin/urm",
|
30
|
+
"lib/urm.rb",
|
31
|
+
"scripts/urm",
|
32
|
+
"urm.gemspec"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/JosephKu/urm}
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.6.2}
|
38
|
+
s.summary = %q{Ubuntu Release Manager (urm)}
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
45
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
46
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
47
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
50
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
52
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
58
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: urm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.5
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Joseph Ku
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-02 00:00:00 +08:00
|
14
|
+
default_executable: urm
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: shoulda
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
type: :development
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.0.0
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: jeweler
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.2
|
46
|
+
type: :development
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rcov
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: *id004
|
60
|
+
description: URM is Ubuntu Release Manager (urm). It manages Ubuntu releases and switch between them without rebooting PC or using virtual machine.
|
61
|
+
email: chiehfang.ku@gmail.com
|
62
|
+
executables:
|
63
|
+
- urm
|
64
|
+
extensions: []
|
65
|
+
|
66
|
+
extra_rdoc_files:
|
67
|
+
- LICENSE
|
68
|
+
- README.md
|
69
|
+
files:
|
70
|
+
- .document
|
71
|
+
- Gemfile
|
72
|
+
- Gemfile.lock
|
73
|
+
- LICENSE
|
74
|
+
- README.md
|
75
|
+
- Rakefile
|
76
|
+
- VERSION
|
77
|
+
- bin/urm
|
78
|
+
- lib/urm.rb
|
79
|
+
- scripts/urm
|
80
|
+
- urm.gemspec
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: http://github.com/JosephKu/urm
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: -4161929904461007689
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: "0"
|
105
|
+
requirements: []
|
106
|
+
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 1.6.2
|
109
|
+
signing_key:
|
110
|
+
specification_version: 3
|
111
|
+
summary: Ubuntu Release Manager (urm)
|
112
|
+
test_files: []
|
113
|
+
|