Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9349294
dot_add_content
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
538 B
Subscribers
None
dot_add_content
View Options
#!/bin/bash
DOT_FILE
=
"
$1
"
DOT_EXTRA
=
"
$2
"
SQL_SCHEMA
=
"../swh/storage/sql/30-schema.sql"
if
[
-z
"
$DOT_FILE
"
-o
-z
"
$DOT_EXTRA
"
]
;
then
echo
"Usage:
$0
DOT_FILE DOT_EXTRA"
exit
1
fi
if
!
[
-f
"
$SQL_SCHEMA
"
]
;
then
echo
"Cannot find SQL schema
${
SQL_SCHEMA
}
"
1
>
&
2
exit
2
fi
schema_version
=
$(
grep
-i
-A
1
'^insert into dbversion'
"
$SQL_SCHEMA
"
|
tail
-n
1
\
|
sed
-e
's/.*values(//i'
-e
's/,.*//'
)
head
-n
-1
"
$DOT_FILE
"
# all of $DOT_FILE but last line
sed
"s/@@VERSION@@/
$schema_version
/"
"
$DOT_EXTRA
"
echo
"}"
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Jul 4 2025, 7:15 PM (6 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239466
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment