Zero-byte Application being installed from pkgbuild generated .pkg installer - macos

this is the shell script that I use to generate the .pkg installer.
#!/bin/bash
APP_PATH=$1
DSYM_PATH=$2
PKG_PATH=$3
IDENTIFIER=$4
VERSION=$5
TARGET_DIR=$(dirname "$APP_PATH")/temp
echo "Deleting old Pkg File."
rm -rf $PKG_PATH
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
echo "Done."
echo "Copying APP \"$APP_PATH\" and dSYM \"$DSYM_PATH \" to temp folder."
cp -a $APP_PATH $TARGET_DIR
cp -a $DSYM_PATH $TARGET_DIR
echo "Done."
echo "Generating .Pkg file with dSYM folder"
/usr/bin/pkgbuild \
--root "$TARGET_DIR" \
--install-location "/Applications" \
--identifier "$IDENTIFIER" \
--version "$VERSION" \
"$PKG_PATH"
echo "Done Generating \"$APP_PATH\" with dSYM folder"
This .pkg is installed to /Applications folder but it's zero byte in size.
I've tried to change the permission of the files but it's no use.

To solve this issue, I had to change the permissions for files.
I've added the following line in the script.
chmod -R 755 $TARGET_DIR
The file with wrong permission will result a zero-bytes installation.
#!/bin/bash
APP_PATH=$1
DSYM_PATH=$2
PKG_PATH=$3
IDENTIFIER=$4
VERSION=$5
TARGET_DIR=$(dirname "$APP_PATH")/temp
echo "Deleting old Pkg File."
rm -rf $PKG_PATH
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
echo "Done."
echo "Copying APP \"$APP_PATH\" and dSYM \"$DSYM_PATH \" to temp folder."
cp -a $APP_PATH $TARGET_DIR
cp -a $DSYM_PATH $TARGET_DIR
echo "Done."
chmod -R 755 $TARGET_DIR
echo "Generating .Pkg file with dSYM folder"
/usr/bin/pkgbuild \
--root "$TARGET_DIR" \
--install-location "/Applications" \
--identifier "$IDENTIFIER" \
--version "$VERSION" \
"$PKG_PATH"
echo "Done Generating \"$APP_PATH\" with dSYM folder"

Related

chmod +x cant find build.sh file

I have been trying to make a VCS in C++ but the build file is not running in my LINUX(Ubuntu).
It is prompting the above message.
my build file is as follows:
#!/bin/bash
sudo apt-get update
udo apt-get install openssl -y
sudo apt-get install libssl-dev -y
mkdir -p ~/imperium/bin
cp imperium.sh ~/imperium
cd ..
make
cd ~/imperium/bin || echo "error"
chmod +x main
cd ..
if grep -q "source $PWD/imperium.sh" "$PWD/../.bashrc" ; then
echo 'already installed bash source';
else
echo "source $PWD/imperium.sh" >> ~/.bashrc;
fi
my imperium.sh file is also as follows:
function imperium(){
DIR=$PWD
export dir=$DIR
cd ~/imperium/bin || echo "Error"
./main "$#"
cd "$DIR" || echo "Error"
}
I will be heavily obliged if any one can solve this problem of mine. After chmod I have been doing:
./build.sh but its prompting that build.sh file does not exists.
For me it seems you have a typo right in the 3rd row "udo" ->
"sudo".
Also, You should avoid using cd .. and use relative paths for
the commands.

zip warning: 'name not matched' inside bash loop for

