| velandy | 9d1a08d | 2016-06-27 16:48:41 +0200 | [diff] [blame^] | 1 | #!/bin/bash |
| Austin Cormier | 3a1c335 | 2016-05-23 21:46:17 -0400 | [diff] [blame] | 2 | # |
| 3 | # Copyright 2016 RIFT.IO Inc |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # Author(s): Austin Cormier |
| 18 | # Creation Date: 2016/05/23 |
| 19 | # |
| Austin Cormier | 3aeed12 | 2016-05-23 19:12:00 -0400 | [diff] [blame] | 20 | # |
| 21 | # This shell script is used to create a descriptor package |
| 22 | # The main functions of this script include: |
| 23 | # - Generate checksums.txt file |
| 24 | # - Generate a tar.gz file |
| 25 | |
| 26 | # Usage: generate_descriptor_pkg.sh <package-directory> <dest_package_dir> |
| 27 | |
| 28 | mkdir -p $1 |
| 29 | mkdir -p $2 |
| 30 | |
| 31 | dest_dir=$(cd $1 && pwd) |
| 32 | pkg_dir=$(cd $2 && pwd) |
| 33 | |
| 34 | echo $(pwd) |
| 35 | cd ${pkg_dir} |
| 36 | rm -rf checksums.txt |
| 37 | find * -type f | |
| 38 | while read file; do |
| 39 | md5sum $file >> checksums.txt |
| 40 | done |
| 41 | cd .. |
| 42 | tar -zcvf ${dest_dir}/$(basename $pkg_dir).tar.gz $(basename $pkg_dir) |