Results 1 to 6 of 6

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: I need postinst help | File managent

  1. #1
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need postinst help | File managent
    I'm working on making a file modification via a .deb file and I seem to keep getting errors :'('''''''

    " Sub-process /usr/bin/dpkg returned an error code (1) "
    " subprocess post-installation script returned error exit status 2 "

    I have " exit 0 " and another line at the end of my script, so idk what the cause of the exit status error is

    Basically what I'm trying to accomplish is: package a .deb who's internal structure is:

    /var/mobile/Documents/iGameHacks/Game/Backups/file
    /var/mobile/Documents/iGameHacks/Game/file

    There are going to be about 20-25 files in each folder.

    The app I'm going go be modifying is in the Applications folder where all of the .app's are in dynamically named folders, so I need a command to find that .app folder.

    Once it finds the .app folder, I need the postinst file to copy over the 25 files in the ../iGameHacks base folder, into the .app folder that was found in the script.

    Then I need the postrm file to copy over all the files in the ../Backups to the .app folder, and then delete the ../iGameHacks folder all together, to save space.

    I don't want the files in the .app folder be .bak'ed cause that will clutter it, which is why I made folder in the ../Documents folder.

    I have a script that does these functions with some echo commands to let the user know what is going on, although I can't show a sample until tomorrow.

    So if some one can write a dummy script that can do these things that won't create an error, they will be forever thanked & featured in my script upon each successful install so that you can be accredited for your scrip design.

    I hope I'm able to get some help here, cause I don't know where to look, and seeing that you guys host the Offical, Largest, Free, Public Cydia Repository, some one must know how to do this.

    #!/bin/bash

    cd /
    file=`find /private/var/mobile/Applications -name Game`

    cp -f /tmp/iGameHacks/Game/Backups/File $folder

    folder=`dirname $file`

    killall Game

    cp -f /tmp/iGameHacks/Game/File $folder

    exit 0
    Last edited by NicholasLAranda; 2011-09-18 at 08:45 PM.

  2. #2
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts


  3. #3
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    So no one knows why I'm getting errors??

  4. #4
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    folder=`dirname $file`
    It's likely here.

    folder=$(dirname $file) is better for bash --hope this syntax is correct. This ( ` ) caused me problems.

  5. #5
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    well how do i use $file and the file name I want to .bak?

    so like cp -a "$file/File.txt" "$file/Backups/File.bak"
    gives me an error saying the directory isnt correct and adds a var/mobile/apps/App\r/File.bak messing up the location

  6. #6
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Well I finally got help from another forum:
    #!/bin/bash
    cd /var/mobile/Applications/*/Game.app
    mkdir Backups
    cp -a ./File.ext ./Backups/File.bak
    killall Game
    mv -f /var/mobile/Documents/iGameHacks/Game/* ./
    exit 0
    One of the main things I was able to solve was to either make a new file WITHIN WinSCP or convert the file I wrote in windows using this command:
    tr -d '\15\32' <postinst> postinst2
    Then deleting the postinst & renaming postinst2 to postinst
    I also did this with the control file & postrm

    YOU HAVE TO RE-ASSIGN THE PERMISSIONS 0755 AFTER CONVERTING

    After converting the files, editing them in WinSCP kept the conversions.

    So if your on Windows, you HAVE to do the conversion at least once, then ONLY edit the file from within WinSCP.
    Last edited by NicholasLAranda; 2011-09-18 at 08:44 PM.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •