File: new-upstream

package info (click to toggle)
libstevesoft-regex-java 1.5.3-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 752 kB
  • ctags: 1,343
  • sloc: java: 11,551; xml: 20; makefile: 18; sh: 13
file content (35 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# new-upstream: copyright 2009 by Vincent Fourmond.
# This script simply repackages the original jarball into a real tarball.
#
# Called by uscan; from uscan(1):
#
# Finally,  if a third parameter (an action) is given in the watchfile
# line, this is taken as the name of a command, and the command
#  command --upstream-version version filename
# 
# is executed, using either the original file or the symlink name.
#
# Thanks to Sam Morris <sam@robots.org.uk> for giving me the idea
#

version=$2
filename=$3

dir=`mktemp -d`
target_dir=$dir/libstevesoft-regex-java-$version/src

# We repackage the upstream source zip file:
mkdir -p $target_dir
unzip "$filename" -d "$target_dir"
origname=libstevesoft-regex-java_$version.orig.tar.gz

# We repackage excluding the lib/ subdir
cd $dir
echo "Creating archive"
tar cvz -f $origname lib*
cd -
# We remove any file already existing there: it might be a symlink.
rm -f $orginame 
mv $dir/$origname ..