Scripts not included in package

Asked by bcbc on 2012-03-06

I have added some existing scripts to a new app I am building. These are not included when I create the package:

$ quickly package
.......
Command returned some WARNINGS:
----------------------------------
WARNING: the following files are not recognized by DistUtilsExtra.auto:
  wubi_move/check-source.sh
  wubi_move/detect-wubi.sh
  wubi_move/select-partitions.sh
----------------------------------
Do you want to continue (this is not safe!)? y/[n]:

After continuing and installing the resulting .deb I confirmed the scripts were not included. What do I need to do to get these included?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Quickly Edit question
Assignee:
No assignee Edit question
Solved by:
Jonathan Kossick
Solved:
2012-03-07
Last query:
2012-03-07
Last reply:
2012-03-07
Best Jonathan Kossick (j-kossick) said : #1

The Question is already answered in the question before ... i didn't found the entry ...
Nevertheless you can add files to your package which are not automatically includet if you specify the "data_files" argument in you setup.py file

    data_files=[
    ('/usr/bin/wubi_move', glob.glob('wubi_move/*.sh'))],

This will copy all .sh scripts in the folder wubi_move to the directory /usr/bin/wubi_move
You can also specify just one file you want to include in the package:

    data_files=[
    ('/usr/bin/wubi_move', glob.glob('wubi_move/check-source.sh'))],

Good luck!

bcbc (bcbc) said : #2

Thanks for that - it worked. Here are a few more details since it didn't work immediately. The initial output was:
$ quickly package
.....An error has occurred when creating debian packaging
ERROR: can't create or update ubuntu package
ERROR: package command failed
Aborting

Adding the --verbose option:
$ quickly package --verbose
Traceback (most recent call last):
  File "setup.py", line 88, in <module>
    ('/usr/bin/wubi_move', glob.glob('wubi_move/*.sh'))],
NameError: name 'glob' is not defined
setup.py install_egg_info failed
An error has occurred when creating debian packaging
ERROR: can't create or update ubuntu package
ERROR: package command failed
Aborting

A bit of searching and it turns out you have to edit the part where it says don't edit to import glob:
###################### DO NOT TOUCH THIS (HEAD TO THE SECOND PART) ######################

import os
import sys
import glob <=== add that

Alternatively, if you specify each one without using the glob module it also works:
##################################################################################
###################### YOU SHOULD MODIFY ONLY WHAT IS BELOW ######################
##################################################################################

DistUtilsExtra.auto.setup(
    name='wubi-move',
    version='0.1',
    license='GPL-3',
    author='bcbc',
...
    data_files=[
    ('/usr/bin/wubi_move', ['wubi_move/select-partitions.sh']),
    ('/usr/bin/wubi_move', ['wubi_move/detect-wubi.sh']),
    ('/usr/bin/wubi_move', ['wubi_move/check-source.sh']),],
    cmdclass={'install': InstallAndUpdateDataDirectory}
    )

I don't think /usr/bin is the correct place, but that's a minor detail. Thanks for the help.

bcbc (bcbc) said : #3

Thanks Jonathan Kossick, that solved my question.