Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uplex-varnish-dpkg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
uplex-varnish-dpkg
Commits
7559b2c9
Commit
7559b2c9
authored
Nov 29, 2018
by
Julian Wiesener
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make varnish version based on official weekly
parent
ff39debb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
4 deletions
+139
-4
buildall
bin/buildall
+24
-4
builddpkg
bin/builddpkg
+1
-0
getvarnishabi.py
bin/getvarnishabi.py
+114
-0
No files found.
bin/buildall
View file @
7559b2c9
...
...
@@ -21,23 +21,43 @@ build_dist () {
if
[
"
${
dpkg
}
"
==
"__push_repo"
]
;
then
push_repo
||
exit
1
else
TERR
=
0
VERSION
=
"
${
VERSION
}
"
DEBRELEASE
=
"
${
DEBRELEASE
}
"
\
ARCH
=
"
${
ARCH
}
"
builddpkg
${
dpkg
}
||
let
ERR+
=
1
ARCH
=
"
${
ARCH
}
"
builddpkg
${
dpkg
}
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
.log 2>&1
||
let
TERR
=
1
if
[
$TERR
-ne
0
]
;
then
echo
"failed:
${
dpkg
}
"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
fi
let
ERR+
=
$TERR
fi
done
echo
"Build for
${
DEBRELEASE
}
done with
$ERR
failed packages"
if
[
$ERR
-eq
0
]
;
then
echo
"buildall: done"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
else
echo
"buildall:
$ERR
packages failed"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
fi
echo
"Build for
${
DEBRELEASE
}
done with
$ERR
failed packages"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
.log
return
$ERR
}
push_repo
()
{
aptly repo add
${
DEBRELEASE
}
"
${
SBUILDDIR
}
"
||
return
1
aptly publish update
"
${
DEBRELEASE
}
"
||
return
1
aptly repo add
${
DEBRELEASE
}
"
${
SBUILDDIR
}
"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
.log 2>&1
||
return
1
aptly publish update
"
${
DEBRELEASE
}
"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
.log 2>&1
||
return
1
return
0
}
if
[
-z
"
${
VERSION
}
"
]
;
then
VERSION
=
$(
date
"+%Y%m%d"
)
fi
if
[
-z
"
${
VARNISHABI
}
"
]
;
then
VARNISHABI
=
$(${
PREFIX
}
/bin/getvarnishabi.py
)
if
[
$?
-ne
0
]
;
then
exit
1
fi
fi
sed
-i
'/^GIT_CHEKOUT/d'
varnish/overrides
||
exit
1
echo
"GIT_CHEKOUT=
${
VARNISHABI
}
"
>>
varnish/overrides
||
exit
1
if
[
-z
"
${
DEBRELEASE
}
"
]
;
then
...
...
bin/builddpkg
View file @
7559b2c9
...
...
@@ -84,3 +84,4 @@ fi
cd
"
${
SBUILDDIR
}
"
||
exit
1
sbuild
-d
${
DEBRELEASE
}
--arch
=
${
ARCH
}
${
SRCDIR
}
||
exit
1
rm
${
BUILDDIR
}
/
${
PKGNAME
}
_
${
FULL_VERSION
}*
echo
"success:
${
PKGNAME
}
_
${
FULL_VERSION
}
"
>>
/tmp/pkgbuild_
${
DEBRELEASE
}
_
${
VERSION
}
bin/getvarnishabi.py
0 → 100755
View file @
7559b2c9
#!/usr/bin/env python
#
# Copyright (c) 2018 UPLEX Nils Goroll Systemoptimierung
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
import
sys
,
re
,
pycurl
,
StringIO
class
pkg
:
name
=
None
version
=
None
provides
=
None
def
__init__
(
self
):
self
.
name
=
str
()
self
.
version
=
str
()
self
.
provides
=
list
()
def
parse_pkgdata
(
url
):
match_lines
=
re
.
compile
(
"^[aA-zZ]*: "
)
packages
=
list
()
tpkg
=
pkg
()
res
=
StringIO
.
StringIO
()
curl
=
pycurl
.
Curl
()
curl
.
setopt
(
curl
.
FOLLOWLOCATION
,
True
)
curl
.
setopt
(
curl
.
URL
,
url
)
curl
.
setopt
(
curl
.
WRITEFUNCTION
,
res
.
write
)
curl
.
perform
()
rval
=
curl
.
getinfo
(
curl
.
HTTP_CODE
)
if
rval
!=
200
:
sys
.
stderr
.
write
(
"Curl error(
%
i)
\n
"
%
rval
)
return
pkgdata
=
res
.
getvalue
()
.
split
(
'
\n
'
)
for
line
in
pkgdata
:
if
not
len
(
line
.
strip
()):
packages
.
append
(
tpkg
)
tpkg
=
pkg
()
continue
if
match_lines
.
match
(
line
):
k
,
v
=
line
.
split
(
':'
,
1
)
if
k
.
strip
()
.
lower
()
==
"package"
:
tpkg
.
name
=
v
.
strip
()
elif
k
.
strip
()
.
lower
()
==
"version"
:
tpkg
.
version
=
v
.
strip
()
if
k
.
strip
()
.
lower
()
==
"provides"
:
for
p
in
v
.
split
(
','
):
p
=
p
.
strip
()
if
len
(
p
):
tpkg
.
provides
.
append
(
p
)
return
packages
def
newest_pkg
(
packages
,
name
):
tpkg
=
None
for
pkg
in
packages
:
if
pkg
.
name
!=
name
:
continue
if
not
tpkg
:
tpkg
=
pkg
continue
if
pkg
.
version
>
tpkg
.
version
:
tpkg
=
pkg
return
tpkg
def
get_abi
(
provides
):
for
pv
in
provides
:
try
:
k
,
v
=
pv
.
rsplit
(
'-'
,
1
)
if
k
==
"varnishd-abi"
:
return
v
except
(
ValueError
):
pass
def
main
():
packages
=
parse_pkgdata
(
"https://packagecloud.io/varnishcache/varnish-weekly/debian/dists/stretch/main/binary-amd64/Packages"
)
if
not
packages
:
sys
.
stderr
.
write
(
"No package data found
\n
"
)
sys
.
exit
(
1
)
pkg
=
newest_pkg
(
packages
,
"varnish"
)
if
not
pkg
:
sys
.
stderr
.
write
(
"No varnish package found
\n
"
)
sys
.
exit
(
1
)
abi
=
get_abi
(
pkg
.
provides
)
if
not
abi
:
sys
.
stderr
.
write
(
"No abi found in package data
\n
"
)
sys
.
exit
(
1
)
print
abi
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment