make-tarball 1.1 KB

12345678910111213141516171819
  1. #!/bin/sh
  2. [ ! -e distro/dev-tools/scripts/make-tarball ] && exec echo Please execute '"distro/dev-tools/scripts/make-tarball"' under hime directory, thanks.
  3. XZ_OPT=${XZ_OPT-"-5e"}
  4. VER_1=`head -n 1 ChangeLog`
  5. # Remove space, tab, BOM
  6. VER_2=`sed -e 's/ //g' -e 's/ //g' -e 's/\t//g' -e 's/\xef\xbb\xbf//g' ChangeLog | grep -v ^$ | head -n 1`
  7. [ "$VER_1" != "$VER_2" ] && exec echo Warning! Version number in ChangeLog has some problem, please fix it!
  8. echo -n "ChangeLog: "
  9. head -n 1 ChangeLog
  10. GIT_DIR_NAME="${PWD##*/}"
  11. TAR_NAME=hime-`head -n 1 ChangeLog`
  12. cd ..
  13. [ -e "$TAR_NAME" ] && exec echo "$TAR_NAME" exist. exit.
  14. [ -e "$TAR_NAME".tar.xz ] && exec echo "$TAR_NAME".tar.xz exist. exit.
  15. [ -e "$TAR_NAME".dfsg.orig.tar.xz ] && exec echo "$TAR_NAME".dfsg.orig.tar.xz exist. exit.
  16. cp -r $GIT_DIR_NAME $TAR_NAME
  17. tar --owner=0 --group=0 -Jcf "$TAR_NAME".tar.xz $TAR_NAME --exclude=.gitignore --exclude=.git
  18. tar --owner=0 --group=0 -Jcf "$TAR_NAME".dfsg.orig.tar.xz $TAR_NAME --exclude=.gitignore --exclude=.git --exclude=dayi3.cin
  19. ls -ald "$TAR_NAME".tar.xz "$TAR_NAME".dfsg.orig.tar.xz