Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Add get-orig-source example featuring Files-Excluded removal of files
· 3ca51d11
Andreas Tille
authored
Mar 12, 2018
3ca51d11
Add README.test
· abd9e27c
Andreas Tille
authored
Mar 12, 2018
abd9e27c
Hide whitespace changes
Inline
Side-by-side
debian/README.test
0 → 100644
View file @
abd9e27c
Notes
on
how
this
package
can
be
tested
.
────────────────────────────────────────
This
package
can
be
tested
by
running
the
provided
test
:
sh
run
-
unit
-
test
in
order
to
confirm
its
integrity
.
debian/get-orig-source_Files-Excluded
0 → 100755
View file @
abd9e27c
#!/bin/sh -e
COMPRESS
=
xz
ONAME
=
#SOFTWARENAME#
GITHUBURL
=
https://github.com/#GITHUBTEAM#/
${
ONAME
}
NAME
=
`
dpkg-parsechangelog |
awk
'/^Source/ { print $2 }'
`
MVERSION
=
`
dpkg-parsechangelog |
awk
'/^Version:/ { print $2 }'
|
sed
-e
's/+dfsg//'
-e
's/^\([0-9][0-9\.a-z]\+\)[+~][-0-9]\+$/\1/'
`
COPYRIGHT
=
$(
pwd
)
/debian/copyright
mkdir
-p
../tarballs
cd
../tarballs
# need to clean up the tarballs dir first because upstream tarball might
# contain a directory with unpredictable name
rm
-rf
*
git clone
--quiet
$GITHUBURL
cd
${
ONAME
}
VERSION
=
${
MVERSION
}
+
`
date
-d
@
$(
git show
--format
=
"%at"
|
head
-n1
)
+%Y%m%d
`
+dfsg
# for esthetical reasons set file timestamps (if git-restore-mtime is installed)
git restore-mtime
||
true
cd
..
TARDIR
=
${
NAME
}
-
${
VERSION
}
mv
${
ONAME
}
${
TARDIR
}
rm
-rf
${
TARDIR
}
/.git
# Remove according to "Files-Excluded"
# Its a bit tricky since '*' needs to be escaped ...
for
excl
in
$(
grep
"^Files-Excluded"
${
COPYRIGHT
}
|
sed
-e
's/^Files-Excluded: *//'
-e
's/\*/\\*/g'
)
;
do
find
.
-path
"
$(
echo
$excl
|
sed
's/^\\//'
)
"
-delete
;
done
GZIP
=
"--best --no-name"
tar
--owner
=
root
--group
=
root
--mode
=
a+rX
-caf
"
$NAME
"
_
"
$VERSION
"
.orig.tar.
${
COMPRESS
}
"
${
TARDIR
}
"
rm
-rf
${
TARDIR
}