I'm trying to build a plugin which has the following base script inside its makefile:
$(ZIP_FILE):
git archive --format zip --prefix $(NAME)/ --output $(ZIP_FILE) HEAD
mkdir -p $(NAME)/resources/bin
ln -s `pwd`/addon.xml $(NAME)
zip -9 -r -g $(ZIP_FILE) $(NAME)/addon.xml
for arch in $(ARCHS); do \
ln -s `pwd`/resources/bin/$$arch $(NAME)/resources/bin/$$arch; \
zip -9 -r -g $(ZIP_FILE) $(NAME)/resources/bin/$$arch; \
done
Yet, I can't figure out why this error pops up every time:
zip warning: name not matched: plugin.video.pulsar/resources/bin/windows_x86
And repeats for each arch....??
P.S. this is what it looks like inside terminal:
git archive --format zip --prefix plugin.video.pulsar/ --output plugin.video.pulsar-0.4.6.zip HEAD
mkdir -p plugin.video.pulsar/resources/bin
ln -s `pwd`/addon.xml plugin.video.pulsar
zip -9 -r -g plugin.video.pulsar-0.4.6.zip plugin.video.pulsar/addon.xml
updating: plugin.video.pulsar/addon.xml (deflated 59%)
for arch in windows_x86 darwin_x64 linux_x86 linux_x64 linux_arm; do \
ln -s `pwd`/resources/bin/$arch plugin.video.pulsar/resources/bin/$arch; \
zip -9 -r -g plugin.video.pulsar-0.4.6.zip plugin.video.pulsar/resources/bin/$arch; \
done
zip warning: name not matched: plugin.video.pulsar/resources/bin/windows_x86
zip error: Nothing to do! (try: zip -9 -r -g plugin.video.pulsar-0.4.6.zip . -i plugin.video.pulsar/resources/bin/windows_x86)
zip warning: name not matched: plugin.video.pulsar/resources/bin/darwin_x64
It's because that file (plugin.video.pulsar/resources/bin/windows_x86) really does not exist.

inotifywait adding multiple files at ones

this shell script should add everything put in the folder to transmission. With one folder it works fine, but when i add more then one folder at the same moment it ignores the second one.
while true;
do
file=$(inotifywait -e moved_to --format %f /srv/watchfolderfilme)
file="/srv/watchfolderfilme/$file"
transmission-create -o $file.torrent -s 16384 -t http://0.0.0.0:6969/announce $file
mv $file /srv/downloads
chmod 0777 $file.torrent
cp $file.torrent /srv/newtorrentfiles
mv $file.torrent /srv/watchfoldertorrents
done
Rethough my solution and found a better one that works fine for multiple adds
inotifywait -m /srv/watchfolderfilme -e create -e moved_to |
while read path action file; do
# echo "The file '$file' appeared in directory '$path' via '$action'"
chmod 0777 $path$file
transmission-create -o /srv/newtorrentfiles/$file.torrent -s 16384 -t http://0.0.0.0:6969/announce $path$file
mv $path$file /srv/downloads
chmod 0777 /srv/newtorrentfiles/$file.torrent
cp /srv/newtorrentfiles/$file.torrent /srv/watchfoldertorrents
done

Unable to install parse.com command line tool on Mac OSX 10.10 Yosemite

