Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
bc6a8db7
Commit
bc6a8db7
authored
Feb 09, 2010
by
Yuri Fil
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.eter:/people/lav/packages/etersoft-build-utils
parents
f68de8a6
4fbab460
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
439 additions
and
239 deletions
+439
-239
Makefile
Makefile
+2
-0
NEWS
NEWS
+11
-0
TODO
TODO
+66
-62
gpull
bin/gpull
+4
-2
gpush
bin/gpush
+6
-1
rpmbb
bin/rpmbb
+4
-3
rpmbph
bin/rpmbph
+56
-56
rpmbs
bin/rpmbs
+21
-14
rpmbsh
bin/rpmbsh
+7
-6
rpmbugs
bin/rpmbugs
+24
-21
rpmcs
bin/rpmcs
+6
-0
rpmgp
bin/rpmgp
+4
-9
rpmgs
bin/rpmgs
+118
-43
rpmpub
bin/rpmpub
+4
-1
rpmqf
bin/rpmqf
+2
-2
rpmrb
bin/rpmrb
+3
-1
rpmunmets
bin/rpmunmets
+3
-3
rpmurl
bin/rpmurl
+10
-13
etersoft-build-utils.sh
etc/bashrc.d/etersoft-build-utils.sh
+6
-0
etersoft-build-utils.spec
etersoft-build-utils.spec
+9
-1
rpm
share/eterbuild/functions/rpm
+7
-1
tarball
share/eterbuild/functions/tarball
+28
-0
web
share/eterbuild/functions/web
+15
-0
get_source_url.sh
tests/get_source_url.sh
+23
-0
No files found.
Makefile
View file @
bc6a8db7
...
@@ -14,6 +14,7 @@ install:
...
@@ -14,6 +14,7 @@ install:
$(MAKE)
-C
po
install
$(MAKE)
-C
po
install
mkdir
-p
$(DESTDIR)$(bindir)
mkdir
-p
$(DESTDIR)$(bindir)
mkdir
-p
$(DESTDIR)$(sysconfdir)
/eterbuild/apt
$(DESTDIR)$(sysconfdir)
/rpm
mkdir
-p
$(DESTDIR)$(sysconfdir)
/eterbuild/apt
$(DESTDIR)$(sysconfdir)
/rpm
mkdir
-p
$(DESTDIR)$(sysconfdir)
/bashrc.d/
mkdir
-p
$(DESTDIR)$(pkgdatadir)
/functions/
mkdir
-p
$(DESTDIR)$(pkgdatadir)
/functions/
mkdir
-p
$(DESTDIR)$(pkgdatadir)
/pkgrepl
$(DESTDIR)$(pkgdatadir)
/grprepl/
mkdir
-p
$(DESTDIR)$(pkgdatadir)
/pkgrepl
$(DESTDIR)$(pkgdatadir)
/grprepl/
install
-m
755 bin/
*
$(DESTDIR)$(bindir)
install
-m
755 bin/
*
$(DESTDIR)$(bindir)
...
@@ -21,6 +22,7 @@ install:
...
@@ -21,6 +22,7 @@ install:
install
-m
644 etc/rpm/
*
$(DESTDIR)$(sysconfdir)
/rpm/
install
-m
644 etc/rpm/
*
$(DESTDIR)$(sysconfdir)
/rpm/
install
-m
644 etc/config
$(DESTDIR)$(sysconfdir)
/eterbuild/
install
-m
644 etc/config
$(DESTDIR)$(sysconfdir)
/eterbuild/
install
-m
644 etc/repos
$(DESTDIR)$(sysconfdir)
/eterbuild/
install
-m
644 etc/repos
$(DESTDIR)$(sysconfdir)
/eterbuild/
install
-m
644 etc/bashrc.d/
*
$(DESTDIR)$(sysconfdir)
/bashrc.d/
install
-m
644 share/eterbuild/pkgrepl/pkgrepl.
*
$(DESTDIR)$(pkgdatadir)
/pkgrepl/
install
-m
644 share/eterbuild/pkgrepl/pkgrepl.
*
$(DESTDIR)$(pkgdatadir)
/pkgrepl/
install
-m
644 share/eterbuild/grprepl/grprepl.
*
$(DESTDIR)$(pkgdatadir)
/grprepl/
install
-m
644 share/eterbuild/grprepl/grprepl.
*
$(DESTDIR)$(pkgdatadir)
/grprepl/
install
-m
644 share/eterbuild/eterbuild
$(DESTDIR)$(pkgdatadir)
/
install
-m
644 share/eterbuild/eterbuild
$(DESTDIR)$(pkgdatadir)
/
...
...
NEWS
View file @
bc6a8db7
etersoft-build-utils-1.7.6: 05 Feb 2010
- add bashrc.d aliases apti, apts, aptw, finds
- rpmgp: fix src.rpm import, allow to use several files
- set package related variables after pack_srpm, add full filepath to LISTBUILT
- introduce querypackage and build_rpms_name_by_srpm, use it in all cases
- convert repo to utf8
- rpmgs: add real source support (for Source-svn, Source-url commented lines)
- rpmbph: do not add rpm-build-compat buildreq to backported specs
- rpmbs: do log task number
- gpush: do ginit if no remote aliases
etersoft-build-utils-1.7.5: 22 Jan 2010
etersoft-build-utils-1.7.5: 22 Jan 2010
- rpmbs/rpmbsh: add -l option for lazy-cleanup after build
- rpmbs/rpmbsh: add -l option for lazy-cleanup after build
- rpmgs: check dir with the same as package name firstly
- rpmgs: check dir with the same as package name firstly
...
...
TODO
View file @
bc6a8db7
rpmgp -b - apt-get build-dep,
Исправить ситуацию для 27.5.1 (MINOR - 1, MAJOR 27.5 должно быть), почему стирается %revision
lib, %files:
# Source-git: http://git.altlinux.org/people/lav/packages/rpm-build-fonts.git
# Source-md5: 792f3012eae343bc04314b868f6fd1b9
Если пакет начинается с lib, добавлять перед %files:
%post -p %post_ldconfig
%post -p %post_ldconfig
%postun -p %postun_ldconfig
%postun -p %postun_ldconfig
backports
для
backports
- upload.SS
rpmbs -u ??
Что-то пишет пакет в upload.SS при простом
rpmbs -u ??
http://git.altlinux.org/people/kharpost/packages/gitalt-tasker.git?p=gitalt-tasker.git;a=blob;f=gitalt-tasker/git-task;h=81e0261813a9fe2be230fb0c47b4ff4efd9a2675;hb=bfcc80b9af49b8ea0629db80d4c2f29a024d574e
http://git.altlinux.org/people/kharpost/packages/gitalt-tasker.git?p=gitalt-tasker.git;a=blob;f=gitalt-tasker/git-task;h=81e0261813a9fe2be230fb0c47b4ff4efd9a2675;hb=bfcc80b9af49b8ea0629db80d4c2f29a024d574e
korinf
не раобтает указание целевого каталога в
korinf
:
Добавить поддержку в спеке служебного комментария для автоматической перепаковки исходников
:
gear
Учитывать
gear
# etersoft-build-utils repack DIR -
DIR
NAME-VERSION
# etersoft-build-utils repack DIR -
упаковать DIR в архив с названием
NAME-VERSION
# etersoft-build-utils remove DIR/FILE [DIR/FILE] -
# etersoft-build-utils remove DIR/FILE [DIR/FILE] -
удалить указанные каталоги и файлы и упаковать
:
Удаление пакета из Сизифа
:
ssh git.alt task new
ssh git.alt task new
ssh git.alt task add del PACKAGE
ssh git.alt task add del PACKAGE
ssh git.alt task run
ssh git.alt task run
...
@@ -27,13 +31,13 @@ task #9430: added #1: delete package python-module-pyclamav from sisyphus
...
@@ -27,13 +31,13 @@ task #9430: added #1: delete package python-module-pyclamav from sisyphus
task #9430: queued, result will be emailed to lav@altlinux.org
task #9430: queued, result will be emailed to lav@altlinux.org
:
сделать раскрытие версии и имени пакета
:
fonts-ttf-%fname-1.04-alt1.src.rpm
fonts-ttf-%fname-1.04-alt1.src.rpm
apt-cache list-extras
apt-cache list-extras
BuildArch: noarch
Нужно убирать BuildArch: noarch при бэкпортировании
Нужно добавлять устаревшие ныне секции при бэкпортировании
todo rebuild:
todo rebuild:
...
@@ -44,61 +48,61 @@ exec time rpmbuild --target="\$target" $nodeps -bs "\$@"
...
@@ -44,61 +48,61 @@ exec time rpmbuild --target="\$target" $nodeps -bs "\$@"
!!
!!
, ,
Изменить порядок поиска замен, чтобы он происходил без базовой версии, а замены от предыдущей версии
( ). ,
,
действовали на следующие (тогда нужно вводить понятие порядка версий). Таким образом, файл с общими заменами не нужен
,
.
а при поиске нужно искать с текущей версии до меньших
.
Req (
)
Нужно сделать замену требований к пакетам только для Req (и уж точно не для
)
:
файлы с заменой
:
ALT -
пакет ALT - пакет замены
pkgrepl.rpm -
,
pkgrepl.rpm -
базовый, используется всегда
pkgrepl.pclinux -
pkgrepl.pclinux -
для конкретной системы
pkgrepl.pclinux.2007 -
pkgrepl.pclinux.2007 -
для конкретной версии системы
, ( ALT)
записываем, откуда (из ALT) на что в другой системе менять
%homedir
tmp
?
%homedir
в определении tmp не работает
?
rpm -bE
rpm --showrc ?
Реализовать rpm -bE через
rpm --showrc ?
===
===
===
Текущая разработка
===
ݣ ( , ).
Есть ещё пакеты с версией в виде даты (именно версией, а не релизом). Их
( ,
тоже желательно не забыть (в том числе в части, касающейся
). , , ݣ
.
макроподстановок). Но это, кажется, ещё более сложная задача
.
=== 1.7 ===
===
Версия
1.7 ===
-
%changelog
rpmcs
-
Не трогать часть файла после %changelog при
rpmcs
-
-
добавить сборки раскидавшихся зависимостей на Иксы в одну
- rpmbph
src.rpm (
hasher):
- rpmbph
для src.rpm (через
hasher):
--init-root, .in, rpm -i src.rpm, rpmbph (
hasher), .out {
}
--init-root, .in, rpm -i src.rpm, rpmbph (
не собирающий в hasher), .out { команды в скобках
}
hasher
??
чтобы спек исправлял прямо в hasher при сборке
??
-
,
-
подготовить текст новости, порекламировать
-
/
?
-
обновить/сделать страницу с описанием проекта
?
=== 1.8 ===
===
Версия
1.8 ===
+ how to use --build-args= for hsh? -
myhsh
rpm
+ how to use --build-args= for hsh? -
проброс параметров в myhsh как параметров для
rpm
-
?
-
Сделать нормальную документацию
?
-
, ޣ (diff
)
-
получение спеков из других проектов, с отчётом об обновлении (diff между
)
-
.pot
-
исправить формирование
.pot
-
pot - echog (
message)
-
исправить способ создания pot -и echog (заметить на
message)
=== 2.0 ===
===
Версия
2.0 ===
-
/etc/rpm/*functions
-
удалить файл
/etc/rpm/*functions
-
LICENSE
INSTALL
-
доделать проверку на качество лицензии в LICENSE и содержимое
INSTALL
- TODO:
- TODO:
добавить возможность указания запускаемой команды
(
--
)
(
разделяя строку параметров на до -- и после
)
- -i -u
- -i -u
требуют именно такого порядка использования
-
(
)?
-
перейти на общую обработку всех команд (одним скриптом
)?
Unpackaged:
Unpackaged:
awk '
awk '
on { if (/^ +\//) print $0; else on=0 }
on { if (/^ +\//) print $0; else on=0 }
/^warning: Installed \(but unpackaged\)/ { on=1; print $0 }
/^warning: Installed \(but unpackaged\)/ { on=1; print $0 }
' <"$LOG_FILE"
' <"$LOG_FILE"
----
----
...
@@ -111,14 +115,14 @@ $ echo $a
...
@@ -111,14 +115,14 @@ $ echo $a
line3
line3
> >>:) 3.
,
> >>:) 3.
Было бы здорово, чтобы скрипты сначала проверяли
> >>
> >>
> >>
,
> >>
передаваемые им аргументы, а потом начинали печатать
> >>
, apt.conf
> >>
служебную информацию, как то какой apt.conf они будут
> >> .
> >>
использовать
.
> >
> >
> >
.
> >
Не понял проблемы
.
>
>
>
rpmgs --help :)
>
Попробуйте написать
rpmgs --help :)
# - short-circuit
-bc -bi
:(
# - short-circuit
работает только с -bc и -bi на других платформах
:(
bin/gpull
View file @
bc6a8db7
...
@@ -5,8 +5,10 @@
...
@@ -5,8 +5,10 @@
load_mod git
load_mod git
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echo
"gpull [args] - do git pull --rebase"
echo
"gpull - do git pull --rebase"
echo
"Use: gpull without parameters"
echo
"Use: gpull [GEAR] [branch]"
echo
" gpull without parameters or with branch name"
echo
" gpull git.eter - for pull from git.eter gear repo"
exit
1
exit
1
fi
fi
...
...
bin/gpush
View file @
bc6a8db7
...
@@ -8,7 +8,7 @@ test -r "$1" && fatal "Do not need any files in params"
...
@@ -8,7 +8,7 @@ test -r "$1" && fatal "Do not need any files in params"
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echo
"gpush - publish current project repo remote git repo"
echo
"gpush - publish current project repo remote git repo"
echo
"Use: gpush [-f|--force] [-a|--all] [project name] [target branch]"
echo
"Use: gpush [-f|--force] [-a|--all] [
GEAR] [
project name] [target branch]"
exit
1
exit
1
fi
fi
...
@@ -68,6 +68,11 @@ push_to_remote()
...
@@ -68,6 +68,11 @@ push_to_remote()
git push
--tags
$GHOST
:packages/
$PROJECTNAME
.git
$TARGETBRANCH
git push
--tags
$GHOST
:packages/
$PROJECTNAME
.git
$TARGETBRANCH
}
}
# if remote list is empty, do ginit
if
[
-z
"
$(
get_remote_git_list
)
"
]
;
then
ginit
$GIRARHOST
fi
for
i
in
`
(
echo
$GIRARHOST
;
get_remote_git_list
)
|
uniq
`
;
do
for
i
in
`
(
echo
$GIRARHOST
;
get_remote_git_list
)
|
uniq
`
;
do
push_to_remote
$i
push_to_remote
$i
done
done
...
...
bin/rpmbb
View file @
bc6a8db7
...
@@ -33,11 +33,12 @@ phelp()
...
@@ -33,11 +33,12 @@ phelp()
echog
"
$Descr
"
echog
"
$Descr
"
echog
"
$Usage
"
echog
"
$Usage
"
echog
"Options:"
echog
"Options:"
echog
" -c - start from compile stage"
echog
" -i - skip build, but do install and package"
echog
" -i - install and package"
echog
" -p - packaging installed files into package"
echog
" -r - find build requires"
echog
" -r - find build requires"
echog
" -R - find build requires with -bi"
echog
" -R - find build requires with -bi"
echog
"Ext. options:"
echog
" -c - start from compile stage"
echog
" -p - packaging installed files into package"
}
}
while
getopts
:hciprR opt
;
do
while
getopts
:hciprR opt
;
do
...
...
bin/rpmbph
View file @
bc6a8db7
...
@@ -30,7 +30,8 @@ echo "Converting spec $SPECNAME to $MDISTR..."
...
@@ -30,7 +30,8 @@ echo "Converting spec $SPECNAME to $MDISTR..."
# Set buildreq
# Set buildreq
if
[
"
$VENDOR
"
=
"alt"
]
;
then
if
[
"
$VENDOR
"
=
"alt"
]
;
then
BUILDREQ
=
"BuildRequires: rpm-build-compat >= 0.95"
#BUILDREQ="BuildRequires: rpm-build-compat >= 0.95"
BUILDREQ
=
# Change release according to alt policy with extensions
# Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N)
# General rule: alwars alt(N-1).MM.(N)
set_release
$SPECNAME
$(
get_txtrelease
$SPECNAME
)$(
decrement_release
$BASERELEASE
)
.
$MDISTR
.
$BASERELEASE
set_release
$SPECNAME
$(
get_txtrelease
$SPECNAME
)$(
decrement_release
$BASERELEASE
)
.
$MDISTR
.
$BASERELEASE
...
@@ -261,11 +262,11 @@ phelp()
...
@@ -261,11 +262,11 @@ phelp()
echo
"Use rpmbph -
$CURRENTBRANCHNAME
for backport to ALT
$CURRENTBRANCHNAME
and so on"
echo
"Use rpmbph -
$CURRENTBRANCHNAME
for backport to ALT
$CURRENTBRANCHNAME
and so on"
echog
"Options:"
echog
"Options:"
echog
" -r - remote build"
echog
" -r - remote build"
# echog " -m - send result via e-mail"
echog
" -u - sign and upload after build"
echog
" -u/-U - sign and upload after build"
echog
" -n - do not build in hasher (use first in the list)"
echog
" -n - do not build in hasher (use first in the list)"
echog
" -i - install built packages in test hasher"
echog
" -i - install built packages in test hasher"
echog
" -v - more verbose"
echog
" -v - more verbose"
# echog " -m - send result via e-mail"
}
}
...
@@ -312,66 +313,65 @@ fi
...
@@ -312,66 +313,65 @@ fi
[
-n
"
$NOBUILD
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbs --rmsource --rmspec"
[
-n
"
$NOBUILD
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbs --rmsource --rmspec"
[
-z
"
$BUILDCOMMAND
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbsh
$GIRARHOST
"
[
-z
"
$BUILDCOMMAND
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbsh
$GIRARHOST
"
if
[
"
$VENDOR
"
=
"alt"
]
;
then
# set SPECDIR from LISTNAMES if empty
# run inside gear repo, just create backported spec
[
-n
"
$SPECDIR
"
]
||
set_specdir
$LISTNAMES
# set SPECDIR from LISTNAMES if empty
[
-n
"
$SPECDIR
"
]
||
set_specdir
$LISTNAMES
# if run for ALT inside gear repo, just create backported spec
if
is_gear
$SPECDIR
;
then
if
[
"
$VENDOR
"
=
"alt"
]
&&
is_gear
$SPECDIR
;
then
[
-f
"
$LISTNAMES
"
]
||
fatal
"Run with one spec inside gear repo"
[
-f
"
$LISTNAMES
"
]
||
fatal
"Run with one spec inside gear repo"
USEBRANCH
=
$MDISTR
USEBRANCH
=
$MDISTR
SPEC
=
$LISTNAMES
SPEC
=
$LISTNAMES
BPSPEC
=
$SPEC
.
$USEBRANCH
BPSPEC
=
$SPEC
.
$USEBRANCH
# support for without M names
# support for without M names
USENUMBRANCH
=
$(
get_altdistr_version
$USEBRANCH
)
USENUMBRANCH
=
$(
get_altdistr_version
$USEBRANCH
)
if
[
"
$USENUMBRANCH
"
!=
"
$USEBRANCH
"
]
;
then
if
[
"
$USENUMBRANCH
"
!=
"
$USEBRANCH
"
]
;
then
if
is_exist_branch
$USENUMBRANCH
;
then
if
is_exist_branch
$USENUMBRANCH
;
then
echo
"Exists
$USENUMBRANCH
branch, will use it instead
$USEBRANCH
"
echo
"Exists
$USENUMBRANCH
branch, will use it instead
$USEBRANCH
"
USEBRANCH
=
$USENUMBRANCH
USEBRANCH
=
$USENUMBRANCH
fi
# hack about p5, M50 -> p5
if
[
"
$USEBRANCH
"
=
"M50"
]
&&
is_exist_branch p5
;
then
USENUMBRANCH
=
p5
echo
"Exists
$USENUMBRANCH
branch, will use it instead
$USEBRANCH
"
USEBRANCH
=
$USENUMBRANCH
fi
fi
fi
# hack about p5, M50 -> p5
if
[
"
$USEBRANCH
"
=
"M50"
]
&&
is_exist_branch p5
;
then
USENUMBRANCH
=
p5
echo
"Exists
$USENUMBRANCH
branch, will use it instead
$USEBRANCH
"
USEBRANCH
=
$USENUMBRANCH
fi
fi
[
-f
"
$BPSPEC
"
]
&&
fatal
"File
$BPSPEC
is already exists, check it"
[
-f
"
$BPSPEC
"
]
&&
fatal
"File
$BPSPEC
is already exists, check it"
CURBRANCH
=
$(
get_current_branch
)
CURBRANCH
=
$(
get_current_branch
)
if
[
"
$CURBRANCH
"
=
"
$USEBRANCH
"
]
;
then
if
[
"
$CURBRANCH
"
=
"
$USEBRANCH
"
]
;
then
fatal
"Run rpmbph in sisyphus or master branch, not in backport branch
$USEBRANCH
"
fatal
"Run rpmbph in sisyphus or master branch, not in backport branch
$USEBRANCH
"
fi
fi
# Create branch if not exist yet
# Create branch if not exist yet
if
!
is_exist_branch
$USEBRANCH
;
then
if
!
is_exist_branch
$USEBRANCH
;
then
git branch
$USEBRANCH
git branch
$USEBRANCH
fi
fi
cp
-f
$LISTNAMES
$BPSPEC
cp
-f
$LISTNAMES
$BPSPEC
altspec_to_local
$BPSPEC
altspec_to_local
$BPSPEC
git checkout
$USEBRANCH
||
fatal
"Can't checkout branch
$USEBRANCH
. Use
$BPSPEC
manually or remove it."
git checkout
$USEBRANCH
||
fatal
"Can't checkout branch
$USEBRANCH
. Use
$BPSPEC
manually or remove it."
git merge
$CURBRANCH
git merge
$CURBRANCH
mv
-f
$BPSPEC
$SPEC
mv
-f
$BPSPEC
$SPEC
# FIXME: Ctrl-\ and q will cancelled less with return error code
# FIXME: Ctrl-\ and q will cancelled less with return error code
if
!
git diff
$USEBRANCH
;
then
if
!
git diff
$USEBRANCH
;
then
#git checkout $SPEC $MDISTR
#git checkout $SPEC $MDISTR
#git checkout $CURBRANCH
#git checkout $CURBRANCH
fatal
"User cancelled. You are still in
$USEBRANCH
branch with modified spec"
fatal
"User cancelled. You are still in
$USEBRANCH
branch with modified spec"
fi
fi
git add
$SPEC
git add
$SPEC
if
!
git_commit_ignore_nothing
-a
-m
"backported to
$USEBRANCH
as
$(
get_version
$SPEC
)
-
$(
get_release
$SPEC
)
(with rpmbph script)"
;
then
if
!
git_commit_ignore_nothing
-a
-m
"backported to
$USEBRANCH
as
$(
get_version
$SPEC
)
-
$(
get_release
$SPEC
)
(with rpmbph script)"
;
then
#git checkout $CURBRANCH
#git checkout $CURBRANCH
fatal
"Commit error. You are still in
$MDISTR
branch with modified and uncommitted spec"
fatal
"Commit error. You are still in
$MDISTR
branch with modified and uncommitted spec"
fi
[
-n
"
$NOBUILD
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbs"
$BUILDCOMMAND
$LISTRPMARGS
$REMOTEBUILD
$DISTRARG
$SPEC
||
{
git checkout
$CURBRANCH
;
fatal
"Can't build"
;
}
git checkout
$CURBRANCH
exit
$?
fi
fi
[
-n
"
$NOBUILD
"
]
&&
BUILDCOMMAND
=
"
$ETERBUILDBIN
/rpmbs
$GIRARHOST
"
$BUILDCOMMAND
$LISTRPMARGS
$REMOTEBUILD
$DISTRARG
$SPEC
||
{
git checkout
$CURBRANCH
;
fatal
"Can't build"
;
}
git checkout
$CURBRANCH
exit
$?
fi
fi
unset
MENV MENVARG
unset
MENV MENVARG
...
...
bin/rpmbs
View file @
bc6a8db7
...
@@ -41,16 +41,17 @@ phelp()
...
@@ -41,16 +41,17 @@ phelp()
echog
"
$Descr
"
echog
"
$Descr
"
echog
"
$Usage
"
echog
"
$Usage
"
echog
"Options:"
echog
"Options:"
echog
" -s - sign package(s) and move it to upload dir (ETERDESTSRPM)"
echog
" -u - sign and run gear build task after build"
echog
" -a TASK - sign package(s), push/upload it and add to task TASK"
echog
" -l - lazy cleanup (clean before build, not after)"
echog
"Ext. options:"
echog
" -c - only sign package(s) with checking"
echog
" -c - only sign package(s) with checking"
echog
" -u - sign package(s), upload it and run build"
echog
" -s - sign package(s) and move it to upload dir (ETERDESTSRPM)"
echog
" -a TASK - sign package(s), update it and add to task TASK"
# echog " -U - sign package(s) and upload it to Incoming (updates)"
# echog " -d - remove package(s) from SRPMS and Incoming"
echog
" -l - lazy cleanup (before build, not after)"
echog
" -n - do not check with sisyphus_check before upload"
echog
" -n - do not check with sisyphus_check before upload"
echog
" -o - create nosrc.rpm package"
echog
" -o - create nosrc.rpm package"
echog
" -z - create src.rpm with compatible gzip compression"
echog
" -z - create src.rpm with compatible gzip compression"
# echog " -U - sign package(s) and upload it to Incoming (updates)"
# echog " -d - remove package(s) from SRPMS and Incoming"
}
}
while
getopts
:hscuUdnoa:z opt
;
do
while
getopts
:hscuUdnoa:z opt
;
do
...
@@ -112,9 +113,9 @@ extract_tarball_to_dest()
...
@@ -112,9 +113,9 @@ extract_tarball_to_dest()
cd
$TDIR
cd
$TDIR
cat
"
$1
"
| rpm2cpio | cpio
-i
"*.tar*"
cat
"
$1
"
| rpm2cpio | cpio
-i
"*.tar*"
#cp -fv *.tar* $2
#cp -fv *.tar* $2
local
TARNAME
=
$(
rpm
-q
-p
--queryformat
"%{NAME}-%{VERSION}"
$1
)
local
TARNAME
=
$(
querypackage
$1
""
"%{NAME}-%{VERSION}"
)
# FIXME: hack to replace alt release to eter
# FIXME: hack to replace alt release to eter
local
TARGETTARNAME
=
$(
rpm
-q
-p
--queryformat
"%{NAME}-%{VERSION}-%{RELEASE}"
$1
|
sed
-e
"s/-alt/-eter/g"
)
local
TARGETTARNAME
=
$(
querypackage
$1
""
"%{NAME}-%{VERSION}-%{RELEASE}"
|
sed
-e
"s/-alt/-eter/g"
)
copy_tarball_to_tar_bz2
$TARNAME
*
.tar
*
$2
/
$TARGETTARNAME
.tar.bz2
copy_tarball_to_tar_bz2
$TARNAME
*
.tar
*
$2
/
$TARGETTARNAME
.tar.bz2
cd
-
cd
-
make_md5sum
$2
$TARGETTARNAME
.tar.bz2
make_md5sum
$2
$TARGETTARNAME
.tar.bz2
...
@@ -183,11 +184,13 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
...
@@ -183,11 +184,13 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
echo
echo
echo
"Run build
$BASENAME
at
$GIRARHOST
"
echo
"Run build
$BASENAME
at
$GIRARHOST
"
if
[
-n
"
$TASKNUMBER
"
]
;
then
if
[
-n
"
$TASKNUMBER
"
]
;
then
ssh
$GIRARHOST
task add
$TASKNUMBER
repo
$BASENAME
$TAG
ssh
$GIRARHOST
task add
$TASKNUMBER
repo
$BASENAME
$TAG
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
else
else
ssh
$GIRARHOST
build
-b
$BINARYREPO
$BASENAME
$TAG
ssh
$GIRARHOST
build
-b
$BINARYREPO
$BASENAME
$TAG
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
fi
fi
echo
"run task
$BASENAME
with tag
$TAG
at
$GIRARHOST
(in
$BINARYREPO
) at
`
date
"+%c"
`
"
>>
$RPMDIR
/uploaded.log
cat
$RPMDIR
/uploaded.log.tmp |
head
-n2
|
tail
-n1
>>
$RPMDIR
/uploaded.log
echo
"run
$TASKNUMBER
task
$BASENAME
with tag
$TAG
at
$GIRARHOST
(in
$BINARYREPO
) at
`
date
"+%c"
`
"
>>
$RPMDIR
/uploaded.log
rm
-f
$RPMDIR
/uploaded.log.tmp
exit
exit
fi
fi
...
@@ -302,24 +305,28 @@ done
...
@@ -302,24 +305,28 @@ done
if
[
-n
"
$TASKNUMBER
"
]
;
then
if
[
-n
"
$TASKNUMBER
"
]
;
then
echo
"Add
$TASKLIST
to task
$TASKNUMBER
"
echo
"Add
$TASKLIST
to task
$TASKNUMBER
"
[
-n
"
$VERBOSE
"
]
&&
echo
"...with command ssh
$GIRARHOST
task add
$TASKNUMBER
$TASKLIST
"
[
-n
"
$VERBOSE
"
]
&&
echo
"...with command ssh
$GIRARHOST
task add
$TASKNUMBER
$TASKLIST
"
ssh
$GIRARHOST
task add
$TASKNUMBER
$TASKLIST
ssh
$GIRARHOST
task add
$TASKNUMBER
$TASKLIST
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
else
else
echo
"Create task for
$TASKLIST
"
echo
"Create task for
$TASKLIST
"
[
-n
"
$VERBOSE
"
]
&&
echo
"...with command ssh
$GIRARHOST
build -b
$BINARYREPO
$TASKLIST
"
[
-n
"
$VERBOSE
"
]
&&
echo
"...with command ssh
$GIRARHOST
build -b
$BINARYREPO
$TASKLIST
"
ssh
$GIRARHOST
build
-b
$BINARYREPO
$TASKLIST
ssh
$GIRARHOST
build
-b
$BINARYREPO
$TASKLIST
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
fi
fi
cat
$RPMDIR
/uploaded.log.tmp |
head
-n2
|
tail
-n1
>>
$RPMDIR
/uploaded.log
for
i
in
$LISTBUILT
;
do
for
i
in
$LISTBUILT
;
do
# FIXME: more general way
# FIXME: more general way
LOGFILE
=
"
$LOGDIR
/
`
basename
$i
.src.rpm
`
$MENVARG
.log"
LOGFILE
=
"
$LOGDIR
/
`
basename
$i
.src.rpm
`
$MENVARG
.log"
echo
>>
$LOGFILE
echo
>>
$LOGFILE
date
>>
$LOGFILE
date
>>
$LOGFILE
echo
"uploaded"
>>
$LOGFILE
echo
"uploaded"
>>
$LOGFILE
TEXTADD
=
"run build src.rpm"
TEXTADD
=
"run
$TASKNUMBER
build src.rpm"
[
-z
"
$TASKNUMBER
"
]
||
TEXTADD
=
"add src.rpm to task
$TASKNUMBER
"
[
-z
"
$TASKNUMBER
"
]
||
TEXTADD
=
"add src.rpm to task
$TASKNUMBER
"
echo
"
$(
basename
$i
)
$TEXTADD
at
$GIRARHOST
(
$MENV
) at
`
date
"+%c"
`
"
>>
$RPMDIR
/uploaded.log
echo
"
$(
basename
$i
)
$TEXTADD
at
$GIRARHOST
(
$MENV
) at
`
date
"+%c"
`
"
>>
$RPMDIR
/uploaded.log
done
done
rm
-f
$RPMDIR
/uploaded.log.tmp
echog
"Removing buildroot after upload..."
echog
"Removing buildroot after upload..."
for
i
in
$LISTNAMES
;
do
for
i
in
$LISTNAMES
;
do
if
[
-z
${
i
/*.src.rpm/
}
]
;
then
if
[
-z
${
i
/*.src.rpm/
}
]
;
then
...
...
bin/rpmbsh
View file @
bc6a8db7
...
@@ -31,13 +31,14 @@ phelp()
...
@@ -31,13 +31,14 @@ phelp()
echog
"
$Descr
"
echog
"
$Descr
"
echog
"
$Usage
"
echog
"
$Usage
"
echog
"Options:"
echog
"Options:"
echog
" -r - remote build"
echog
" -r - remote build (on
$BUILDSERVER
host)"
echog
" -t - make temporary commit before build (rpmbb like behavior)"
echog
" -u - sign and run gear build task after build"
echog
" -u - sign and upload after build"
echog
" -i - install built packages in test hasher (via loginhsh -t)"
echog
" -s - sign and and copy to upload dir (ETERDESTSRPM) after build"
echog
"Ext. options:"
echog
" -i - install built packages in test hasher"
echog
" -l - lazy cleanup (before build, not after)"
echog
" -c - build without stuff (previous built packages)"
echog
" -c - build without stuff (previous built packages)"
echog
" -s - sign and and copy to upload dir (ETERDESTSRPM) after build"
echog
" -t - make temporary commit before build (rpmbb like behavior)"
echog
" -l - lazy cleanup (clean before build, not after)"
}
}
while
getopts
:hrulsimt opt
;
do
while
getopts
:hrulsimt opt
;
do
...
...
bin/rpmbugs
View file @
bc6a8db7
...
@@ -11,8 +11,11 @@
...
@@ -11,8 +11,11 @@
# load common functions, compatible with local and installed script
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod rpm web
BUGZILLAURL
=
"https://bugzilla.altlinux.org"
PRODUCT
=
Sisyphus
which xdg-open 2>/dev/null
>
/dev/null
&&
BROWSER
=
xdg-open
show_bugs
()
show_bugs
()
{
{
...
@@ -28,25 +31,28 @@ show_bugs()
...
@@ -28,25 +31,28 @@ show_bugs()
show_bugbyid
()
show_bugbyid
()
{
{
URL
=
"https://bugzilla.altlinux.org/show_bug.cgi?id=
$1
"
# TEXT=1
# TEXT=1
show_bugs
$URL
local
URLSHOWBUG
=
"
$BUGZILLAURL
/show_bug.cgi?id=
$1
"
show_bugs
"
$URLSHOWBUG
"
}
}
#parse_cmd_pre "$@"
#parse_cmd_pre "$@"
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmbugs [-t] spec | bug number | package name | -qf command | /path/to/file - open bugs in BROWSER"
echog
"rpmbugs - open bugs in BROWSER"
echog
"rpmbugs [-t] spec | bug number | package name | -qf command_name | /path/to/file"
echog
"Options:"
echog
" -t - list in text console"
exit
0
exit
0
fi
fi
if
[
"
$
{
1
}
"
=
"-n"
]
;
then
if
[
"
$
1
"
=
"-n"
]
;
then
shift
shift
NEWBUG
=
1
NEWBUG
=
1
fi
fi
if
[
"
$
{
1
}
"
=
"-t"
]
;
then
if
[
"
$
1
"
=
"-t"
]
;
then
shift
shift
TEXT
=
1
TEXT
=
1
which links
>
/dev/null
&&
BROWSER
=
links
which links
>
/dev/null
&&
BROWSER
=
links
...
@@ -55,40 +61,36 @@ fi
...
@@ -55,40 +61,36 @@ fi
test
-z
"
$DISPLAY
"
&&
TEXT
=
1
test
-z
"
$DISPLAY
"
&&
TEXT
=
1
SPECLIST
=
$@
SPECLIST
=
$@
if
[
"
$
{
1
}
"
=
"-qf"
]
if
[
"
$
1
"
=
"-qf"
]
then
then
shift
shift
SPECLIST
=
$1
SPECLIST
=
$(
rpmqf
"
$1
"
)
if
[
-e
$SPECLIST
]
;
then
if
[
-e
"
$1
"
]
;
then
SPECLIST
=
`
rpm
-qf
--queryformat
"%{NAME} "
$SPECLIST
`
SPECLIST
=
$(
querypackage
$SPECLIST
NAME
)
else
SPECLIST
=
`
rpmqf
$SPECLIST
`
fi
fi
fi
fi
# if param is number
# if param is number
if
[
-z
`
echo
${
1
}
|
sed
-e
"s/[0-9]*//"
`
]
;
then
if
[
-z
`
echo
${
1
}
|
sed
-e
"s/[0-9]*//"
`
]
;
then
show_bugbyid
$1
show_bugbyid
"
$1
"
exit
0
exit
fi
fi
for
i
in
$SPECLIST
for
i
in
$SPECLIST
;
do
do
if
[
-f
$i
]
if
[
-f
$i
]
then
then
if
[
-z
${
i
/*rpm/
}
]
if
[
-z
${
i
/*rpm/
}
]
then
then
# it is rpm package
# it is rpm package
PKGNAME
=
`
rpm
-qp
--queryformat
"%{NAME}"
$i
`
PKGNAME
=
$(
querypackage
$i
NAME
)
else
else
PKGNAME
=
$(
eval_spec
$i
| get_var
"Name"
)
PKGNAME
=
$(
eval_spec
$i
| get_var
"Name"
)
test
-z
${
PKGNAME
}
&&
fatal
"Cannot get package name"
test
-z
${
PKGNAME
}
&&
fatal
"Cannot get package name"
fi
fi
else
else
PKGNAME
=
`
rpm
-q
--queryformat
"%{NAME}"
$i
`
||
PKGNAME
=
$i
# yes, DD=$(false) || DD=other works
PKGNAME
=
$(
querypackage
$i
NAME
)
||
PKGNAME
=
$i
fi
fi
PRODUCT
=
Sisyphus
URL
=
"https://bugzilla.altlinux.org/buglist.cgi?product=
$PRODUCT
&component=
$PKGNAME
&component_type=equals&simple=1"
if
[
-n
"
$NEWBUG
"
]
;
then
if
[
-n
"
$NEWBUG
"
]
;
then
fatal
"Do not realized yet. Welcome to developing!"
fatal
"Do not realized yet. Welcome to developing!"
...
@@ -100,7 +102,8 @@ do
...
@@ -100,7 +102,8 @@ do
#altbug --pkg "$PKGNAME" --subj "$SUMMARY"
#altbug --pkg "$PKGNAME" --subj "$SUMMARY"
show_bugbyid
$ID
show_bugbyid
$ID
else
else
show_bugs
$URL
|
grep
"@"
local
URLBUGLIST
=
"
$BUGZILLAURL
/buglist.cgi?product=
$PRODUCT
&component=
$PKGNAME
&component_type=equals&simple=1"
show_bugs
"
$URLBUGLIST
"
|
grep
"@"
fi
fi
done
done
bin/rpmcs
View file @
bc6a8db7
...
@@ -99,6 +99,12 @@ do
...
@@ -99,6 +99,12 @@ do
fi
fi
fi
fi
# if there is no altlinux in changelog yet
if
!
grep
-v
"Packager"
$i
|
grep
"@altlinux"
;
then
echo
"Add changelog with initial build"
add_changelog
$i
-e
"- initial build for ALT Linux Sisyphus"
fi
echog
"cleanup_spec for
$i
..."
echog
"cleanup_spec for
$i
..."
cleanup_spec
$i
cleanup_spec
$i
...
...
bin/rpmgp
View file @
bc6a8db7
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# load common functions, compatible with local and installed script
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod rpm repl git rpm
load_mod rpm repl git rpm
web
# path to ALT Linux's repositories
# path to ALT Linux's repositories
REPOSITORY
=
"files/SRPMS obsolete orphaned"
REPOSITORY
=
"files/SRPMS obsolete orphaned"
...
@@ -119,7 +119,7 @@ check_system()
...
@@ -119,7 +119,7 @@ check_system()
check_name
$NAME
check_name
$NAME
if
[
"
$DOWNLOADALL
"
]
;
then
if
[
"
$DOWNLOADALL
"
]
;
then
for
i
in
$NLIST
;
do
for
i
in
$NLIST
;
do
wget
-c
$URL
/
$i
download_url
$URL
/
$i
done
done
fi
fi
}
}
...
@@ -299,7 +299,7 @@ if [ -n "$CHECKONLINE" ] ; then
...
@@ -299,7 +299,7 @@ if [ -n "$CHECKONLINE" ] ; then
PKGNAME
=
$(
get_pkgname_from_filename
$SRCRPM
)
PKGNAME
=
$(
get_pkgname_from_filename
$SRCRPM
)
else
else
PKGNAME
=
$1
PKGNAME
=
$1
SRCRPM
=
`
rpm
-q
$PKGNAME
--queryformat
"%{SOURCERPM}
\n
"
|
tail
-n
1
`
SRCRPM
=
$(
querypackage
$PKGNAME
""
"%{SOURCERPM}
\n
"
|
tail
-n
1
)
fi
fi
fi
fi
...
@@ -375,12 +375,7 @@ then
...
@@ -375,12 +375,7 @@ then
# it is src.rpm package
# it is src.rpm package
SRCRPM
=
$1
SRCRPM
=
$1
else
else
if
[
-z
"
${
1
/*rpm/
}
"
]
;
then
SRCRPM
=
$(
querypackage
$1
""
"%{SOURCERPM}
\n
"
)
# it is rpm package (locale placed?)
SRCRPM
=
`
rpm
-qp
$1
--queryformat
"%{SOURCERPM}
\n
"
`
else
SRCRPM
=
`
rpm
-q
$1
--queryformat
"%{SOURCERPM}
\n
"
`
fi
fi
fi
test
-z
"
$SRCRPM
"
&&
fatal
"Cannon find package for
$1
"
test
-z
"
$SRCRPM
"
&&
fatal
"Cannon find package for
$1
"
echog
"Try to download
$SRCRPM
"
echog
"Try to download
$SRCRPM
"
...
...
bin/rpmgs
View file @
bc6a8db7
...
@@ -14,26 +14,26 @@
...
@@ -14,26 +14,26 @@
# load common functions, compatible with local and installed script
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod rpm tarball
load_mod rpm tarball
web
WEXT
=
""
WEXT
=
""
GETSOURCE
=
""
GETSOURCE
=
""
LOADLIST
=
"0"
LOADLIST
=
"0"
#############################
#############################
Usage
=
"Usage:
$name
[-a -r ] spec
... | spec new_version
"
Usage
=
"Usage:
$name
[-a -r ] spec
[new_version]
"
function
mygetopts
()
function
mygetopts
()
{
{
name
=
${
0
##*/
}
name
=
${
0
##*/
}
Descr
=
"
$name
- get sources
for spec
"
Descr
=
"
$name
- get sources
by spec / repository
"
phelp
()
phelp
()
{
{
echog
"
$Descr
"
echog
"
$Descr
"
echog
"
$Usage
"
echog
"
$Usage
"
echog
"You can run
rpmgs file.spec new_version
for set new version and download it"
echog
"You can run
'rpmgs file.spec new_version'
for set new version and download it"
echog
"Options:"
echog
"Options:"
echog
" -a - get all source (not only 0)"
echog
" -a - get all source (not only
Source|Source
0)"
echog
" -f - force download (remove source before download)"
echog
" -f - force download (remove source before download)"
}
}
...
@@ -41,7 +41,7 @@ while getopts :haf opt; do
...
@@ -41,7 +41,7 @@ while getopts :haf opt; do
case
$opt
in
case
$opt
in
h
)
phelp
;
exit
0
;;
h
)
phelp
;
exit
0
;;
a
)
LOADLIST
=
" 0 1 2 3 4 5 6 7 8"
;;
a
)
LOADLIST
=
" 0 1 2 3 4 5 6 7 8"
;;
f
)
FORCEDOWNLOAD
=
1
;;
f
)
FORCEDOWNLOAD
=
-f
;;
+?
)
echog
"
$name
: options should not be preceded by a '+'."
1>&2
;
exit
2
;;
+?
)
echog
"
$name
: options should not be preceded by a '+'."
1>&2
;
exit
2
;;
?
)
echog
"
$name
:
$OPTARG
: bad option. Use -h for help."
1>&2
;
exit
2
;;
?
)
echog
"
$name
:
$OPTARG
: bad option. Use -h for help."
1>&2
;
exit
2
;;
esac
esac
...
@@ -54,19 +54,12 @@ LISTRPMARGS=$@
...
@@ -54,19 +54,12 @@ LISTRPMARGS=$@
}
}
get_tarball
()
{
# use wget with try=1 and timeout = 30 sec
wget
-c
-t
1
-T
30
"
$1
"
}
get_archive
()
get_archive
()
{
{
#TODO: check for gz
#TODO: check for gz
URL
=
${
GETSOURCE
/.tar.bz2/
}
URL
=
${
GETSOURCE
/.tar.bz2/
}
[
"
$URL
"
=
"
$GETSOURCE
"
]
&&
URL
=
${
GETSOURCE
/.tar/
}
[
"
$URL
"
=
"
$GETSOURCE
"
]
&&
URL
=
${
GETSOURCE
/.tar/
}
get_tarbal
l
"
$URL
.
$1
"
||
return
download_ur
l
"
$URL
.
$1
"
||
return
WEXT
=
`
basename
"
$URL
"
`
WEXT
=
`
basename
"
$URL
"
`
test
-f
"
$WEXT
.
$1
"
||
return
test
-f
"
$WEXT
.
$1
"
||
return
[
"
$1
"
=
"tar.bz2"
]
||
echog
-n
"Converting to
$WEXT
.tar..."
[
"
$1
"
=
"tar.bz2"
]
||
echog
-n
"Converting to
$WEXT
.tar..."
...
@@ -76,7 +69,7 @@ get_archive1()
...
@@ -76,7 +69,7 @@ get_archive1()
{
{
#TODO: check for gz
#TODO: check for gz
URL
=
${
GETSOURCE
/.bz2/
}
URL
=
${
GETSOURCE
/.bz2/
}
get_tarbal
l
"
$URL$1
"
||
return
download_ur
l
"
$URL$1
"
||
return
WEXT
=
`
basename
"
$URL
"
`
WEXT
=
`
basename
"
$URL
"
`
test
-f
"
$WEXT
"
||
return
test
-f
"
$WEXT
"
||
return
echog
-n
"Converting to
$WEXT
.bz2..."
echog
-n
"Converting to
$WEXT
.bz2..."
...
@@ -86,12 +79,14 @@ get_archive1()
...
@@ -86,12 +79,14 @@ get_archive1()
get_tarbz2
()
get_tarbz2
()
{
{
get_archive tar.bz2
get_archive tar.bz2
bunzip
-t
$WEXT
.tar.bz2
return
$?
return
$?
}
}
get_bz2
()
get_bz2
()
{
{
get_archive1 .bz2
get_archive1 .bz2
bunzip
-t
$WEXT
.bz2
return
$?
return
$?
}
}
...
@@ -186,6 +181,47 @@ function get_source()
...
@@ -186,6 +181,47 @@ function get_source()
GETSOURCE
=
$(
eval_spec
$1
| get_var
"
$2
"
)
GETSOURCE
=
$(
eval_spec
$1
| get_var
"
$2
"
)
}
}
# param: spec name number (f.i., url for Source-url)
function
source_ext
()
{
local
GETSOURCEEXT
=
# %define SourceUrl ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/last/sources/tarball/%name-%version.tar.gz
#GETSOURCEURL=$(eval_spec $1 | grep -i "^%define ${2}Url${3} " | head -n 1 | sed -e "s/ *\$//g" | sed -e "s/^%define[ \t].*[ \t]//g")
if
grep
-q
"# Source
$3
-
$2
:"
"
$1
"
;
then
local
TMPSPEC
=
$1
.tmpurl
local
NEWSOURCE
=
$(
grep
"# Source
$3
-
$2
:"
"
$1
"
|
sed
-e
"s/.*
$2
:[
\t
]*//g"
)
test
-n
"
$NEWSOURCE
"
||
fatal
"Can't extract URL from
$Source$3
-
$2
"
cat
$1
|
sed
-e
"s|^Summary:.*|Summary:
$NEWSOURCE
|g"
>
$TMPSPEC
GETSOURCEEXT
=
$(
eval_spec
"
$TMPSPEC
"
| get_var
"Summary"
)
rm
-f
"
$TMPSPEC
"
fi
echo
"
$GETSOURCEEXT
"
test
-n
"
$GETSOURCEEXT
"
}
# Source-svn: http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection/
function
get_source_svn
()
{
GETSOURCESVN
=
$(
source_ext
"
$1
"
svn
"
$2
"
)
#if [ -n "$GETSOURCESVN" ] ; then
# warning "Source-svn is not supported yet"
# ( cd $SPECDIR ; git svn clone $GETSOURCESVN .)
#fi
#test -n "$GETSOURCESVN"
}
# Source-git: http://git.altlinux.org/people/lav/packages/rpm-build-fonts.git
# Source-url: ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/last/sources/tarball/%name-%version.tar.gz
# Get real Url from comment
function
get_source_url
()
{
GETSOURCEURL
=
$(
source_ext
"
$1
"
url
"
$2
"
)
}
function
print_error
()
function
print_error
()
{
{
echog
"You have no spec files as arg"
echog
"You have no spec files as arg"
...
@@ -253,27 +289,51 @@ do
...
@@ -253,27 +289,51 @@ do
fi
fi
mkdir
-p
$RPMSOURCEDIR
/
&&
pushd
$RPMSOURCEDIR
/
||
fatal
"Can't create/chdir..."
mkdir
-p
$RPMSOURCEDIR
/
&&
pushd
$RPMSOURCEDIR
/
||
fatal
"Can't create/chdir..."
echog
"Try to load
$GETSOURCE
for
$i
"
#if is_gear $SPECDIR && [ -n "${GETSOURCE/*.tar/}" ] ; then
get_source_url
$SPECDIR
/
$i
$nn
||
get_source_svn
$SPECDIR
/
$i
$nn
# warning "It is recommended to use .tar tarballs for sources in gear"
# get_tarball "$GETSOURCE"
if
[
-n
"
${
GETSOURCESVN
}
"
]
;
then
if
[
-n
"
${
GETSOURCE
/*.bz2/
}
"
]
&&
!
is_gear
$SPECDIR
;
then
is_gear
$SPECDIR
||
fatal
"Source-svn works only with gear repo"
warning
"It is recommended to use .bz2 tarballs for sources in rpm"
elif
is_gear
$SPECDIR
;
then
get_tarball
"
$GETSOURCE
"
echog
"Try to load
${
GETSOURCEURL
:-
$GETSOURCE
}
for
$i
"
elif
[
-n
"
${
GETSOURCE
/*.tar.bz2/
}
"
]
&&
!
is_gear
$SPECDIR
;
then
if
[
-n
"
${
GETSOURCE
/*.tar/
}
"
]
;
then
warning
"It is not tarball (possible single file)..."
warning
"It is recommended to use .tar tarballs for sources in gear"
get_bz2
||
get_gz
||
get_raw
||
fatal
"Error: Cannot retrieve
$GETSOURCE
"
fi
if
[
-n
"
${
GETSOURCEURL
}
"
]
;
then
# UpUrl for gear
download_url
"
$GETSOURCEURL
"
# FIXME: gear-update can use any tarball
copy_tarball_to_tar
$(
basename
"
$GETSOURCEURL
"
)
$FTB
else
if
[
-z
"
${
GETSOURCE
/*.tar/
}
"
]
;
then
# try to load and convert
get_tarbz2
||
get_targz
||
get_tgz
||
get_7z
||
get_zip
||
get_tbz2
||
get_tbz
||
get_tar
||
get_rar
||
dir_name
||
fatal
"Cannot retrieve
$GETSOURCE
"
else
download_url
"
$GETSOURCE
"
fi
#echo "Get tarball $FTB for gear"
#FORGEAR=1
fi
else
else
if
[
-z
"
${
GETSOURCE
/*.tar/
}
"
]
&&
is_gear
$SPECDIR
;
then
[
-z
"
${
GETSOURCEURL
}
"
]
||
fatal
"Source git works only with gear repo"
echo
"Get tarball for gear"
echog
"Try to load
${
GETSOURCEURL
:-
$GETSOURCE
}
for
$i
"
FORGEAR
=
1
if
[
-n
"
${
GETSOURCE
/*.bz2/
}
"
]
;
then
warning
"It is recommended to use .bz2 tarballs for sources in rpm"
fi
if
[
-n
"
${
GETSOURCEURL
}
"
]
;
then
# UpUrl for rpm
download_url
"
$GETSOURCEURL
"
copy_tarball_to_tar_bz2
$(
basename
"
$GETSOURCEURL
"
)
$FTB
elif
[
-z
"
${
GETSOURCE
/*.tar.bz2/
}
"
]
;
then
download_url
"
$GETSOURCE
"
elif
[
-n
"
${
GETSOURCE
/*.bz2/
}
"
]
;
then
get_tarbz2
||
get_targz
||
get_tgz
||
get_7z
||
get_zip
||
get_tbz2
||
get_tbz
||
get_tar
||
get_rar
||
dir_name
||
fatal
"Cannot retrieve
$GETSOURCE
"
#echog -n "Compressing to $WEXT.tar.bz2..."
test
-f
$WEXT
.tar.bz2
||
bzipit
$WEXT
.tar
||
fatal
"Cannot bzip
$WEXT
.tar"
elif
[
-n
"
${
GETSOURCE
/*.tar.bz2/
}
"
]
;
then
warning
"It is not tarball (possible single file)..."
get_bz2
||
get_gz
||
get_raw
||
fatal
"Cannot retrieve
$GETSOURCE
"
fi
fi
get_tarbz2
||
get_targz
||
get_tgz
||
get_7z
||
get_zip
||
get_tbz2
||
get_tbz
||
get_tar
||
get_rar
||
dir_name
||
fatal
"Error: Cannot retrieve
$GETSOURCE
"
fi
if
[
-z
"
$FORGEAR
"
]
;
then
echog
-n
"Compressing to
$WEXT
.tar.bz2..."
test
-f
$WEXT
.tar.bz2
||
bzipit
$WEXT
.tar
||
fatal
"Error: Cannot bzip
$WEXT
.tar"
fi
fi
echo
"DONE"
echo
"DONE"
...
@@ -286,17 +346,32 @@ do
...
@@ -286,17 +346,32 @@ do
CURVER
=
$(
get_version
$i
)
CURVER
=
$(
get_version
$i
)
CURREL
=
$(
get_release
$i
)
CURREL
=
$(
get_release
$i
)
EGEARME
=
""
EGEARME
=
""
is_gear
&&
EGEARME
=
"import in git"
is_gear
&&
EGEARME
=
"
import in git"
add_changelog_helper
"- new version (
$CURVER
)
$EGEARME
"
$i
||
echog
"Changelog entry for
$CURVER
-
$CURREL
already exists"
add_changelog_helper
"- new version (
$CURVER
)
$EGEARME
"
$i
||
echog
"Changelog entry for
$CURVER
-
$CURREL
already exists"
fi
fi
if
[
-n
"
$GSSETVERSION
"
]
&&
is_gear
;
then
CURNAME
=
$BASENAME
if
[
-n
"
$GSSETVERSION
"
]
||
[
-n
"
$FORCEDOWNLOAD
"
]
;
then
test
-d
"
$CURNAME
"
||
CURNAME
=
$(
get_tarballname
$i
)
if
[
-n
"
${
GETSOURCESVN
}
"
]
;
then
echo
"Commit tarball
$RPMSOURCEDIR
/
$FTB
to git subdir '
$CURNAME
'..."
# clone svn repo to current dir
gear-update
"
$RPMSOURCEDIR
/
$FTB
"
"
$CURNAME
"
&&
rm
-f
"
$RPMSOURCEDIR
/
$FTB
"
# FIXME: need to clone in git root dir
git commit
-m
"just import
$(
basename
$RPMSOURCEDIR
/
$FTB
)
with rpmgs script"
GITROOT
=
.
[
$(
basename
`
pwd
`
)
=
".gear"
]
&&
GITROOT
=
../
git svn clone
$GETSOURCESVN
$GITROOT
echo
"Run svn rebase from
$GETSOURCESVN
"
git svn rebase
elif
is_gear
;
then
CURNAME
=
$BASENAME
test
-d
"
$CURNAME
"
||
CURNAME
=
$(
get_tarballname
"
$i
"
)
[
-d
"
$CURNAME
"
]
||
CREATEFLAG
=
-c
# mkdir -p "$CURNAME" && git add "$CURNAME"
#fi
echo
"Commit tarball
$RPMSOURCEDIR
/
$FTB
to git subdir '
$CURNAME
'..."
gear-update
$FORCEDOWNLOAD
$CREATEFLAG
"
$RPMSOURCEDIR
/
$FTB
"
"
$CURNAME
"
||
fatal
"can't import tarball
$CURNAME
"
rm
-f
"
$RPMSOURCEDIR
/
$FTB
"
git commit
-m
"just import
$(
basename
$RPMSOURCEDIR
/
$FTB
)
with rpmgs script"
fi
else
else
is_gear
&&
echo
"
Run without version. Skip tarball commiting
."
is_gear
&&
echo
"
Skip tarball committing (run with version or with -f)
."
fi
fi
done
done
...
...
bin/rpmpub
View file @
bc6a8db7
...
@@ -16,6 +16,9 @@ load_mod spec rpm etersoft
...
@@ -16,6 +16,9 @@ load_mod spec rpm etersoft
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmpub - Etersoft specific script for publish gear repo to target ftp dir"
echog
"rpmpub - Etersoft specific script for publish gear repo to target ftp dir"
echog
"Usage: rpmpub [-r PROJECTVERSION ] [SPEC] [TARGETDIR]"
echog
"Usage: rpmpub [-r PROJECTVERSION ] [SPEC] [TARGETDIR]"
echog
"Options:"
echog
" -r PROJECTVERSION - set other project version (PROJECTVERSION/sources)"
echog
" TARGETDIR - copy signed src.rpm package to TARGETDIR"
echog
"You can set default target dir in UPLOADDIR variable in config file"
echog
"You can set default target dir in UPLOADDIR variable in config file"
exit
0
exit
0
fi
fi
...
@@ -41,7 +44,7 @@ if [ ! -r $SPECNAME ] ; then
...
@@ -41,7 +44,7 @@ if [ ! -r $SPECNAME ] ; then
fatal
"Spec
$SPECNAME
does not found in the current dir"
fatal
"Spec
$SPECNAME
does not found in the current dir"
fi
fi
#ETERDESTSRPM=/var/ftp/pub/Etersoft/CIFS@Etersoft/$VERSION/sources
#E
xample: E
TERDESTSRPM=/var/ftp/pub/Etersoft/CIFS@Etersoft/$VERSION/sources
ETERDESTSRPM
=
$1
ETERDESTSRPM
=
$1
if
[
-z
"
$ETERDESTSRPM
"
]
;
then
if
[
-z
"
$ETERDESTSRPM
"
]
;
then
ETERDESTSRPM
=
$(
get_etersoft_srpm_path
$SPECNAME
"
$ALPHA
"
)
ETERDESTSRPM
=
$(
get_etersoft_srpm_path
$SPECNAME
"
$ALPHA
"
)
...
...
bin/rpmqf
View file @
bc6a8db7
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
# TODO not -i only, we need any key
# TODO not -i only, we need any key
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echo
"rpmqf - the same as rpm -qf"
echo
"rpmqf - the same as rpm -qf
, but use which for search command place
"
exit
0
exit
0
fi
fi
...
@@ -45,4 +45,4 @@ real_file()
...
@@ -45,4 +45,4 @@ real_file()
real_file
"
$1
"
real_file
"
$1
"
rpm
-q
f
$ARG
"
$FULLFILEPATH
"
rpm
query
-
f
$ARG
"
$FULLFILEPATH
"
bin/rpmrb
View file @
bc6a8db7
...
@@ -31,7 +31,9 @@ test -n "$GSSETRELEASE" || GSSETRELEASE=alt1
...
@@ -31,7 +31,9 @@ test -n "$GSSETRELEASE" || GSSETRELEASE=alt1
export
GSSETRELEASE
export
GSSETRELEASE
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echo
"rpmrb spec [vermajor][.verminor] [rel] - update spec to vermajor.verminor version, build %rel release"
echog
"rpmrb - update spec to vermajor.verminor version, build %rel release"
echog
"Usage: rpmrb spec [vermajor][.verminor] [rel]"
echog
"Example: rpmrb name.spec 22.6 alt2"
exit
0
exit
0
fi
fi
...
...
bin/rpmunmets
View file @
bc6a8db7
...
@@ -31,7 +31,7 @@ make_testingbox()
...
@@ -31,7 +31,7 @@ make_testingbox()
}
}
Usage
=
"Usage:
$name
[-M24 -M40]"
Usage
=
"Usage:
$name
[-M24 -M40]
[-s]
"
function
mygetopts
()
function
mygetopts
()
{
{
name
=
${
0
##*/
}
name
=
${
0
##*/
}
...
@@ -43,7 +43,7 @@ phelp()
...
@@ -43,7 +43,7 @@ phelp()
echog
"
$Usage
"
echog
"
$Usage
"
echog
"Options:"
echog
"Options:"
echog
" -s - get all unmets"
echog
" -s - get all unmets"
echog
" -
M40 - test for distro ALT Linux 4.0
"
echog
" -
$CURRENTBRANCHNAME
- test for distro ALT Linux
$CURRENTBRANCHNAME
"
}
}
SKIPTST
=
SKIPTST
=
...
@@ -116,7 +116,7 @@ export LESS_PROGRAM=/dev/null
...
@@ -116,7 +116,7 @@ export LESS_PROGRAM=/dev/null
for
i
in
$(
echo
$NEWPKGDIR
/
*
.rpm
)
;
do
for
i
in
$(
echo
$NEWPKGDIR
/
*
.rpm
)
;
do
OLDPKGNAME
=
$(
rpm
-qp
$i
|
sed
-e
"s|-[0-9].*||g"
)
OLDPKGNAME
=
$(
rpm
-qp
$i
|
sed
-e
"s|-[0-9].*||g"
)
# search in the our arch repo
# search in the our arch repo
PKGARCH
=
$(
rpm
-qp
--queryformat
"%{ARCH}"
$i
)
PKGARCH
=
$(
querypackage
$i
ARCH
)
OLDPKG
=
$(
echo
$SISYPHUSPATH
/
$PKGARCH
/RPMS.
*
/
$OLDPKGNAME
-[0-9]
*
.rpm
)
OLDPKG
=
$(
echo
$SISYPHUSPATH
/
$PKGARCH
/RPMS.
*
/
$OLDPKGNAME
-[0-9]
*
.rpm
)
if
[
!
-r
"
$OLDPKG
"
]
;
then
if
[
!
-r
"
$OLDPKG
"
]
;
then
echo
"Cannot find old package for
$(
basename
$i
)
, skipping"
echo
"Cannot find old package for
$(
basename
$i
)
, skipping"
...
...
bin/rpmurl
View file @
bc6a8db7
...
@@ -10,11 +10,7 @@
...
@@ -10,11 +10,7 @@
# load common functions, compatible with local and installed script
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod rpm web
which xdg-open 2>/dev/null
>
/dev/null
&&
BROWSER
=
xdg-open
# (command from perl-libwww)
which GET &>/dev/null
&&
GET
=
GET
||
GET
=
false
#############################
#############################
...
@@ -30,9 +26,10 @@ phelp()
...
@@ -30,9 +26,10 @@ phelp()
echog
"
$Usage
"
echog
"
$Usage
"
echog
"Options:"
echog
"Options:"
echog
" -c - check URL"
echog
" -c - check URL"
echog
" -f - print failed URL only"
echog
" -p - open package page at sisyphus.ru"
echog
" -p - open package page at sisyphus.ru"
echog
" -s - open source dir in browser"
echog
" -s - open source dir in browser"
echog
"Ext. options:"
echog
" -f - print failed URL only"
}
}
while
getopts
:hcfsp opt
;
do
while
getopts
:hcfsp opt
;
do
...
@@ -78,7 +75,7 @@ get_pkginfo()
...
@@ -78,7 +75,7 @@ get_pkginfo()
if
[
-z
${
i
/*rpm/
}
]
if
[
-z
${
i
/*rpm/
}
]
then
then
# it is rpm package
# it is rpm package
RPM_URL
=
`
rpm
-qp
--queryformat
"%{URL}"
${
i
}
`
RPM_URL
=
$(
querypackage
${
i
}
URL
)
SOURCE
=
SOURCE
=
else
else
RPM_URL
=
$(
eval_spec
${
i
}
| get_var
"Url"
)
RPM_URL
=
$(
eval_spec
${
i
}
| get_var
"Url"
)
...
@@ -86,8 +83,8 @@ get_pkginfo()
...
@@ -86,8 +83,8 @@ get_pkginfo()
fi
fi
else
else
# will it package name
# will it package name
RPM_URL
=
`
rpm
-q
--queryformat
"%{URL}"
${
i
}
`
RPM_URL
=
$(
querypackage
${
i
}
URL
)
SOURCE
=
`
rpm
-q
--queryformat
"%{SOURCE}"
${
i
}
`
SOURCE
=
$(
querypackage
${
i
}
SOURCE
)
fi
fi
}
}
...
@@ -101,15 +98,15 @@ get_pagepkginfo()
...
@@ -101,15 +98,15 @@ get_pagepkginfo()
if
[
-z
${
i
/*rpm/
}
]
if
[
-z
${
i
/*rpm/
}
]
then
then
# it is rpm package
# it is rpm package
PKGVERSION
=
`
rpm
-qp
--queryformat
"%{VERSION}"
${
i
}
`
PKGVERSION
=
$(
querypackage
${
i
}
VERSION
)
PKGNAME
=
`
rpm
-qp
--queryformat
"%{sourcerpm}"
${
i
}
|
sed
-e
"s|-
$PKGVERSION
.*||g"
`
PKGNAME
=
$(
querypackage
${
i
}
sourcerpm |
sed
-e
"s|-
$PKGVERSION
.*||g"
)
else
else
PKGNAME
=
$(
eval_spec
${
i
}
| get_var
"Name"
)
PKGNAME
=
$(
eval_spec
${
i
}
| get_var
"Name"
)
fi
fi
else
else
# installed package name
# installed package name
PKGVERSION
=
`
rpm
-q
--queryformat
"%{VERSION}"
${
i
}
`
PKGVERSION
=
$(
querypackage
${
i
}
VERSION
}
)
PKGNAME
=
`
rpm
-q
--queryformat
"%{sourcerpm}"
${
i
}
|
sed
-e
"s|-
$PKGVERSION
.*||g"
`
PKGNAME
=
$(
querypackage
${
i
}
sourcerpm |
sed
-e
"s|-
$PKGVERSION
.*||g"
)
fi
fi
if
[
-z
"
$PKGNAME
"
]
;
then
if
[
-z
"
$PKGNAME
"
]
;
then
PKGNAME
=
"
$i
"
PKGNAME
=
"
$i
"
...
...
etc/bashrc.d/etersoft-build-utils.sh
0 → 100755
View file @
bc6a8db7
alias
apti
=
'sudo apt-get install'
alias
apts
=
'apt-cache search'
alias
aptw
=
'apt-cache whatdepends'
alias
finds
=
'find -type f -print0 | xargs -r0 grep -in'
etersoft-build-utils.spec
View file @
bc6a8db7
Name: etersoft-build-utils
Name: etersoft-build-utils
Version: 1.7.
5
Version: 1.7.
6
Release: alt1
Release: alt1
Summary: A set of build rpm utilities
Summary: A set of build rpm utilities
...
@@ -56,6 +56,7 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
...
@@ -56,6 +56,7 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
%_datadir/eterbuild/
%_datadir/eterbuild/
# for backward compatibility (will removed in 2.0)
# for backward compatibility (will removed in 2.0)
%_sysconfdir/rpm/etersoft-build-functions
%_sysconfdir/rpm/etersoft-build-functions
%attr(0755,root,root) %_sysconfdir/bashrc.d/*
%dir %_sysconfdir/eterbuild/
%dir %_sysconfdir/eterbuild/
%dir %_sysconfdir/eterbuild/apt/
%dir %_sysconfdir/eterbuild/apt/
%config(noreplace) %_sysconfdir/eterbuild/apt/apt.conf.*
%config(noreplace) %_sysconfdir/eterbuild/apt/apt.conf.*
...
@@ -64,6 +65,13 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
...
@@ -64,6 +65,13 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
%config(noreplace) %_sysconfdir/eterbuild/repos
%config(noreplace) %_sysconfdir/eterbuild/repos
%changelog
%changelog
* Fri Feb 05 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.6-alt1
- add bashrc.d aliases apti, apts, aptw, finds
- rpmgp: fix src.rpm import, allow to use several files
- rpmgs: add real source support (for Source-svn, Source-url commented lines)
- rpmbph: do not add rpm-build-compat buildreq to backported specs
- gpush: do ginit if no remote aliases
* Fri Jan 22 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.5-alt1
* Fri Jan 22 2010 Vitaly Lipatov <lav@altlinux.ru> 1.7.5-alt1
- rpmbs/rpmbsh: add -l option for lazy-cleanup after build
- rpmbs/rpmbsh: add -l option for lazy-cleanup after build
- rpmgp: add -m option for migrate spec to gear support
- rpmgp: add -m option for migrate spec to gear support
...
...
share/eterbuild/functions/rpm
View file @
bc6a8db7
...
@@ -65,7 +65,13 @@ build_rpms_name()
...
@@ -65,7 +65,13 @@ build_rpms_name()
querypackage
()
querypackage
()
{
{
rpmquery
-p
--queryformat
"%{
$2
}"
$1
local
FORMAT
=
"%{
$2
}"
local
INSTALLED
=
"-p"
# if name empty, use third param as format string
[
-n
"
$2
"
]
||
FORMAT
=
"
$3
"
# if not file, drop -p for get from rpm base
[
-e
"
$1
"
]
||
INSTALLED
=
""
rpmquery
$INSTALLED
--queryformat
"
$FORMAT
"
$1
}
}
build_rpms_name_by_srpm
()
build_rpms_name_by_srpm
()
...
...
share/eterbuild/functions/tarball
View file @
bc6a8db7
...
@@ -45,6 +45,34 @@ copy_tarball_to_tar_bz2()
...
@@ -45,6 +45,34 @@ copy_tarball_to_tar_bz2()
bzip
-c
"
$SNAME
"
>
"
$TNAME
"
bzip
-c
"
$SNAME
"
>
"
$TNAME
"
return
return
fi
fi
fatal
"Can't repack
$SNAME
to tar.bz2"
return
1
}
copy_tarball_to_tar
()
{
local
SNAME
=
$1
local
TNAME
=
$2
#echo SNAME: $SNAME
test
-r
"
$SNAME
"
||
return
1
# copying from tar.bz2
if
[
!
${
SNAME
/.tar.bz2/
}
=
"
$SNAME
"
]
;
then
bunzip
-c
"
$SNAME
"
>
"
$TNAME
"
return
fi
if
[
!
${
SNAME
/.tar.gz/
}
=
"
$SNAME
"
]
;
then
gunzip
-c
"
$SNAME
"
>
"
$TNAME
"
return
fi
# FIXME: matchs with .tarNNN
if
[
!
${
SNAME
/.tar/
}
=
"
$SNAME
"
]
;
then
cp
-fv
"
$SNAME
"
"
$TNAME
"
return
fi
fatal
"Can't repack
$SNAME
to tar"
return
1
return
1
}
}
...
...
share/eterbuild/functions/web
0 → 100644
View file @
bc6a8db7
#!/bin/bash
# 2010 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
which xdg-open 2>/dev/null
>
/dev/null
&&
BROWSER
=
xdg-open
# (command from perl-libwww)
which GET &>/dev/null
&&
GET
=
GET
||
GET
=
false
download_url
()
{
# use wget with try=1 and timeout = 30 sec
wget
-c
-t
1
-T
30
"
$1
"
}
tests/get_source_url.sh
0 → 100755
View file @
bc6a8db7
#!/bin/sh
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod spec rpm
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$2
' do not match with '
$3
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
print_spec
()
{
echo
"%define SourceUrl
$1
$2
"
}
check_url
()
{
check
"
$1
"
"
$(
print_spec
"
$3
"
"
$4
"
|
grep
-i
"^%define
${
2
}
Url
${
3
}
"
|
head
-n
1 |
sed
-e
"s/ *
\$
//g"
|
sed
-e
"s/^%define[
\t
].*[
\t
]//g"
)
"
$4
}
check_url 1
"Source"
""
"http://ftp.ealtlinx.ru/dddd/dddd.tar.bz2"
check_url 2
"Source"
"0"
"http://ftp.ealtlinx.ru/dddd/dddd.tar.bz2"
check_url 3
"Source"
"0"
"http://ftp.ealtlinx.ru/dddd/dddd.tar.bz2 "
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