blob: f3bd61b70eddf882c64710c910afee2fbb1b0497 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/ruby
module FedoraDarkfishAssetsReq
FEDORA_DARKFISH_ASSETS_DIR = '%{_datadir}/%{name}'
FEDORA_DARKFISH_ASSETS_DIR_REGEXP = Regexp.new "#{FEDORA_DARKFISH_ASSETS_DIR}/.*"
# Go through all subdirectories and look for symlinks, which corresponds
# to fedora-darkfish template. In that case generate the require for such
# filename.
def self.requires
while filename = gets
filename.strip!
fedora_darkfish_asset = !!Dir.glob("#{filename}/**/*").find do |f|
File.symlink?(f) && File.readlink(f) =~ FEDORA_DARKFISH_ASSETS_DIR_REGEXP
end
puts '%{name}-assets' if fedora_darkfish_asset
end
end
end
if __FILE__ == $0
FedoraDarkfishAssetsReq::requires
end
|