Running the command
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
does not install the tool
I was able to install it easily on my other computer running 10.9.2
STEP : 1
Make a copy of this
#!/bin/bash
TMP_FILE=/tmp/parse.tmp
if [ -e /tmp/parse.tmp ]; then
echo "Cleaning up from previous install failure"
rm -f /tmp/parse.tmp
fi
echo "Fetching latest version ..."
curl --progress-bar https://www.parse.com/downloads/cloud_code/parse -o /tmp/parse.tmp
if [ ! -d /usr/local/bin ]; then
echo "Making /usr/local/bin"
mkdir -p /usr/local/bin
fi
echo "Installing ..."
mv /tmp/parse.tmp /usr/local/bin/parse
chmod 755 /usr/local/bin/parse `
to a file named install.sh and run it in your terminal as bash install.sh. This will install you parse in your Terminal.
STEP :2
Download the Gist from this link and run the file named install.sh in your Terminal preceded by bash

How to package ANE file in windows using cmd?

I want to package my native extension .jar (Android JAVA side) and .swc(ActionScript side) files into a ANE (Air Native Extension) file in windows 7 using command line and adt commands i have two .sh files (Mac OS) that can package the ANE file just by running them i don't have any idea how to write a .bat or .sh file so i couldn't find out how to translate .sh to a .bat file so i'm looking for some help to translate .sh commands into a .bat commands for windows users. I think it can help so many air developers .... :)
Build.sh :
adt="/Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/bin/adt"
nativedir="/Users/markhood/Documents/Eclipse64/ANESample_java"
echo "********************************************************************"
echo " - creating ANE package"
rm -rf Android-ARM/*
rm -f SampleASExtension.ane library.swf
mkdir -p Android-ARM
unzip ../ANESample/bin/ANESample.swc library.swf
cp library.swf Android-ARM
cp "$nativedir"/ANESample.jar Android-ARM
cp -r "$nativedir"/res Ansion.xml -swc ../ANESample/bin/ANESample.swc -platform Android-ARM -C Android-ARM .ndroid-ARM
"$adt" -package -target ane SampleASExtension.ane extension.xml -swc ../ANESample/bin/ANESample.swc -platform Android-ARM -C Android-ARM .
#"$adt" -package -storetype PKCS12 -keystore cer.p12 -storepass password -target ane SampleASExtension.ane exte
BuildANE.sh
# path to YOUR Android SDK
export AIR_ANDROID_SDK_HOME="/Users/leebrimelow/Documents/SDKs/android-sdk/"
# path to the ADT tool in Flash Builder sdks
ADT="/Applications/Adobe Flash Builder 4.5/sdks/4.5.0/bin/adt"
# native project folder
NATIVE_FOLDER=jar
# AS lib folder
LIB_FOLDER=lib
# app folder
APP_PROJECT=NotifyApp
# name of ANE file
ANE_NAME=notification.ane
# JAR filename
JAR_NAME=notification.jar
# APK name
APK_NAME=NotifyApp.apk
# cert path
CERT_NAME=cert.p12
# cert password
CERT_PASS=password
#===================================================================
echo "****** preparing ANE package sources *******"
rm ${ANE_NAME}
rm -rf ./build/ane
mkdir -p ./build/ane
mkdir -p ./build/ane/Android-ARM
mkdir -p ./build/ane/Android-ARM/res
#copy resources
cp -R ./${NATIVE_FOLDER}/res/* ./build/ane/Android-ARM/res
# create the JAR file
jar cf ./build/ane/Android-ARM/${JAR_NAME} -C ./${NATIVE_FOLDER}/bin .
# grab the extension descriptor and SWC library
cp ./${LIB_FOLDER}/src/extension.xml ./build/ane/
cp ./${LIB_FOLDER}/bin/*.swc ./build/ane/
unzip ./build/ane/*.swc -d ./build/ane
mv ./build/ane/library.swf ./build/ane/Android-ARM
echo "****** creating ANE package *******"
"$ADT" -package -storetype PKCS12 -keystore ./cert.p12 -storepass password -tsa none \
-target ane \
${ANE_NAME} \
./build/ane/extension.xml \
-swc ./build/ane/*.swc \
-platform Android-ARM \
-C ./build/ane/Android-ARM/ .
echo "****** ANE package created *******"
echo "****** preparing APK package sources *******"
rm ${APK_NAME}
rm -rf ./build/apk
mkdir -p ./build/apk
cp ./${APP_PROJECT}/bin-debug/${APP_PROJECT}-app.xml ./build/apk
cp ./${APP_PROJECT}/bin-debug/${APP_PROJECT}.swf ./build/apk
echo "****** creating APK package *******"
cd ./build/apk
"$ADT" -package -target apk -storetype PKCS12 -keystore ../../${CERT_NAME} -storepass ${CERT_PASS} \
../../${APK_NAME} \
./${APP_PROJECT}-app.xml \
./${APP_PROJECT}.swf -extdir ../..
cd ../..
echo "****** APK package created *******"
adb uninstall air.${APP_PROJECT}.debug
adb install ${APK_NAME}
I would recommend building it with ANT instead. It is more easily converted between Mac and Windows. Take a look at PushWoosh's ANE build scripts as an example. They are well done and easy to use. https://github.com/shaders/push-notifications-sdk/tree/master/SDK%20Sample%20Projects/AdobeAir/ANE-Pushwoosh/build

Resources