Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
package-helpers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eliab Andi Artz
package-helpers
Commits
4af35e80
Commit
4af35e80
authored
10 years ago
by
Ruben Rodriguez
Browse files
Options
Downloads
Patches
Plain Diff
Avoid setting variable ARCH in makepackage
parent
f0c77eeb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
makepackage
+30
-30
30 additions, 30 deletions
makepackage
with
30 additions
and
30 deletions
makepackage
+
30
−
30
View file @
4af35e80
...
...
@@ -87,13 +87,13 @@ disablescripts(){
createjail
()
{
[
-d
jails
]
||
mkdir
jails
CHROOT
=
jails/
$UPSTREAM
-
$ARCH
CHROOT
=
jails/
$UPSTREAM
-
$
JAIL
ARCH
C
=
"chroot
$CHROOT
"
MIRROR
=
http://mir1.ovh.net/mirrors/ftp.ubuntu.com/ubuntu
mkdir
$CHROOT
-tmp
mount
-t
tmpfs
-o
size
=
500M none
$CHROOT
-tmp
debootstrap
--arch
=
$ARCH
$UPSTREAM
$CHROOT
-tmp
$MIRROR
debootstrap
--arch
=
$
JAIL
ARCH
$UPSTREAM
$CHROOT
-tmp
$MIRROR
fuser
-k
$CHROOT
-tmp
cp
-a
$CHROOT
-tmp
$CHROOT
umount
$CHROOT
-tmp
...
...
@@ -111,7 +111,7 @@ createjail () {
echo
GPG private key
for
$GPGKEY
not found, the packages and repositories will not be signed.
fi
echo
$UPSTREAM
-
$ARCH
>
$CHROOT
/etc/debian_chroot
echo
$UPSTREAM
-
$
JAIL
ARCH
>
$CHROOT
/etc/debian_chroot
cat
<<
EOF
>
$CHROOT
/etc/apt/sources.list
deb
$MIRROR
$UPSTREAM
main universe
deb
$MIRROR
$UPSTREAM
-updates main universe
...
...
@@ -143,7 +143,7 @@ EOF
$C
apt-key add /tmp/key.gpg
# Hack for i386
if
[
$ARCH
=
"i386"
]
if
[
$
JAIL
ARCH
=
"i386"
]
then
for
BIN
in
/bin/uname /usr/bin/arch
do
...
...
@@ -166,8 +166,8 @@ umount $CHROOT/proc $CHROOT/dev/pts
}
prepare
(){
[
-d
jails/
$UPSTREAM
-
$ARCH
]
||
createjail
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/tmp/update
[
-d
jails/
$UPSTREAM
-
$
JAIL
ARCH
]
||
createjail
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp/update
mount -t proc none /proc
export DEBIAN_FRONTEND=noninteractive
export LANG=C
...
...
@@ -182,34 +182,34 @@ export DEBIAN_FRONTEND=noninteractive
apt-get --force-yes -y dist-upgrade
umount /proc
EOF
chroot
jails/
$UPSTREAM
-
$ARCH
bash /tmp/update
if
[
-f
jails/
$UPSTREAM
-
$ARCH
/CurrentlyBuilding
]
chroot
jails/
$UPSTREAM
-
$
JAIL
ARCH
bash /tmp/update
if
[
-f
jails/
$UPSTREAM
-
$
JAIL
ARCH
/CurrentlyBuilding
]
then
echo
The
$UPSTREAM
-
$ARCH
jail appears to be running
$(
cat
jails/
$UPSTREAM
-
$ARCH
/CurrentlyBuilding |grep Package: |sed
's/Package:\ //'
)
, aborting.
echo
The
$UPSTREAM
-
$
JAIL
ARCH
jail appears to be running
$(
cat
jails/
$UPSTREAM
-
$
JAIL
ARCH
/CurrentlyBuilding |grep Package: |sed
's/Package:\ //'
)
, aborting.
exit
1
fi
CHROOT
=
jails/
$UPSTREAM
-
$ARCH
disablescripts
CHROOT
=
jails/
$UPSTREAM
-
$
JAIL
ARCH
disablescripts
}
tmpumount
(){
grep
jails/
$UPSTREAM
-
$ARCH
/tmp /proc/mounts
-q
||
return
0
umount jails/
$UPSTREAM
-
$ARCH
/tmp
&&
return
echo
ERROR: could not umount tmpfs at jails/
$UPSTREAM
-
$ARCH
/tmp
grep
jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp /proc/mounts
-q
||
return
0
umount jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp
&&
return
echo
ERROR: could not umount tmpfs at jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp
exit
1
}
tmpmount
(){
[
$MEM
-lt
16000000
]
&&
return
grep
jails/
$UPSTREAM
-
$ARCH
/tmp /proc/mounts
-q
&&
tmpumount
grep
jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp /proc/mounts
-q
&&
tmpumount
echo
$PACKAGE
|
grep
-q
"linux"
&&
return
mount
-t
tmpfs
-o
size
=
15G none jails/
$UPSTREAM
-
$ARCH
/tmp
mount
-t
tmpfs
-o
size
=
15G none jails/
$UPSTREAM
-
$
JAIL
ARCH
/tmp
}
compile
(){
[
-d
jails/
$UPSTREAM
-
$ARCH
/
$WORKDIR
]
&&
rm
-rf
jails/
$UPSTREAM
-
$ARCH
/
$WORKDIR
/
[
-d
jails/
$UPSTREAM
-
$
JAIL
ARCH
/
$WORKDIR
]
&&
rm
-rf
jails/
$UPSTREAM
-
$
JAIL
ARCH
/
$WORKDIR
/
tmpmount
cp
-a
helpers/ jails/
$UPSTREAM
-
$ARCH
/
$WORKDIR
/
cp
-a
helpers/ jails/
$UPSTREAM
-
$
JAIL
ARCH
/
$WORKDIR
/
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/usr/local/sbin/makepackage-handler
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/usr/local/sbin/makepackage-handler
#!/bin/bash
WORKDIR=
$WORKDIR
PACKAGE=
$PACKAGE
...
...
@@ -221,7 +221,7 @@ export PATH="/usr/lib/ccache:${PATH}"
bash -e make-
$PACKAGE
2>&1 || exit 1
EOF
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/etc/pkgbinarymangler/striptranslations.conf
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/etc/pkgbinarymangler/striptranslations.conf
enable: true
components: main
invalid_currentlybuilding: ignore
...
...
@@ -229,36 +229,36 @@ posuffix: translations
oem_blacklist: partner
EOF
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/etc/pkgbinarymangler/sanitychecks.conf
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/etc/pkgbinarymangler/sanitychecks.conf
enable: true
EOF
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/etc/pkgbinarymangler/maintainermangler.conf
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/etc/pkgbinarymangler/maintainermangler.conf
enable: true
invalid_currentlybuilding: ignore
EOF
cat
<<
EOF
> jails/
$UPSTREAM
-
$ARCH
/etc/pkgbinarymangler/maintainermangler.overrides
cat
<<
EOF
> jails/
$UPSTREAM
-
$
JAIL
ARCH
/etc/pkgbinarymangler/maintainermangler.overrides
default: Trisquel GNU/Linux developers <trisquel-devel@listas.trisquel.info>
ignore_domains: trisquel.info sognus.com listas.trisquel.info gnu.org fsf.org
ignore_emails: ruben@trisquel.info
EOF
chmod
755 jails/
$UPSTREAM
-
$ARCH
/usr/local/sbin/makepackage-handler
chmod
755 jails/
$UPSTREAM
-
$
JAIL
ARCH
/usr/local/sbin/makepackage-handler
if
!
chroot
jails/
$UPSTREAM
-
$ARCH
makepackage-handler /
$WORKDIR
/make-
$PACKAGE
if
!
chroot
jails/
$UPSTREAM
-
$
JAIL
ARCH
makepackage-handler /
$WORKDIR
/make-
$PACKAGE
then
rm
jails/
$UPSTREAM
-
$ARCH
/CurrentlyBuilding
rm
jails/
$UPSTREAM
-
$
JAIL
ARCH
/CurrentlyBuilding
exit
1
fi
find jails/
$UPSTREAM
-
$ARCH
/
$WORKDIR
/PACKAGES/
$PACKAGE
/
-maxdepth
1
-type
f
-exec
cp
{}
$REPOSITORY
/incoming/
\;
find jails/
$UPSTREAM
-
$
JAIL
ARCH
/
$WORKDIR
/PACKAGES/
$PACKAGE
/
-maxdepth
1
-type
f
-exec
cp
{}
$REPOSITORY
/incoming/
\;
tmpumount
}
ARCH
=
i386 prepare
ARCH
=
amd64 prepare
ARCH
=
i386 compile
ARCH
=
amd64 compile
JAIL
ARCH
=
i386 prepare
JAIL
ARCH
=
amd64 prepare
JAIL
ARCH
=
i386 compile
JAIL
ARCH
=
amd64 compile
cd
$REPOSITORY
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment