2005-07-24 Yoshinori K. Okuji <okuji@enbug.org>

* DISTLIST: Added util/i386/pc/grub-install.in.

	* util/i386/pc/grub-install.in: New file.

	* conf/i386-pc.rmk (sbin_SCRIPTS): New variable.
	(grub_install_SOURCES): Likewise.

	* genmk.rb: Added support for scripts.
	(Script): New class.
	(scripts): New variable.

	* Makefile.in (install-local): Install sbin_SCRIPTS by
	INSTALL_SCRIPT.
	(uninstall): Remove sbin_SCRIPTS.

	* util/i386/pc/grub-setup.c (main): If the argument is not a GRUB
	device, try to get a GRUB device by
	grub_util_biosdisk_get_grub_dev.
	Free DEST_DEV.

	* util/i386/pc/grub-mkdevicemap.c (usage): Remove a duplicated
	description for --device-map.
This commit is contained in:
okuji 2005-07-24 18:16:26 +00:00
parent 5f968e1e61
commit 075a165076
8 changed files with 300 additions and 16 deletions

View file

@ -268,10 +268,36 @@ MOSTLYCLEANFILES += #{deps_str}
end
end
class Script
def initialize(dir, name)
@dir = dir
@name = name
end
attr_reader :dir, :name
def rule(sources)
if sources.length != 1
raise "only a single source file must be specified for a script"
end
src = sources[0]
if /\.in$/ !~ src
raise "unknown source file `#{src}'"
end
"CLEANFILES += #{@name}
#{@name}: #{src} config.status
./config.status --file=#{name}:#{src}
"
end
end
images = []
utils = []
pmodules = []
programs = []
scripts = []
cont = false
s = nil
@ -310,8 +336,13 @@ while l = gets
end
when 'PROGRAMS'
programs += args.split(/\s+/).collect do |util|
Program.new(prefix, util)
programs += args.split(/\s+/).collect do |prog|
Program.new(prefix, prog)
end
when 'SCRIPTS'
scripts += args.split(/\s+/).collect do |script|
Script.new(prefix, script)
end
when 'SOURCES'
@ -323,6 +354,8 @@ while l = gets
print util.rule(args.split(/\s+/))
elsif program = programs.detect() {|u| u.name.to_var == prefix}
print program.rule(args.split(/\s+/))
elsif script = scripts.detect() {|s| s.name.to_var == prefix}
print script.rule(args.split(/\s+/))
end
end
end