Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-builder
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
Жора Змейкин
ximper-builder
Commits
84ff9835
Verified
Commit
84ff9835
authored
Jul 17, 2026
by
Жора Змейкин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gen-apt-conf: fix option and output handling
Signed-off-by:
Жора Змейкин
<
katze@etersoft.ru
>
parent
a5f5f7b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
gen-apt-conf
bin/gen-apt-conf
+15
-7
No files found.
bin/gen-apt-conf
View file @
84ff9835
...
@@ -6,7 +6,7 @@ NETWORK=false
...
@@ -6,7 +6,7 @@ NETWORK=false
# shellcheck disable=SC1091
# shellcheck disable=SC1091
.
"
$(
dirname
"
$0
"
)
/common"
.
"
$(
dirname
"
$0
"
)
/common"
OPTS
=
$(
getopt
-o
h
,d:,
r:
--long
help
,net,network,dir:,repos:
--
"
$@
"
)
||
{
OPTS
=
$(
getopt
-o
h
d:
r:
--long
help
,net,network,dir:,repos:
--
"
$@
"
)
||
{
print_error
"Ошибка обработки опций."
print_error
"Ошибка обработки опций."
}
}
...
@@ -28,11 +28,11 @@ while true; do
...
@@ -28,11 +28,11 @@ while true; do
;;
;;
-d
|
--dir
)
-d
|
--dir
)
buildertmp
=
"
$2
"
buildertmp
=
"
$2
"
shift
shift
2
;;
;;
-r
|
--repos
)
-r
|
--repos
)
REPOS
=
"
${
2
//,/
}
"
REPOS
=
"
${
2
//,/
}
"
shift
shift
2
;;
;;
--net
|
--network
)
--net
|
--network
)
NETWORK
=
true
NETWORK
=
true
...
@@ -48,6 +48,12 @@ while true; do
...
@@ -48,6 +48,12 @@ while true; do
esac
esac
done
done
if
[
-z
"
$buildertmp
"
]
||
[
"
${
buildertmp
#-
}
"
!=
"
$buildertmp
"
]
;
then
print_error
"Не указан tmp каталог: используйте -d или --dir"
fi
mkdir
-p
--
"
$buildertmp
"
||
print_error
"Не удалось создать tmp каталог:
$buildertmp
"
APTCONF
=
"
$buildertmp
/apt.conf.ximper"
APTCONF
=
"
$buildertmp
/apt.conf.ximper"
SOURCES
=
"
$buildertmp
/sources.list.ximper"
SOURCES
=
"
$buildertmp
/sources.list.ximper"
...
@@ -88,16 +94,18 @@ EOF
...
@@ -88,16 +94,18 @@ EOF
}
}
gen_sources
()
{
gen_sources
()
{
local
repo
for
repo
in
$REPOS
;
do
for
repo
in
$REPOS
;
do
if
[
[
"
$repo
"
==
*
hasher
*
]
]
;
then
if
[
"
$repo
"
==
"hasher"
]
;
then
cat
<<
EOF
>> "
$SOURCES
"
cat
<<
EOF
>> "
$SOURCES
"
rpm-dir file:/tmp/.private/
$USER
/hasher-sisyphus-64/ repo/x86_64 hasher
rpm-dir file:/tmp/.private/
$USER
/hasher-sisyphus-64/ repo/x86_64 hasher
EOF
EOF
continue
continue
fi
fi
local
def
=
"
${
REPO_DEFS
[
$repo
]
}
"
local
def
=
"
${
REPO_DEFS
[
$repo
]
-
}
"
[
-
z
"
$def
"
]
&&
continue
[
-
n
"
$def
"
]
||
print_error
"Неизвестный репозиторий:
$repo
. Используйте -h для справки."
IFS
=
'|'
read
-r
type
path
<<<
"
$def
"
IFS
=
'|'
read
-r
type
path
<<<
"
$def
"
add_repo
"
$type
"
"
$path
"
add_repo
"
$type
"
"
$path
"
...
@@ -105,7 +113,7 @@ EOF
...
@@ -105,7 +113,7 @@ EOF
}
}
gen_config
()
{
gen_config
()
{
cat
<<
EOF
>
>
"
$APTCONF
"
cat
<<
EOF
> "
$APTCONF
"
/*
/*
* This is the main configuration file for the APT suite of tools,
* This is the main configuration file for the APT suite of tools,
* see apt.conf(5) for details.
* see apt.conf(5) for details.
...
...
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