[go: up one dir, main page]

File: urepack

package info (click to toggle)
setools 3.3.8-3.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,932 kB
  • ctags: 7,866
  • sloc: ansic: 83,088; tcl: 13,141; cpp: 4,885; makefile: 1,614; yacc: 788; lex: 297; python: 57; sh: 50
file content (55 lines) | stat: -rw-r--r-- 1,592 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh 

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

# This is heavily based on work done by Bernd Zeimetz, and has been
# extended slightly.

set -e


#command --upstream-version version filename
[ $# -eq 3 ] || exit 255
version="$2"
filename="$3"


echo >&2 ''
echo >&2 "        Starting to get ${filename} "

# Unpack, and find the directory it unpacked into
tar xfj ${filename} 
dir=`tar tfj ${filename} | head -1 | sed 's,/.*,,g'`

# Package specific cleanups
DIRS_TO_REMOVE=${dir}/debian
FILES_TO_REMOVE=${filename}

echo >&2 "        Munging ${filename} ==> ${filename%%.orig.tar.bz2}.ds.orig.tar.gz"
rm -f  ${FILES_TO_REMOVE}
rm -rf ${DIRS_TO_REMOVE}

# Any additional cleanup goes in here
: echo ''


# rename, repack, cleanup
mv ${dir} ${dir}.ds.orig
tar cf - ${dir}.ds.orig | gzip -9 > ${filename%%.orig.tar.bz2}.ds.orig.tar.gz
rm -rf ${dir}.ds.orig

echo >&2 "        ${filename%%.orig.tar.gz}.ds.orig.tar.gz created."