Luiji / smc-get

Prototype for Secret Maryo Chronicles' level repository manager.
http://www.secretmaryo.org/
GNU General Public License v3.0
4 stars 1 forks source link

smc-get build fails for worlds #4

Closed Quintus closed 13 years ago

Quintus commented 13 years ago

The interactive build process fails if worlds are included:

$ ruby /home/quintus/Programmieren/Projekte/smc-get/bin/smc-get build
WARNING: Couldn't connect to this repository:
http://localhost:3000
Reason: Connection refused - connect(2)
Welcome to the smc-get build process! 
Answer the following questions properly and you'll end up with a ready-to-
install package you can either install locally or contribute to the repository
(which would make it installable via 'smc-get install' directly). When a question
asks you to input multiple files, you can end the query with an empty line.
If you like, you can specify multiple files at once by separating them
with a comma. Wildcards in filenames are allowed.

Files you don't specify via an absolute path (i.e. a path beginning with
either / on *nix or <letter>:\ on Windows) are searched for in your
home directory's .smc directory and your SMC installation.

Enter the names of the levels you want to include:
> /home/quintus/Downloads/X/levels/*.smclvl
> 

Enter the names of the graphics you want to include:
> 
No graphics specified. Is this correct?(y/n) y

Enter the names of the music you want to include:
> 
No music specified. Is this correct?(y/n) y

Enter the names of the sounds you want to include:
> 
No sounds specified. Is this correct?(y/n) y

Enter the names of the worlds you want to include:
> /home/quintus/Downloads/X/world/1_world_dreamer
> 

Who participated in creating this package?
> Dreamer
> 

Enter this package's dependecy packages:
> 

Enter the difficulty: medium

Enter the package's description. A single line containing containg
END
terminates the query.
> I made a world with ten levels. It's my first world, so maybe it's not the best. I'm making another one, so sugestions are welcome.
> END

Enter the package's install_message. A single line containing containg
END
terminates the query. Enter END immediately if you don't want
a install_message.
> END

Enter the package's remove_message. A single line containing containg
END
terminates the query. Enter END immediately if you don't want
a remove_message.
> END

Enter the package's full title (it can contain whitespace):Dreamer's first world

Enter the package's name (this mustn't contain whitespace):dreamers-first-world

Creating package...
[BUG] Errno::EISDIR
Please file a bug report at https://github.com/Luiji/smc-get/issues
and attach this message. Describe what you did so we can
reproduce it. 
/opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1280:in `copy_stream': Is a directory - read (Errno::EISDIR)
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1280:in `block (2 levels) in copy_file'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1279:in `open'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1279:in `block in copy_file'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1278:in `open'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1278:in `copy_file'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:473:in `copy_file'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:392:in `block in cp'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1423:in `block in fu_each_src_dest'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1437:in `fu_each_src_dest0'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:1421:in `fu_each_src_dest'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:391:in `cp'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:175:in `block (3 levels) in execute'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:175:in `each'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:175:in `block (2 levels) in execute'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:172:in `each'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:172:in `block in execute'
    from /opt/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui_commands/build.rb:166:in `execute'
    from /media/truecrypt1/quintus/Programmieren/Projekte/smc-get/lib/smc_get/cui.rb:192:in `start'
    from /home/quintus/Programmieren/Projekte/smc-get/bin/smc-get:31:in `<main>'

ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] OS: Arch Linux smc-get version: 0.2.0-beta2dev

This is because it tries to treat the world directory as a file when it tries to copy it to the temporary directory for compressing.

The world I tried to package is the one from this thread: http://www.secretmaryo.org/phpBB3/viewtopic.php?f=21&t=4608

Valete, Quintus

Luiji commented 13 years ago

How hard would this be to fix? Is there a good function to copy entire directories or will we have to write our own recursive function?

Quintus commented 13 years ago

No need to reinvent the wheel. I already use the FileUtils module (stdlib) excessively in smc-get and it provides the cp_r method that does a quite good job on copying directories recursively.

Vale, Quintus